LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Heiko Oberdiek <[log in to unmask]>
Wed, 16 Feb 2011 11:51:25 +0100
text/plain (27 lines)
On Wed, Feb 16, 2011 at 07:04:42AM +0000, Joseph Wright wrote:

> Again, post the code :-) I wonder what exactly you mean here. With the
> \expanded primitive (pdfTeX 1.50 or LuaTeX) you can do
>   \edef\a{\expanded{\def\a{b}}}
> and have \a => 'b'.

I doubt it. \edef is already expanding, \def is expanded
but it is not executed as primitive. Depending on the previous
definition of \a you get:
* \a previously undefined: error message
* \a defined, unexpandable: \a is macro => \def\a{b}
* \a defined, expandable: \a is expanded until only non-expandable
  tokens are left or there is an error. In case of success,
  \a is a macro that starts with "\def", followed by the result
  of fully expansion of "\a{b}..."

In most cases \edef\a{\def\a{b}} and
\edef\a{\expanded{\def\a{b}}} are the same, but there might
be differences, if \a is expandable and \noexpand or
\the<token register> are used.

Yours sincerely
  Heiko <[log in to unmask]>