Subject: | |
From: | |
Reply To: | |
Date: | Sun, 9 Dec 2007 22:21:28 +0100 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Hello,
On Sun, Dec 09, 2007 at 08:14:31PM +0100, Morten Høgholm wrote:
> Usually the x expansion meant "uses \edef" and so they were all
> non-expandable. But now that we have pdfeTeX'ed the l3 kernel, we have
> functions doing full expansion like \numexpr and friends and \pdfstrcmp
> (does \edef on both arguments) used in \tlist_if_eq:xxTF. This reminds me:
> the notes from the Oldenburg meeting mentions an \expanded primitive:
> \expanded <general text>
> Expandable command returning the full expansion
> of the tokens in <general text>.
> So since this pretty much exists inside \pdfstrcmp as it is now, it could
> go into pdfTeX 1.50 and we would be free of these problems. Except of
> course, \expanded is already used a lot in ConTeXt with different
> semantics.
>
> Any opinions from the ConTeXt/pdfTeX people here?
I miss "\expanded", too.
A workaround for a \detokenize with expanded argument:
\pdfunescapehex{\pdfunescapehex{...}}
For LuaTeX \pdf(|un)escapehex are defined in package `pdftexcmds':
\pdf@unescapehex and \pdf@escapehex, both are expandable.
Disadvantages of the workaround:
* slower
* no <general text>, but macro argument
* detokenization happens.
But I assume, you want only expansion, not detokenization?
(then the latter can be achieved by
\detokenize\expandafter{\expanded{...}})
Biggest problem is probably a good name:
a) \expanded would be a nice name, but it clashes with ConTeXt.
I remember trouble with \unexpanded :-(
b) It would belong to e-TeX, but there isn't a e-TeX prefix:
\etexexpanded or \etexexpand
c) pdfTeX's convention with prefix "\pdf" (see \pdfstrcmp, \pdfescape*):
\pdfexpanded or \pdfexpand
d) longer names
My preference is c) to avoid trouble with macro name clashes.
I can live with a), then my package etexcmds would get a
new macro \[log in to unmask]
Yours sincerely
Heiko <[log in to unmask]>
PS: ntg-pdftex list added.
|
|
|