queue

.zn module

FIFO Queue and LIFO Stack, thin wrappers over lists. import "queue".

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.

On this page