Linklist

From OpenEUO
Jump to: navigation, search

Calling Pattern

Call

local k = sl.linklist()

Results

k is a linklist closure

Closure Methods

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.

See Also