[luatex] Behavior of node lists.

Paul Isambert zappathustra at free.fr
Thu Nov 8 09:38:07 CET 2012

Selon Taco Hoekwater <taco at elvenkind.com>:

> On 11/07/2012 07:37 PM, Stephan Hennig wrote:
> > Am 06.07.2011 15:43, schrieb Taco Hoekwater:
> >> On 07/04/11 09:06, Paul Isambert wrote:
> >>>
> >>> The manual says you're in charge of ensuring that in
> >>> "node.insert_after(H, N, x)", N is in the list denoted by H. The thing
> >>> is, H doesn't seem to matter at all, unless it's nil:
> >>
> >> Actually H is also useful if N is nil (that is a tail-append the list
> >> that starts at H), but it is true that H is generally unused.
> >
> > If N is known to be non-nil, e.g., a glyph node, is it save to call
> >
> >    node.insert_after(nil, N, x)  ?
> >
> > If the answer is 'Yes',
> Well, yes. However I do not like the idea of reordering the
> arguments, because we have quite a lot of functions with 'head'
> argument, and they always come first.

I definitely agree (don't want to rewrite umpteen files). Plus the optionality
of the head makes less sense than the optionality of the current node, even if
it were more frequent; it'd mean you have to check beforehand whether the
current node exists or not before you use the function. If the head is a
mandatory argument, you just don't ask question. (Anyway when an argument can be
nil, you always pass it to the function, no matter whether it's labelled
optional or not.)


More information about the luatex mailing list