Linklist
From OpenEUO
Revision as of 13:24, 18 December 2010 by Ximan (Talk | contribs) (Created page with "== Calling Pattern == Call local k = sl.linklist() Results k is a linklist closure == Closure Methods == * linklist.getposition * linklist.head * [[linklist.insertaf...")
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. Most operations on the linked list made 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.