Scheme 48 Manual | Contents | In Chapter: Libraries
Previous: Cells | Next: Arrays

Queues

These are ordinary first-in, first-out queues. The procedures are in structure queues.

Make-queue creates an empty queue, queue? is a predicate for identifying queues, queue-empty? tells you if a queue is empty, enqueue! and dequeue! add and remove values.

Queue-length returns the number of values in queue. Queue->list returns the values in queue as a list, in the order in which the values were added. List->queue returns a queue containing values, preserving their order. Delete-from-queue removes the first instance of value from queue, using eq? for comparisons. Delete-from-queue returns #t if value is found and #f if it is not.

Previous: Cells | Next: Arrays