On this page:
make-stack&queue
stack&queue?
stack&queue-empty?
push!
add-to-end!
pop!

2.13 stack-queue🔗

This module provides a simple stack-queue. It is used internally by the ambigous operator. As a data structure, it is not recomended.

Creates a new empty stack&queue.

procedure

(stack&queue? obj)  boolean?

  obj : any/c
Check if on object is a stack&queue?.

procedure

(stack&queue-empty? sq)  boolean?

  sq : stack&queue?
Check if sq is an empty stack&queue?.

procedure

(push! sq val)  void

  sq : stack&queue?
  val : any/c

procedure

(add-to-end! sq val)  void

  sq : stack&queue?
  val : any/c
Adds val to the front or end of the stack&queue?.

procedure

(pop! sq)  any/c

  sq : stack&queue?
Get the first element of the stack&queue?, leaving the stack&queue? that element shorter.