Linklist
From OpenEUO
Calling Pattern
Call
local k = sl.linklist()
Results
k is a linklist closure
Closure Methods
- linklist.getposition
- linklist.head
- linklist.insertafter
- linklist.insertbefore
- linklist.length
- linklist.nextlink
- linklist.prevlink
- linklist.removelink
- linklist.returntable
- linklist.setvalue
- linklist.swap
- linklist.tail
- linklist.value
Example Usage
local k = sl.linklist() local j = k.insertb(0,'one') j = k.insertb(j,'two') j = k.insertb(j,'three') print(k.value(k.next(j))) print(k.value(k.head()))
--> two three
Description
Calling linklist returns a closure to a doubly linked list. Linklist takes the object abstraction down the the list level only-- individual links are opaque and have no methods. Most operations on the linked list make use of or return pseudo-indices, which are actually indices into the underlying storage table. Like all simplelib interfaces beginning with version 0.06, method names may be partially specified. See the closure method pages for details.