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


48.2 Deques as deques

The library (vicare containers deques) provides an implementation of the deque container using the <deque> type, Double–ended queues of objects. The library (vicare containers ideques deques) provides a concrete implementation of the <ideque> type using an instance of <deque> as storage. Usage example:

(import (vicare)
  (vicare containers deques)
  (vicare containers ideques)
  (vicare containers ideques deques))

(define S
  (make-ideque-deque (deque)))

(ideque-push-front! S 0)
(ideque-push-rear!  S 1)

(ideque-front S)        ⇒ 0
(ideque-rear  S)        ⇒ 1
(ideque-pop-front! S)   ⇒ 0
(ideque-pop-rear!  S)   ⇒ 1

The following syntactic bindings are exported by the library (vicare containers ideques deques).

Record Type: <ideque-deque>

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

Function: make-ideque-deque deque

Build and return a new instance of <ideque-deque>. The argument deque must be an instance of type <deque> as defined by the library (vicare containers deques).

Function: ideque-deque? obj

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