Next: , Previous: , Up: iqueues   [Index]


47.2 Common queues API for queues

The library (vicare containers queues) provides an implementation of the queue container using the <queue> type, Simple queues. The library (vicare containers iqueues queues) provides a concrete implementation of the <iqueue> type using an instance of <queue> as storage. Usage example:

(import (vicare)
  (vicare containers queues)
  (vicare containers iqueues)
  (vicare containers iqueues queues))

(define S
  (make-iqueue-queue (queue)))

(iqueue-push! S 0)
(iqueue-push! S 1)
(iqueue-push! S 2)

(iqueue-top  S)         ⇒ 2
(iqueue-pop! S)         ⇒ 2
(iqueue-pop! S)         ⇒ 1

The following syntactic bindings are exported by the library (vicare containers iqueues queues).

Record Type: <iqueue-queue>

Record type implementing an <iqueue>, of which it is a subtype.

Function: make-iqueue-queue queue

Build and return a new instance of <iqueue-queue>. The argument queue must be an instance of type <queue>.

Function: iqueue-queue? obj

Return #t if obj is an instance of <iqueue-queue>; otherwise return #f.