"Detokenizace" ??

Zdenek Wagner wagner at cesnet.cz
Mon May 16 09:01:51 CEST 2005


On Sun, 15 May 2005, David Necas (Yeti) wrote:

> On Sun, May 15, 2005 at 06:53:43PM +0200, Jaroslav Hajtmar wrote:
> >
Puvodni mail opet sel nekam jinam, ke mne pres konferenci nedorazil.

> > \def\datum{12.5.1995}
> >
> > \def\toengldate #1.#2.#3 {{#3-#2-#1}}
> >
> > \toengldate 12.5.1995   % funguje spravne (vraci 1995-5-12), nebot "."
> > je separatorem mezi jednotlivymi tokeny
> >
> > \toengldate \datum      % nefunguje, nebot \datum je jedniny token
> > <12.5.1995>
>
> Pomohlo by prostě expandovat nejprve \datum, a pak teprve
> \toengldate:
>
>     \expandafter\toengldate\datum
>
To by chtelo jeste jeden krok navic:
\expandafter\expandafter\expandafter\toengldate\expandafter\datum\space

> Ovšem vy máte jako koncový separátor mezeru, která to kazí.
> Podle okolností mi přijdou jako nejjednodušší řešení
>
>     \def\datum{12.5.1995 }
>     \expandafter\toengldate\datum
>
> nebo
>
>     \def\fixme#1{\expandafter\toengldate#1 }
>     \fixme\datum
>
> Záleží na tom, jak se to 12.5.1995 do \datum dostává.
>
> Yeti
>
>
> --
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?
> A: Top-posting.
> Q: What is the most annoying thing on usenet and in e-mail?
>

Zdenek Wagner
e-mail: wagner at cesnet.cz

see also http://hroch486.icpf.cas.cz/wagner/
         http://icebearsoft.euweb.cz





More information about the csTeX mailing list