Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by h1439878.stratoserver.net (8.14.4/8.14.4/Debian-2ubuntu2.1) with ESMTP id t8BAuRR0004643 for ; Fri, 11 Sep 2015 12:56:28 +0200 Received: from relay2.uni-heidelberg.de ([129.206.119.212]) by mx-ha.gmx.net (mxgmx013) with ESMTPS (Nemesis) id 0MVZjb-1Z8biU342B-00Z170 for ; Fri, 11 Sep 2015 12:56:21 +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 t8BAsB5g012507 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 11 Sep 2015 12:54: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 t8B8RTQH005861; Fri, 11 Sep 2015 12:54:11 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 12538238 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Fri, 11 Sep 2015 12:54: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 t8BAsAnB002935 for ; Fri, 11 Sep 2015 12:54:10 +0200 Received: from mxout.hzdr.de (mxout.hzdr.de [149.220.4.85]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id t8BAs5l7012455 for ; Fri, 11 Sep 2015 12:54:07 +0200 Received: from fz-rossendorf.de (cg.hzdr.de [149.220.4.66]) by mxout.hzdr.de (Postfix) with ESMTP id EBBA3BC61 for ; Fri, 11 Sep 2015 12:54:04 +0200 (CEST) Received: from [149.220.65.84] (HELO fwo045.hzdr.de) by hzdr.de (CommuniGate Pro SMTP 6.1.5) with ESMTP id 11987447 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Fri, 11 Sep 2015 12:54:04 +0200 Received: by fwo045.hzdr.de (Postfix, from userid 1530) id 0C394E806E; Fri, 11 Sep 2015 12:53:52 +0200 (CEST) References: <20150911094655.GA29867@hzdr.de> <55F2A790.9090709@morningstar2.co.uk> <20150911101759.GA30955@hzdr.de> <55F2AB44.7010107@morningstar2.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Message-ID: <20150911105351.GB30955@hzdr.de> Date: Fri, 11 Sep 2015 12:53:51 +0200 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Alexander Grahn Subject: Re: non-intuitive behaviour of clist with empty items To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <55F2AB44.7010107@morningstar2.co.uk> 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:K0:HNxEFV438Qw=:2H38sz2tgfzBcFPkNSTg/MOrCV E5h8kbburG1Hmp3DqBA7wJ9q1eMQfu5Sp3dcd1aQxJqsS88e5nPPNrXG8kcKl1Q+qbF3R2CJx 39oYb+k7NljY/lo3S/ZFKWy7+i0PguPt9iZ+I2JER4nCi1KrbMh+xMruc5cYSAcIaQOuY1+T/ TgLKyW9KCJr3XWEvO3vpORxOR5RPhNQye8MZ/GeYOlR4Orb6hIZT2GS1iqy4AG2StoHzm/Tv4 2bHV03/XmmS4hXGjOhlW9YtIhomjfXbyFrr5P/lIFsOjkNCfJieEbg9VrgEr9UjRe/qOcIlsO KYYFK4FrRsGpuENfWJjxuvcbJ1FaFxGkU/XPmElqnZqCUfHzdjTFfSTwK9YX01Nx5KP3nEa4O S5fJSTEs9qvo/dhlyI4Wx84E4VEvS/qjAOa64egEKbj6A7v+NR+jsKS7yRi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o=:aRXSj3Hf43B/776RB9sSbUYU6zLUMi2mejwBF5xQVGo= X-UI-Out-Filterresults: notjunk:1;V01:K0:JrLMRLMaPx4=:J5CXrU+60YZDenXvyhPnUI itfIeOiRA/omh71hXrobF5o5CXAjKPHkPdPbBowJdYxSyHUhEb6qLkaB9KJlakJbJaV1LjKZL oatzMILvEx2ZYI8qRD9uyhEU1lJC0MAH2zIf6IgsMrVSeZeSRdWX4+YKMe0PqfUefxoAM71Yz kAd9gExeZuLVp7csbDjh+S+d+ZbCTRZpYp0HJWxfG9USt8mDOJ84FUy/FbvjirIJKYoxyKzE3 EJ9rjBWnk64M0eNHYudnkWJexdiwyOJHTxAHDBHJg/u0nIcZkPQO0Xfzj/dum2wOvmN0sLXNR TGQQYgzzdys69D9oQAnLvcF7u8KqxE9bqx5Y0lz6zOVaLNP3XSFxUWe99J9/dIIaj7TuuditV ND8EQ1bi8E+KyAt5duY/Ezz+k2JpZj42CRXgWU1xwHpbSbp0ScJksQr9vVw3MoG/VUQj7n6bh SpxEpMPiYZEaXSM2lLYmDJQu2MgQRAZNsjkc0oU1RYF7UQ+VWOhB X-Scanned-By: MIMEDefang 2.71 on 85.214.41.38 Status: R X-Status: X-Keywords: X-UID: 7870 On Fri, Sep 11, 2015 at 11:21:56AM +0100, Joseph Wright wrote: >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 > Perfect! Thanks a lot! Alexander