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
Joseph Wright <[log in to unmask]>
Wed, 2 Sep 2009 20:23:09 +0100
text/plain (25 lines)
Lars Hellström wrote:
> Finally, there is the issue that a processor has to put the argument in
> a toks register. I understand this is for generality (only sane way to
> pass along # tokens), but my experience with this type of API is that
> one should make it easy to use commands that happen to already exist. In
> this case, it would mean to also support a processor that would store
> its result in a macro rather than a toks register, since I'm quite sure
> this is what people tend to do unless they definitely need a toks register.

Maybe I'm missing something here, but if we need the processed value
returned in a named variable it should not matter whether it is a toks
or a tl (or indeed anything else). All that needs to happen is

\toks_set:NV \l_xparse_arg_toks <variable-used-in-processor>

which is the same action if <variable-used-in-processor> is a tl or a
toks. As there are add left/right functions for toks, there should also
be no problem "building up" \l_xparse_arg_toks piecewise:

\toks_out_right:Nn \l_xparse_arg_toks { <whatever> }

and so on.
Joseph Wright