sni - Generic Single Linked List Iterator
Module Description
The sni module implements an iterator on the generic single linked list [snl].
Module Words
Iterator structure
sni%
( -- n )
Get the required space for a sni variable
Iterator creation, initialisation and destruction
sni-init
( snl sni -- )
Initialise the iterator with a snl list
sni-create
( snl "<spaces>name" -- ; -- sni )
Create a named iterator in the dictionary on the snl list
sni-new
( w:snl -- sni )
Create an iterator on the snl list on the heap
sni-free
( sni -- )
Free the iterator from the heap
Member words
sni-get
( sni -- snn | nil )
Get the current node
Iterator words
sni-first
( sni -- snn | nil )
Move the iterator to the first node, return this node
sni-next
( sni -- snn | nil )
Move the iterator to the next node, return this node
sni-first?
( sni -- flag )
Check if the iterator is on the first node
sni-last?
( sni -- flag )
Check if the iterator is on the last node
Inspection
sni-dump
( sni -- )
Dump the iterator
generated 10-Apr-2008 by
ofcfrth-0.5.0