Received: from mx0.gmx.net (mx0.gmx.net [213.165.64.100]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with SMTP id o8K9BX1X032098 for ; Mon, 20 Sep 2010 11:11:34 +0200 Received: (qmail 28990 invoked by alias); 20 Sep 2010 09:11:28 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 20 Sep 2010 09:11:28 -0000 Received: from relay2.uni-heidelberg.de (EHLO relay2.uni-heidelberg.de) [129.206.210.211] by mx0.gmx.net (mx046) with SMTP; 20 Sep 2010 11:11:28 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id o8K9ADCn013457 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 20 Sep 2010 11:10:13 +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 o8K8C6ir012535; Mon, 20 Sep 2010 11:09:19 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 450275 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Mon, 20 Sep 2010 11:09:19 +0200 Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.210.211]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id o8K99Jlg000576 for ; Mon, 20 Sep 2010 11:09:19 +0200 Received: from csep02.cliche.se (csep02.cliche.se [195.249.40.184]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id o8K9A1Zv013260 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 20 Sep 2010 11:10:05 +0200 Received: from nova.local (unknown [130.239.119.168]) by csep02.cliche.se (Postfix) with ESMTP id 947F718665A for ; Mon, 20 Sep 2010 11:09:08 +0200 (CEST) User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2 MIME-Version: 1.0 References: <4C967C9B.5010706@gmx.de> <71ED7A5B-DE11-45D9-9785-95A1DC795080@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by listserv.uni-heidelberg.de id o8K99Jlg000577 Message-ID: <4C9724B4.3010301@residenset.net> Date: Mon, 20 Sep 2010 11:09:08 +0200 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: =?windows-1252?Q?Lars_Hellstr=F6m?= Subject: Re: boolean expressions in ExplSyntaxNames To: LATEX-L@listserv.uni-heidelberg.de In-Reply-To: <71ED7A5B-DE11-45D9-9785-95A1DC795080@gmail.com> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=5D7Q89H36p6i75npGen84eVAEFK/syJmFuaL1OLtauwJ5R/kaZ9HAe8peGX1DeqJL7BW4 1X28hmBsSaikXt0ebYfUaHmtXkk7HChP+4IT8tI+yodefY66PMpp/kPudTSzX7BVqDxUGU4uAf/y ckanA==V1; X-Resent-By: Forwarder X-Resent-For: rainer.schoepf@gmx.net X-Resent-To: rainer@rainer-schoepf.de Status: R X-Status: X-Keywords: X-UID: 6419 Will Robertson skrev 2010-09-20 01.57: > On 20/09/2010, at 6:41 AM, Arno Trautmann wrote: > >> \ExplSyntaxNamesOn >> \bool_if_p:n{ >> \intexpr_compare_p:n {2=3} || >> \intexpr_compare_p:n {4=4} >> } >> \ExplSyntaxNamesOff >> >> \end{document} >> >> In SyntaxNames, I get the error >> >> ! Use of \bool_|_0:w doesn't match its definition. >> \intexpr_compare_p:n {2=3} || >> \intexpr_compare_p:n {4=4} >> l.16 } >> >> The use of&& is successfull in both cases, though. I guess this is >> because the line in ExplSyntax: >> >> \tex_catcode:D 124=11 \tex_relax:D % vertical bar, other >> >> is missing in SyntaxNames. >> So is it intended that boolean expressions cannot be fully evaluated in >> SyntaxNames? Or didn’t anybody have requested this yet? > > > I'd like to hear the opinions of the others; I guess this is an edge case to using SyntaxNames. Ideally, perhaps, we should make \bool_if:n more robust so the catcode of | isn't as critical. My opinion, if anyone cares, is that using && and || at all in the syntax of \bool_if_p:n is stupid eye-candy. The stated situation is just one of the ways in which it leads to problems; another is that it suggests || and && may sensibly be mixed within the condition, which isn't the case either. The natural way to express AND or OR of a bunch of boolean conditions in a macro language such a LaTeX is the LISPish one: have macros/functions whose meaning is "AND of my arguments" and "OR of my arguments". IIRC, that would be \bool_and_p:nn{}{} \bool_or_p:nn {}{} \bool_and_p:nnn{}{}{} \bool_or_p:nnn {}{}{} ... for as long as one likes to continue that list. Lars Hellström