## LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

 Options: Use Forum View Use Monospaced Font Show Text Part by Default Condense Mail Headers Message: [<< First] [< Prev] [Next >] [Last >>] Topic: [<< First] [< Prev] [Next >] [Last >>] Author: [<< First] [< Prev] [Next >] [Last >>]

Will Robertson writes:
> On 04/12/2008, at 3:03 AM, Arno Trautmann wrote:
>
> > why is \if:w, but \if_meaning:NN, \if_cs_meaning:NN and
> > \if_token_eq:NN?
> > The syntax is the same in all cases – I would have expected :w after
> > all.
>
> \if:w corresponds to the primitive \if, whereas \if_meaning:NN and so
> on are \ifx. From TeX by Topic:
>
> > After \if TEX will expand until two unexpandable tokens are
> > obtained, so it is necessary to prefix expandable control sequences
> > and active characters with \noexpand when testing them with \if.
>
> So while \if does take two tokens as input, it will also expands them
> in a weird kind of way; actually, it might even be possible to name it
> \if:ff ! But I'm not really for that idea :)

and that is good as it would be wrong:

\def\foo{ab}
\if \foo \ERROR \else good \fi

\if expands until it finds two tokens that are unexpandable, so in the above
it never even sees \ERROR as it is happy with "a" and "b" not being equal

so it is truely a \if:w wheras \ifx really picks up the next two tokens in the
input stream for comparison, so :NN is correct here.

What isn't 100% consistent is that all these lowlevel thingies are then go
and fast parse for \else and/or \fi so in that sense they are all more like
\if_meaning:NNw

>
> * * *
>
> Regarding the three different names for \ifx -- yes, that needs to be
> cleaned up; but in the end there still may well be more than one name
> for it. (Well, I'm not opposed to the idea, at least.)

neither am I if it serves a purpose, here however it looks as if some cleanup
would be useful

frank