LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

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

Print Reply
Sender: Mailing list for the LaTeX3 project <[log in to unmask]>
Date: Sat, 13 Feb 2010 17:26:35 +0100
Reply-To: Mailing list for the LaTeX3 project <[log in to unmask]>
Message-ID: <[log in to unmask]>
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
In-Reply-To: <[log in to unmask]>
Content-Type: text/plain; charset=us-ascii
From: Frank Mittelbach <[log in to unmask]>
Parts/Attachments: text/plain (52 lines)
Will Robertson writes:
 > On 13/02/2010, at 11:37 AM, Philipp Stephani wrote:
 > > 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.
 > I've proposed adding this version of \exp_arg:x to expl3 relatively recently.
 > (It's the first on the list of l3candidates.dtx.)
 > Your feedback helps us to decide whether it should be included.
 > Any thoughts from others?

I don't think it should be added - not for the non-expandable operation that
we are currently talking about.

For starters the command you are looking for already exists, sort of at
least. It is called \use:x if you think about it:

  \use:n is the base function that takes its argument and returns it without
  the braces.

  \use:x is then the command that fully expands its argument (using the power
  of \edef that Philipp is looking for) and passes presents the result to
  \use:n, which is what you are looking for.

we currently don't have \cs_generate_variant:Nn \use:n {x} but I guess we
should provide it (though probably coded more efficiently like \use:c which is
also not defined as a variant).

if we do get \expanded as a standard primitive we might rethink that

but then we might then implement all \exp_args:N...x as expandable versions
and that would make \use:x equiv to \expanded if done right, so don't know if
we would need another name either.

my thoughts