queue
.zn moduleFIFO Queue and LIFO Stack, thin wrappers over lists. import "queue".
queue.new() => Queuequeue.push(q, item: any)queue.pop(q) => (any, bool)queue.peek(q) => (any, bool)queue.size(q) => int / queue.is_empty(q) => boolqueue.stack_new() => Stackqueue.stack_push(s, item: any)queue.stack_pop(s) => (any, bool)queue.stack_peek(s) => (any, bool)queue.stack_size(s) => int / queue.stack_is_empty(s) => bool
queue.new() => Queue
Empty queue.
queue.push(q, item: any)
Enqueue.
queue.pop(q) => (any, bool)
Dequeue the front; bool false if empty.
queue.peek(q) => (any, bool)
Front without removing.
queue.size(q) => int / queue.is_empty(q) => bool
Length / emptiness.
queue.stack_new() => Stack
Empty stack.
queue.stack_push(s, item: any)
Push.
queue.stack_pop(s) => (any, bool)
Pop the top; bool false if empty.
queue.stack_peek(s) => (any, bool)
Top without removing.
queue.stack_size(s) => int / queue.stack_is_empty(s) => bool
Length / emptiness.