28.6.6 Using list variables in expressions

You might want to generate lists, such as lists by level of elements above the current element (its “ancestors”); see §28.4 Using multiple-value list variables.

In an expression, the following construct:

($$_paratag in $$mylist)

returns the value of the index for the current paragraph format in <$$mylist>, or 0 (zero) if missing; and:

($$mylist[$$level] is $$_paratag)

You can set the list item with a normal assignment:

<$$mylist[$$level] = $$_paratag>