## LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

 Options: Use Forum View Use Monospaced Font Show HTML Part by Default Show All Mail Headers Message: [<< First] [< Prev] [Next >] [Last >>] Topic: [<< First] [< Prev] [Next >] [Last >>] Author: [<< First] [< Prev] [Next >] [Last >>]

```as always you keep people straight Heiko ... ok so I oversimplified and as far as I'm concerned we are only doing idle talk anyway .-) ... but ...

concerning the approach i outlined as quick and dirty, that one isn't really defining macros on the fly, but rather making

\foo:noo

looking like a macro (as it is now) while in practice it is executing \foo using noo to decied out to handle upcoming arguments. as far as i can see that should work in an expandable context like \write since the l3expan stuff is expandable

---------------

the other suggestion I made was to do "on the fly" in the sense that during definition time time only. That is something I still think you can do fairly robust but yes you have to restrict on what is possible and what is constructed or identified, e.g., only explicit comman names would be recognized, \foo:noo but not \csname foo:#1 \endcsname or worse ...

once the definition has be parsed all used variants within its body are defined as well, question of local/global doesn't arrise as the variants should all be globally defined

frank

-----Ursprüngliche Nachricht-----
Gesendet: Mittwoch, 10. September 2008 13:07
Betreff: Re: expl3 variant expansion forms

Hello,

On Wed, Sep 10, 2008 at 12:40:38PM +0200, Frank Mittelbach wrote:

>  > When I first read about expl3 years ago, indeed I was naively  >
> disappointed that the variants weren't constructed "on the fly". But
> > that's obviously impossible.
>
> obviously impossible is perhaps too strong a word,

How do you want to define macros on the fly, being in expandable contexts (inside \edef, \write, ...)? Or is the use of these macros forbidden inside expandable contexts?

Next question, how does the "on the fly" process (if such a thing might exist) decide to define a macro globally or locally?
Local stuff making global isn't a good idea generally, thus local definitions remain. But this can be ineffective, if the yet undefined variant is only called inside a separate group.

Yours sincerely