Module description

nnt -- Generic n-Tree
The nnt module implements a n-Tree that can store variable size nodes. It is the base module for more specialized trees, for example the cel n-tree nct. Due to the structure of a n-tree the words for changing the tree, adding and removing children, are part of the iterator nni.

Tree structure

nnt% ( -- n )
Get the required space for a nnt variable

Tree creation, initialisation and destruction

nnt-init ( nnt -- )
Initialise the n-tree
nnt-(free) ( xt nnt -- )
Free all nodes in the tree with xt
nnt-create ( "<spaces>name" -- ; -- nnt )
Create a named n-tree in the dictionary
nnt-new ( -- nnt )
Create a new n-tree on the heap
nnt-free ( nnt -- )
Free the tree from the heap

Member words

nnt-length@ ( nnt -- u )
Get the number of nodes in the tree
nnt-empty? ( nnt -- flag )
Check for an empty tree
nnt-root@ ( nnt -- nnn | nil )
Get the root of the tree

Tree words

nnt-execute ( i*x xt nnt -- j*x )
Execute xt for every node in tree
nnt-execute? ( i*x xt nnt -- j*x flag )
Execute xt for every node in the tree or until xt returns true, flag is true if xt returned true

Inspection

nnt-dump ( nnt -- )
Dump the tree

Generated by fsdocgen 0.1.0