Qu

is_empty

Builtin index · Core maths

result = is_empty(q)

Input: q · Output: result

What it is

Whether the fixed-capacity ring buffer q (a Fifo handle created by fifo(capacity)) currently holds nothing, or has no room left for another push without evicting the oldest element. q must be a Fifo.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
result = is_empty(q)
q Fifonot documented yet
result —
Returns a Bool.

Examples

From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.

print("mm(10)={mm(10)}  cm(1)={cm(1)}  inch(1)={inch(1)}")   # e.g. figure_size(mm(180), mm(120))


f = fifo(2)
print("is_empty={is_empty(f)}")
push(f, 1)
push(f, 2)
print("is_full={is_full(f)}")   # at capacity -- the next push would evict the oldest

output
mm(10)=100  cm(1)=100  inch(1)=254
is_empty=true
is_full=true

from core-math

How it works

fifo(capacity) (§ data structures pass, 2026-09-01, Value::Fifo is a guarded arm further up this match (see its own comment there, next to queue()'s own unconditional "push"); every other fifo name has no competing meaning anywhere else, so this arm is unconditional.

From the note above this builtin in the interpreter, where the reasoning was written down as it was built.

See also

is_full — documented in the same entry.