On 11/28/2012 08:50 PM, Paul Isambert wrote:
Herbert Voss <[email protected]> a écrit:
Am 28.11.2012 19:44, schrieb Paul Isambert:
    head = node.insert_after(a, b, c)

to insert c after b in the list whose head is a (actually any node in
that list).

  From what is written in the manual I thought that

head=node.insert_after(nil,head,n)

should also work, but it didn't.

It should, if "head" is non-nil. So I'm surprised, again, that it
doesn't.

The manual says:

  [ head, new = node.insert_after(head, current, new) ]
  ...
  The return values are the 'head' and the node 'new'
  ...
  If 'head' is initially 'nil'. it will become 'new'.

which indicates to me that it does not work, as otherwise 'head'
would become be more likely to become 'current'. I don't mind
changing that, though. (it looks like both manual entry and
code were copied from insert_before originally).

Best wishes,
Taco

Reply via email to