Next: iklib lists misc, Previous: iklib lists weak, Up: iklib lists [Index]
Queues are object containers that allow constructing a first-in
first-out sequence. The following bindings are exported by the library
(vicare)
.
Build a queue of items and return 3 values:
#t
if the queue is empty.
The optional init-values must be null or the list of initial values.
Usage examples:
#!r6rs (import (vicare)) (let-values (((empty? enqueue! dequeue!) (make-queue-procs))) (empty?)) ⇒ #t (let-values (((empty? enqueue! dequeue!) (make-queue-procs))) (enqueue! 1) (empty?)) ⇒ #f (let-values (((empty? enqueue! dequeue!) (make-queue-procs))) (enqueue! 1) (empty?) ⇒ #f (dequeue!) ⇒ 1 (empty?)) ⇒ #t (let-values (((empty? enqueue! dequeue!) (make-queue-procs))) (enqueue! 1) (enqueue! 2) (enqueue! 3) (dequeue!) ⇒ 1 (dequeue!) ⇒ 2 (dequeue!) ⇒ 3 (empty?)) ⇒ #t