Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by h1439878.stratoserver.net (8.14.4/8.14.4/Debian-2ubuntu2.1) with ESMTP id t8BANexD004551 for ; Fri, 11 Sep 2015 12:23:41 +0200 Received: from relay.uni-heidelberg.de ([129.206.100.212]) by mx-ha.gmx.net (mxgmx109) with ESMTPS (Nemesis) id 0LinRJ-1Z4Zya3Twb-00d0vC for ; Fri, 11 Sep 2015 12:23: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 t8BAMBMe019751 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 11 Sep 2015 12:22:11 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id t8B8RTnC029702; Fri, 11 Sep 2015 12:22:10 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 12534136 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Fri, 11 Sep 2015 12:22:10 +0200 Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.119.212]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id t8BAMAdn024758 for ; Fri, 11 Sep 2015 12:22:10 +0200 Received: from ftx-008-i775.relay.mailchannels.net (ftx-008-i775.relay.mailchannels.net [50.61.143.75]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id t8BAM1wQ024771 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 11 Sep 2015 12:22:06 +0200 X-Sender-Id: netnames|x-authuser|joseph.wright@morningstar2.co.uk Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 32A0B120A45 for ; Fri, 11 Sep 2015 10:22:00 +0000 (UTC) Received: from smtp3.easily.co.uk (ip-10-237-13-110.us-west-2.compute.internal [10.237.13.110]) by relay.mailchannels.net (Postfix) with ESMTPA id 95FFA1201EE for ; Fri, 11 Sep 2015 10:21:58 +0000 (UTC) X-Sender-Id: netnames|x-authuser|joseph.wright@morningstar2.co.uk Received: from smtp3.easily.co.uk (smtp3.easily.co.uk [10.21.145.197]) (using TLSv1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:2500 (trex/5.5.1); Fri, 11 Sep 2015 10:22:00 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: netnames|x-authuser|joseph.wright@morningstar2.co.uk X-MailChannels-Auth-Id: netnames X-MC-Loop-Signature: 1441966918992:906106172 X-MC-Ingress-Time: 1441966918992 Received: from [139.222.114.163] (port=64487 helo=[139.222.114.163]) by smtp3.easily.co.uk with esmtpa (Exim 4.43) id 1ZaLSu-00016c-D0 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Fri, 11 Sep 2015 11:21:56 +0100 References: <20150911094655.GA29867@hzdr.de> <55F2A790.9090709@morningstar2.co.uk> <20150911101759.GA30955@hzdr.de> User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit X-AuthUser: joseph.wright@morningstar2.co.uk Message-ID: <55F2AB44.7010107@morningstar2.co.uk> Date: Fri, 11 Sep 2015 11:21:56 +0100 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Joseph Wright Subject: Re: non-intuitive behaviour of clist with empty items To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <20150911101759.GA30955@hzdr.de> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: Envelope-To: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=V3; X-GMX-Antivirus: 0 (no virus found) X-UI-Filterresults: notjunk:1;V01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gx8q8emYmRF+wbRgX 4txKiJoPaPp/aeEwie8xoVtVcKKIwqWKvg/6CkOxdiQ2/RHKEAdK X-Scanned-By: MIMEDefang 2.71 on 85.214.41.38 Status: R X-Status: X-Keywords: X-UID: 7869 On 11/09/2015 11:17, Alexander Grahn wrote: > On Fri, Sep 11, 2015 at 11:06:08AM +0100, Joseph Wright wrote: >> On 11/09/2015 10:46, Alexander Grahn wrote: >>> consider the following example: >>> >>> \documentclass{article} >>> \usepackage{expl3} >>> >>> \begin{document} >>> \ExplSyntaxOn >>> \clist_set:Nn\l_tmpa_clist{,,foo,bar,} >>> \typeout{\clist_count:N\l_tmpa_clist} %expected: 5, I get 2. >>> \typeout{\clist_item:Nn\l_tmpa_clist{3}} %expected: `foo`, I get `'. >>> \typeout{\clist_item:Nn\l_tmpa_clist{4}} %expected: `bar`, I get `'. >>> \ExplSyntaxOff >>> \end{document} >>> >>> Why does \clist_set:Nn ignore empty items when initialising a clist >>> variable from a token list? Is this intended behaviour? Is there a >>> work-around? > >> This is by-design. Comma lists can't contain empty items, commas, etc.: >> sequences can. The reason is comma lists are 'close' to the user level, >> and there stray empty entries are normally best ignored. > > This is very unfortunate, because I want to be able to correctly process > user input of comma sparated items which /may/ contain empty items. > > With \@for from LaTeX2e I can easily process such input properly: > > \documentclass{article} > > \begin{document} > \makeatletter > \@for\listitem:=,,foo,bar,\do{ > \typeout{item:\listitem} > } > \makeatother > \end{document} > > Now I am looking for an L3 equivalent of \@for. > > Alexander Can of course be done using a sequence \input expl3-generic % \ExplSyntaxOn \seq_set_split:Nnn \l_tmpa_seq { , } { ,,foo,bar, } \seq_show:N \l_tmpa_seq Joseph