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