Re: Using Japanese and English strings, encodings



"drrobot" <drrobot@xxxxxxxxx> writes:

Wow! I never expected that the guy who wrote one of my favorite books
on lisp would also be the one answering my questions! Many thanks on
the book; I refer to it often.

Glad you like it!

As a bit of background may clarify why I wanted to do this. I'm an
american grad student in Japan right now, and I often find myself
writing documents twice, once in english, and once in japanese, over
and over again, and getting annoyed at the constant back-and-forth
revisions required to both documents.

I found it a useful time-saver to write all my research reports as
Lisp source file, and use some scripts I wrote a while ago to
transform the lisp source file into something else (either LaTeX
document or HTML/XML) using some very, very simple macros and some
perl scripts from before I came to Japan.

Ah, so if it was me, I'd solve that probem with my Markup library[1].
Then you could write something like this:

\en{This is an English sentence.}\pl{Isthay isway anway Igpay
Atinlay entencesay.}

Or you might choose to alternate at the paragraph level. Anyway, you
can think of Markup as a sort of alternative sexp syntax optimized for
stuff that is mostly text. You can then use Common Lisp to manipulate
the resulting sexps however you want though there are already backends
for generating HTML and PDF. (I believe I have a patch from someone
that provides a LaTeX backend but I haven't had a chance to look at it
yet.)

-Peter

[1] <http://www.gigamonkeys.com/lisp/markup/>

--
Peter Seibel * peter@xxxxxxxxxxxxxxx
Gigamonkeys Consulting * http://www.gigamonkeys.com/
Practical Common Lisp * http://www.gigamonkeys.com/book/
.



Relevant Pages

  • Re: Survey: Do you use the "2" in Lisp-2?
    ... Why You should Not Use The Jargon Lisp1 and Lisp2 ... Graham's On Lisp, I'm wondering what the advantages of a Lisp-2 ... For another example, consider today's PHP language. ... Now, the question is, why do Lisps before Common Lisp have this multi- ...
    (comp.lang.lisp)
  • Re: Program compression
    ... problems to be solved much more concisely than with Lisp. ... In Common Lisp, it's another one line of code: ... My point is that different languages are based on different things ... it would be impossible for the author of a macro (in the Lisp ...
    (comp.programming)
  • Re: Program compression
    ... In Common Lisp it's just one line of code: ... In OCaml with OCaml's notation: ... In Common Lisp, it's another one line of code: ... Consider parsing Mathematica expressions including lists, rules, sums, ...
    (comp.programming)
  • Re: How Common Lisp sucks
    ... Note that the title of this post is *HOW* CL sucks, ... I would like to embed a language that is very similar to Common Lisp, but which differs in how it handles global variable references and arguments) syntax. ... And if it were done it would result in strictly greater expressive power. ...
    (comp.lang.lisp)
  • Re: Popularity of programming languages
    ... >> achieve portability across many CL implementations in your own code, ... > standard simply doesn't provide what writers of portable code need. ... > - Lisp is a rich language with a standard ... The Common Lisp standard provides a lot more stuff than the Scheme ...
    (comp.lang.lisp)