Print

Print


>> Do we care about keeping braces surrounding an element in a sequence
>> (I'd say yes, although it requires more care)?
>
> Absolutely, yes.

More on that. Many of the functions in the seq module are defined somewhat like

    \cs_new:Npn \seq_foo:w \seq_elt:w #1 \seq_elt_end: {... #1 ...}

This removes braces around #1. Since the documentation explicitly
states that seq can contain any token except `\seq_elt:w` and
`\seq_elt_end:`, I started reimplementing many of the functions to
avoid removing braces.

However, I'm now seeing that "We use explicit delimiters instead of
braces around text to allow efficient searching for an item in the
sequence." But that won't work if the item contains `{`, `}`, or `#`.

**So my question is: do we want to support braces in seq items or not?**

One option would be to say yes, and provide two search functions: one
quick one if the item does not contain braces nor `#`, and a slower
one which recurses through the arguments and compares with
`\tl_if_eq:nnTF`.

-- 
Regards,
Bruno