This module implements a First–In First–Out functional queue:
(let* ((Q (make-queue)) (Q (enqueue Q 1)) (Q (enqueue Q 2)) (Q (enqueue Q 3))) (receive (A Q) (dequeue Q) (receive (B Q) (dequeue Q) (receive (C Q) (dequeue Q) (values A B C))))) ⇒ 1 2 3
by applying repeatedly dequeue
to the same <queue>
object, we extract the same item
from the queue:
(let* ((Q (make-queue)) (Q (enqueue Q 1)) (Q (enqueue Q 2)) (Q (enqueue Q 3))) (receive (A Q1) (dequeue Q) (receive (B Q1) (dequeue Q) (receive (C Q1) (dequeue Q) (values A B C))))) ⇒ 1 1 1
Return a queue containing no items.
Return #t
if OBJ is a queue, #f
otherwise.
Return a non–negative integer representing the number of items in queue.
Return #t
if there are no items in queue, #f
otherwise.
Return a new queue with the enqueued item at the end.
Return 2 values: the item at the front of queue, and a new queue containing the all the other
items. Raise a condition with kind pfds-queue-empty-condition
condition if queue is
empty.
Return #t
if OBJ is a condition object with kind pfds-queue-empty-condition
;
otherwise return #f
.
Return a list containing all the items in queue. The order of the item in the list is the same as the order of the elements in the queue.
Return a queue containing all the items in the given list. The order of the items in the queue is the same as the order in the list.
This document describes version 0.5.0-devel.1 of MMCK PFDS.