dnl - Double Linked Node List

Module Description

The dnl module implements a double linked list that can handle variable size nodes. It is the base module for more specialised modules, for example the dcl [double linked cell list] module.

Module Words

List structure

dnl% ( - n )
Get the required space for the dnl data structure

List creation, initialisation and destruction

dnl-init ( w:dnl - )
Initialise the dnl-list

dnl-create ( C: "name" - R: - w:dnl )
Create a named dnl-list in the dictionary

dnl-new ( - w:dnl )
Create a new dnl-list on the heap

dnl-free ( w:dnl - )
Free the list from the heap

Member words

dnl-length@ ( w:dnl - u )
Get the number of nodes in the list

dnl-empty? ( w:dnl - f )
Check for empty list

dnl-first@ ( w:dnl - w:dnn | nil )
Get the first node

dnl-last@ ( w:dnl - w:dnn | nil )
Get the last node

List words

dnl-append ( w:dnn w:dnl - )
Append a node in the list

dnl-prepend ( w:dnn w:dnl - )
Prepend a node in the list

dnl-insert-before ( w:new w:ref w:dnl - )
Insert a new node before the reference node in the list

dnl-insert-after ( w:new w:ref w:dnl - )
Insert a new node after the reference node in the list

dnl-remove ( w:dnn w:dnl - )
Remove a node from the list

Index words

dnl-index? ( n:index w:dnl - f )
Check if an index is valid in the list

dnl-get ( n:index w:dnl - w:dnn )
Get the indexth node from the list

dnl-insert ( w:dnn n:index w:dnl - )
Insert a node before the indexth node in the list

dnl-delete ( n:index w:dnl - w:dnn )
Delete the indexth node from the list

LIFO words

dnl-push ( w:dnn w:dnl - )
Push the node at the end of the list

dnl-pop ( w:dnl - w:dnn | nil )
Pop the node at the end of the list

dnl-tos ( w:dnl - w:dnn | nil )
Get the node at the end of the list

FIFO words

dnl-enqueue ( w:dnn w:dnl - )
Enqueue the node at the start of the list

dnl-dequeue ( w:dnl - w:dnn | nil )
Dequeue the node at the end of the list

Special words

dnl-execute ( ... xt w:dnl - ... )
Execute xt for every node in list

dnl-reverse ( w:dnl - )
Reverse or mirror the list

Inspection

dnl-dump ( w:dnl - )
Dump the list


generated 09-Jan-2007 by ofcfrth-0.2.0