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:
Will Robertson <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Fri, 13 Feb 2009 10:02:27 +1030
Content-Type:
multipart/signed
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?)

Cheers,
Will

ATOM RSS1 RSS2