Heap (gb.data)
This class implements a dynamic heap data structure. It can be a MinHeap or a MaxHeap, depending on what mode you specify on construction.
Being "dynamic" means that this class allows you to update the data or the position of elements which are already in the heap.
Objects in the Heap are all Variants. The ordering in the heap is implicitly defined via comparison of these values. You can put
primitive values in there (Boolean, Integer, String, etc.) and also objects. The special _compare() method is used to compare
objects.
Note that you cannot compare objects to primitives or to objects of different classes in Gambas (at the time of this writing). If you don't
keep your heap homogeneous in the just defined sense, it will throw an error while trying to order itself.
See also
Wikipedia on heaps