LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

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

Print Reply
Bruno Le Floch <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Wed, 19 Feb 2020 12:04:49 +0100
text/plain (44 lines)
On 2/19/20 9:15 AM, Joseph Wright wrote:
> On 19/02/2020 00:50, Phelype Oleinik wrote:
>> Hi Kelly,
>>> - Are all boxes and coffins made so that their content is wrapped in
>>> a TeX group?
>>>    More specifically, is it safe for code to assume that all
>>> box/coffin content is
>>>    implicity grouped?
>> Yes, because the underlying TeX box makes a group:
>>      \count0=1 \hbox{\count0=2 }\the\count0 \bye
>> so you can assume the grouping.
> All boxes are also explicitly documented as colour-safe, so have an
> additional group level.
>>> - Many functions in expl3 are of the form `a := func(b, c)` (e.g.
>>> `\str_concat:NNN`,
>>>    `\seq_set_map:NNn`) or `a := func(b)` (e.g. `\int_set:Nn`,
>>> `\tl_set:Nn`).
>>>    Sometimes, one will want to write code like `a := func(a, b)` or
>>> `a := func(a)`,
>>>    that is, directly assign a new value to a variable based on its
>>> current value.
>>>    Is it ever safe to write such code in expl3?
>> Yes, because first `func(a, b)` is evaluated, and only then
>> the assignment is performed. Something like:
>>      \def\x{b} \edef\x{a\x c}
>> makes `\x=macro:->abc`.
>> Though this last one may depend a bit on the macro
>> implementation (if the function needs intermediate steps
>> to do its job, for example), but I'd expect to able to rely
>> on that behaviour.
> This is safe for all expl3 functions.
> Joseph

We should definitely document both things.