[Dev-luatex] order of node linking matters

Hans Hagen pragma at wxs.nl
Wed Dec 23 18:38:00 CET 2009

On 23-12-2009 18:29, Paweł Jackowski wrote:
> Taco Hoekwater wrote:
>> Paweł Jackowski wrote:
>>> someglyph.next = someother
>>> discretionary.pre = someglyph
>>> is not the same. Why?
> Hans:
>> indeed strange ... a quick hack is to use node.copy on b
> Copying the node works in that case, thanks.
> Taco:
>> Because a discretionary's pre, post, and replace lists are a bit
>> special: internally the discretionary does not just have a next and
>> a prev link for each of the head nodes, but also a 'tail' link.
>> That last one points to the last node in the list for each of
>> the three fields. That extra link is used during hyphenation and
>> at end-of-line situations (those parts of the code would be much
>> more complex == slower without it).
> Agh, having the disc.tail link(s) at lua level would simplify processing
> discretionaries a lot! Why you decided not to interface tails?

we had node.slide (for making two way linked node lists) and now also 
have node.tail so you can find the tail if needed

tail = node.tail(n.pre)

> I also noticed that assigning disc sublists introduces nested_list nodes:
> someglyph.prev = nil
> disc.pre = someglyph
> assert(someglyph.prev.id==node.id"nested_list")
> Is this related here? Is the user supposed to take care about
> nested_list nodes (to create them, to destroy them)?

normally not ; similar effects can occur when messing around with boxes 
(.list) ... it is often best to work with a copy and assign the result 
of messing with the copy ... the speed penalty is neglectable


                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl

More information about the dev-luatex mailing list