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