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
Mime-Version: 1.0 (Apple Message framework v930.3)
Sender: Mailing list for the LaTeX3 project <[log in to unmask]>
From: Will Robertson <[log in to unmask]>
Date: Fri, 13 Feb 2009 10:02:27 +1030
In-Reply-To: <[log in to unmask]>
Content-Type: multipart/signed; boundary=Apple-Mail-2-623793501; micalg=sha1; protocol="application/pkcs7-signature"
Reply-To: Mailing list for the LaTeX3 project <[log in to unmask]>
Parts/Attachments: text/plain (1225 bytes) , smime.p7s (2446 bytes)
On 12/02/2009, at 5:36 PM, Joseph Wright wrote:

> A more complex example:
> \def\foo{\edef\bar{stuff}}
> is not fully expandable, but if you get the test working should give
> \c_true.  So I think this might not be a good idea.  (I assume that  
> this
> test is supposed to see if something is a macro.  I do that in  
> siunitx,
> but using \meaning and looking for "macro".)

I think this function is supposed to mean "check if the token will (or  
has the capability to) expand into something else". So it's not  
exactly testing for being a macro or otherwise, more if it will  
"change" when used in an edef or similar.

> Should~be~F:~\token_if_expandable:NTF \the {T} {F} \\

So here, while \the isn't a macro, it will expand when used correctly  
in an edef (e.g., \edef\foo{\the\baselineskip} ).  I've explicitly  
caught undefined macros to return "F" because it just seemed more  
logical that way.

Three questions, then:

1.  Have I got the idea behind this function right? (Morten?)
2.  Was it indeed originally broken, and does my code fix it?
3.  Can we think of a less confusing name for it?
     Maybe  \token_if_will_expand  ?
     Unless it's only me that finds "\token_if_expandable" confusing.

(4. What is it good for?)