Received: from mail.proteosys.com ([213.139.130.197]) by nummer-3.proteosys with Microsoft SMTPSVC(6.0.3790.3959); Sat, 25 Apr 2009 18:33:36 +0200 Received: by mail.proteosys.com (8.14.3/8.14.3) with ESMTP id n3PGXX7U029175 for ; Sat, 25 Apr 2009 18:33:34 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id n3PGSpeJ028294 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 25 Apr 2009 18:28:51 +0200 Received: from listserv.uni-heidelberg.de (localhost.localdomain [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id n3PC044I028540; Sat, 25 Apr 2009 18:28:42 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 15.5) with spool id 275652 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Sat, 25 Apr 2009 18:28:41 +0200 Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id n3PGSfQx013134 for ; Sat, 25 Apr 2009 18:28:41 +0200 Received: from fmmailgate02.web.de (fmmailgate02.web.de [217.72.192.227]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id n3PGSR6h027916 for ; Sat, 25 Apr 2009 18:28:30 +0200 Received: from smtp07.web.de (fmsmtp07.dlan.cinetic.de [172.20.5.215]) by fmmailgate02.web.de (Postfix) with ESMTP id 654EDFDB4688 for ; Sat, 25 Apr 2009 18:28:27 +0200 (CEST) Received: from [89.50.23.7] (helo=uwe.lueck) by smtp07.web.de with esmtp (SSLv3:DES-CBC3-SHA:168) (WEB.DE 4.110 #277) id 1Lxkjp-00047L-00; Sat, 25 Apr 2009 18:28:25 +0200 X-Sender: uwe.lueck@pop3.web.de X-Mailer: QUALCOMM Windows Eudora Version 5.1 References: <20090424092120.GA7843@irwin.vpn.uni-freiburg.de> <5.1.0.14.0.20090421122917.02f41830@pop3.web.de> <455691F1-21A4-4C65-A025-7855791829F7@gmail.com> <20090424092120.GA7843@irwin.vpn.uni-freiburg.de> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1"; format=flowed X-Sender: uwe.lueck@web.de X-Provags-ID: V01U2FsdGVkX1+dvcUyDGzrbq9+Os9BzYFxyz+2KPabZdlAQWbd OXrUJdWVwbDx2mH15L5sDjmhlSXTTbA+Bn/EZOrhkdQ+ec4fB1 ZjKLiTz88= Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by listserv.uni-heidelberg.de id n3PGSfQx013135 Message-ID: <5.1.0.14.0.20090425151542.032a0ce0@pop3.web.de> Date: Sat, 25 Apr 2009 18:24:08 +0200 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Uwe =?iso-8859-1?Q?L=FCck?= Subject: Re: \in@ wrong? To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <8A0E5152-03D5-4905-8809-6F37D7EF06BD@gmail.com> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-ProteoSys-SPAM-Score: -6.599 () BAYES_00,RCVD_IN_DNSWL_MED X-Scanned-By: MIMEDefang 2.65 on 213.139.130.197 Return-Path: owner-latex-l@LISTSERV.UNI-HEIDELBERG.DE X-OriginalArrivalTime: 25 Apr 2009 16:33:36.0493 (UTC) FILETIME=[94F1A9D0:01C9C5C3] Status: R X-Status: X-Keywords: X-UID: 5766 At 11:47 24.04.09, Will Robertson wrote: >It seems that the old documentation for the >command was also written incorrectly: > >% |\@in| is a utility macro with two arguments. It determines >% whether its first argument occurs in its second (after expanding >% it) and sets the switch |\if@in| accordingly. > >Unless I'm mistaken, there was no expanding going on in the old >version; I'm going to change this accordingly. I think the parentheses mean that the second argument *may need* expansion in certain applications and will be expanded indeed in such cases -- by other means. Indeed there are many applications in latex.ltx where some `\expandafter's or an \edef (also by \@expandtwoargs) expand the second argument. For discussion, I am quoting the *old* definition: \def\in@#1#2{% \def\in@@##1#1##2##3\in@@{% \ifx\in@##2\in@false\else\in@true\fi}% \in@@#2#1\in@\in@@} At 11:25 24.04.09, Morten Høgholm wrote: >Unless I am completely mistaken, writing a new version is a simple >task: just make the second argument start with something that should >not appear in input, such as a the nil marker. I wonder what "second argument" means here -- perhaps the idea is replacing the last line above by \in@@#2\@nil#1\in@\in@@} However, can we be sure that \@nil (or also \@@nil) won't be in the input? \in@@#2\@in@#1\in@\in@@} would be safer, currently there is no \@in@ in latex.ltx, and it is natural not to use \in@ with \@in@ in an argument. (\in@@ cannot be used since it is the common delimiter, and \in@ would fail with one-token second arguments of \in@.) >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". Other proposals need only the first definition of a macro, \in@@. 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. 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@@} With \in@{}{}, the emptiness test is correct unless is in where is a copy of the actual \in@@. The final split ##2 is non-empty iff is in or is in where is \in@. (The latter case includes that could be a sequence of `\in@'s where ##2 would be one \in@.) Shouldn't there be a report on the bug database for referring to the problem? Cheers! Uwe.