Linklist.value

From OpenEUO
Revision as of 15:27, 18 December 2010 by Ximan (Talk | contribs) (Created page with "== Calling Pattern == Call local k = sl.linklist() -- later local r = k.value(a) Arguments a is a number Results r is of any type == Example Usage == local k = sl.linkl...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Calling Pattern

Call

local k = sl.linklist()
-- later
local r = k.value(a)

Arguments

a is a number

Results

r is of any type

Example Usage

local k = sl.linklist()
local j = k.inserta(0,'one')
local j0 = j
j = k.inserta(j,'two')
j = k.inserta(j,'three')
print(k.value(k.prev(j)))
--> 'two' 

Description

Calling value returns the value associated with pseudo-index a. If the list is empty or a is otherwise an invalid pseudo-index, value returns nil. For this reason, null should be used to store nil values in a linked list.

See Also