Print

Print


> I need to read through everything, but as you are looking at a total
> reimplementation, more or less, do we really need two markers in a
> sequence? I've got an 'alternative' sequence system to work with just
> one (\q_seq), but at present it strips braces. (I know that because I
> checked after you started this thread: I'd have suggested my version
> otherwise!)
> --
> Joseph Wright

If we want to avoid losing braces, there are essentially two ways.
Either have two markers, `\seq_elt:w <item> \seq_elt_end:`, but the
code is tricky, or have one marker only, and braces, as `\seq_elt:n
{<item>}`. I'm essentially taking this from the TeXbook, p. 378 (and
thinking on my own, but well... I do trust Knuth's knowledge of TeX).

Will's version (and I guess yours if you use
`\quark_if_recursion_tail_stop:n`) breaks for items like
{{{{{{a}}}}}}, or some cases with conditionals. So let me also propose
a fix for `\quark_if_recursion_tail_stop:n` and friends (see attached
for examples where the current version is broken, and for the fix).
The new version should be \~10\% slower (not really checked that
claim), but would not break, although it would consider
`{}\q_recursion_tail` to be `\q_recursion_tail`.

-- 
Regards,
Bruno