Module description

bni -- Generic binary tree iterator
The bni module implements an iterator on the generic binary tree [bnt].

Iterator Structure

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

Iterator creation, initialisation and destruction

bni-init ( bnt bni -- )
Initialise the iterator with a binary tree
bni-create ( bnt "<spaces>name" -- ; -- bni )
Create a named iterator in the dictionary with a binary tree
bni-new ( bnt -- bni )
Create an iterator on the heap with a binary tree
bni-free ( bni -- )
Free the iterator from the heap

Iterator words

bni-get ( bni -- bnn | nil )
Get the current node from the iterator
bni-key ( bni -- false | x true )
Get the key x from the current node
bni-first ( bni -- bnn | nil )
Move the iterator to the first node, return this node
bni-next ( bni -- bnn | nil )
Move the iterator to the next node, return this node
bni-prev ( bni -- bnn | nil )
Move the iterator to the previous node, return this node
bni-last ( bni -- bnn | nil )
Move the iterator to the last node, return this node
bni-first? ( bni -- flag )
Check if the iterator is on the first node
bni-last? ( bni -- flag )
Check if the iterator is on the last node

Inspection

bni-dump ( bni -- )
Dump the iterator variable

Generated by fsdocgen 0.1.0