(pfds queue)

queue? : any -> boolean tests if an object is a queue queue-length : queue -> non-negative integer returns the number of items in the queue

(make-queue)

make-queue : () -> queue returns a queue containing no items

(enqueue queue item)

enqueue : queue any -> queue returns a new queue with the enqueued item at the end

(dequeue queue)

dequeue : queue -> value queue returns two values, the item at the front of the queue, and a new queue containing the all the other items raises an error if the queue is empty

(queue-empty? queue)

queue-empty? : queue -> boolean returns true if there are no items in the queue, false otherwise

(list->queue list)

list->queue : listof(any) -> queue returns a list containing all the items in the queue. The order of the items in the list is the same as the order in the queue. For any list l, (equal? (queue->list (list->queue l)) l) is #t.

(queue->list queue)

queue->list : queue -> listof(any) returns a queue containing all the items in the list. The order of the elements in the queue is the same as the order of the elements in the list.