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:
Heiko Oberdiek <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Sat, 25 Apr 2009 20:37:04 +0200
Content-Type:
text/plain
Parts/Attachments:
text/plain (57 lines)
On Sat, Apr 25, 2009 at 06:24:08PM +0200, Uwe Lück wrote:

> >On 24/04/2009, at 6:51 PM, Heiko Oberdiek wrote:
> >>%%% begin of fixed definition %%%
> >>\def\in@#1#2{%
> >> \def\in@@##1#1##2\in@@{%
> >>   \def\in@@{##2}%
> >>   \ifx\in@@\@empty
> >>     \in@false
> >>   \else
> >>     \in@true
> >>   \fi
> >> }%
> >> \in@@#2\@nil#1\in@@
> >>}
> >>%%% end of fixed definition %%%
> 
> (This uses \@nil.) Putting the second split into a macro to test it against 
> \@empty is safe, but one might dislike it as "slow".

I prefer "safe".

> Other proposals need 

I haven't seen any so far.
An expandable test could be used, e.g.:
  \ifx\\##2\\% or something else as \\
instead of
  \def\in@@{##2}%
  \ifx\in@@\@empty
But the disadvantage is that an unmatched \if..., \else or \fi inside ##2
breaks the \if constructs of \in@@, thus it isn't safe. And because
exandibility isn't neede here (the first definition destroys this
property anyway), I have used the more safe test for emptiness in
my proposal.

> Heiko's proposal doesn't use \in@ in the last line that calls \in@@. This 
> would allow replacing \@nil by \in@, which wouldn't introduce a new control 
> word.

It's ok with me.

> My favourite tends to be replacing so-far-LaTeX's test against \in@ by a 
> test on emptiness (as Heiko proposed) in a way slightly similar to ifmtarg 
> (third line):
> 
> \def\in@#1#2{%
>  \def\in@@##1#1##2\in@@{%
>   \ifx\in@@##2\in@@\in@false\else\in@true\fi}%
>  \in@@#2\in@#1\in@@}

I isn't robust, if unmatched conditionals are inside ##2,
see above.

Yours sincerely
  Heiko <[log in to unmask]>

ATOM RSS1 RSS2