Print

Print


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]>