LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

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

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

Print Reply
Subject:
From:
Philipp Stephani <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Sat, 13 Feb 2010 02:07:09 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (40 lines)
Am 12.02.2010 um 23:57 schrieb Frank Mittelbach:

> Hello Philipp,
> 
>>> 
>>> Listing expandable functions was not done to start with, and so I'm
>>> sure this is not the only missing item. (Again, a proper re-write
>>> would probably help here.) On \exp_arg:x, it got taken out of the main
>>> part of expl3 recently (it was supposed to be a wrapper for \expanded,
>>> but as pdfTeX 1.50 does not seem likely as a release we've dropped
>>> it.) I thought we'd removed it from the docs: can you point it out to
>>> me in the current CTAN snapshot|?
>> 
>> I think this should be reimplemented because everybody needs it. I tried to
>> write a small package only with expl3 and xparse, but I still needed an
>> implementation of \exp_arg:x. The l3expan module helps a bit, but there is
>> simply nothing as general and powerful as \edef. Maybe you could define two
>> macros, one expandable and one unexpandable.
> 
> you lost me here. Either you or I are stitting on top of a big
> misunderstanding I think :-) please explain what you need \exp_arg:x for and
> why the l3expan module doesn't help - that module is triple powerful to
> whatever you had for expansion in 2e so ..

expl3 itself uses \exp_arg:x in disguise, e.g. in l3tl.dtx, l. 1504:

\cs_set_nopar:Npn \tl_tmp:w #1 {
  \tl_set:Nx \l_tmpa_tl {
    \exp_not:N \prg_new_conditional:Npnn \exp_not:c {tl_if_eq:#1}
      ####1 ####2 {p,TF,T,F} {
        \exp_not:N \tex_ifnum:D
        \exp_not:c {tl_compare:#1} {####1}{####2}
        \exp_not:n{ =\c_zero \prg_return_true: \else: \prg_return_false: \fi: }
    }
  }
  \l_tmpa_tl
}

Codes like that are very common. I also think that this is not too elegant, but in many cases there is no other way. \edef lets you specify completely arbitrary combinations of expansions, something that is impossible otherwise. It doesn't matter that it is not expandable because the result must be executed anyway.

ATOM RSS1 RSS2