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
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Fri, 11 Sep 2015 11:06:08 +0100
Reply-To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Message-ID:
Subject:
MIME-Version:
1.0
Content-Transfer-Encoding:
7bit
In-Reply-To:
Content-Type:
text/plain; charset=iso-8859-15
From:
Joseph Wright <[log in to unmask]>
Parts/Attachments:
text/plain (30 lines)
On 11/09/2015 10:46, Alexander Grahn wrote:
> Good afternoon,
> 
> 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?
> 
> Kind regards
> Alexander

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.

Joseph

ATOM RSS1 RSS2