Ordered key-value container implemented as an AVL tree.
Construct with key and value schemas in front of the module name, for example Int32 Int32 AVLMap.
AVL_MAP: map marker field.keyType: Ref to the key schema.valueType: Ref to the value schema.nodeType: node schema with fields key, value, balance, left, and right.root: root-node address stored as Natx.INIT (--): initializes an empty map.find (key -- result): returns the lookup result for one key.insert (key value --): inserts one new key-value pair.erase (key --): removes the pair at one key.clear (--): removes all pairs and resets the root.ASSIGN (other --): replaces the map contents with a cloned copy of other.DIE (--): destroys the current contents.debugPrint (--): prints one debug view of the tree.makeNode: constructs one node value from key and value inputs.asNode: interprets one node address as nodeType Ref.fixRotateLeft and fixRotateRight: balancing helpers used after insertion and erasure.swapNodes: node-swap helper used during erasure.= and <.insert rejects an existing key.erase rejects a missing key.debugPrint visits the stored pairs in ascending key order.0nx in root and therefore has no nodes.insert allocates one new node and stores copied key and value data in that node.erase destroys and frees exactly one stored node.clear destroys every stored node and resets root to the empty state.ASSIGN deep-clones the whole tree. The new map does not share node storage with the source map.(source body --)Consumes one AVLMap through one body and visits the stored pairs in ascending key order.
source must provide the AVL_MAP marker field.key and value.key is passed by value.value is passed as Ref to the stored value.insert, erase, clear, ASSIGN, or DIE.