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