Next: ideques deques, Up: ideques [Index]
The following syntactic bindings are exported by the library
(vicare containers ideques)
.
Record type representing a deque object. The <ideque>
type is
non–generative and available for subtyping. In this documentation
<ideque>
instances used as arguments to functions are indicated as
ideque.
<ideque>
is an “abstract” type: it must not be instantiated
directly, rather a subtype of <ideque>
must be defined
implementing the required functions.
When we derive a type from <ideque>
and we specify a protocol:
this is the closure object used as argument for the protocol function.
(define-record-type <ideque-chain> (parent <ideque>) (protocol (lambda (make-ideque) ---)) ---)
Its arguments must be functions implementing the methods for the concrete deque:
A function accepting as single argument the <ideque>
instance
itself. It must return #t
if the deque is empty; otherwise it must
return #f
.
A function accepting as single argument the <ideque>
instance
itself. It must return the first object, at the front of the
<ideque>
.
A function accepting as single argument the <ideque>
instance
itself. It must return the last object, at the rear of the
<ideque>
.
A function accepting two arguments: the <ideque>
instance itself
and an object. It must push the object on the front of the
<ideque>
; it can return unspecified values.
A function accepting two arguments: the <ideque>
instance itself
and an object. It must push the object on the rear of the
<ideque>
; it can return unspecified values.
A function accepting as single argument the <ideque>
instance
itself. It must remove and return the first object, from the front of
the <ideque>
.
A function accepting as single argument the <ideque>
instance
itself. It must remove and return the last object, from the rear of the
<ideque>
.
Return #t
if obj is an instance of <ideque>
; otherwise
return #f
.
Return #t
if ideque is empty; otherwise return #f
.
Return the first object, on the front of ideque.
Return the last object, on the rear of ideque.
Push obj on the front of ideque. Return unspecified values.
Push obj on the rear of ideque. Return unspecified values.
Remove and return the first object, from the front of ideque.
Remove and return the last object, from the rear of ideque.
Next: ideques deques, Up: ideques [Index]