Next: stacks inspection, Up: stacks [Index]
Stacks are implemented as doubly–linked lists of vector objects; each vector acts as buffer for contained objects; all the vectors have the same length.
The following syntactic bindings are exported by the library
(vicare containers stacks)
.
Record type representing a stack object. The <stack>
type is
non–generative and available for subtyping. In this documentation
<stack>
object arguments to functions are indicated as
stack.
Build and return a new <stack>
object. The optional argument
buffer-length must be a non–negative fixnum representing the
number of slots in the internal object buffers; when not given, it
defaults to 15.
Return #t
if obj is a record of type <stack>
;
otherwise return #f
.
Build and return a <stack>
object holding the given objects,
which are pushed on the stack right–to–left from the bottom side. The
size of the internal buffers is set to the default.
(define D (stack 0 1 2)) (stack-top D) ⇒ 0
Add a new property key to the property list of stack; key must be a symbol. If key is already set: the old entry is mutated to reference the new value.
Return the value of the property key in the property list of
stack; if key is not set: return #f
. key must
be a symbol.
Remove the property key from the property list of stack; if key is not set: nothing happens. key must be a symbol.
Return a new association list representing the property list of stack. The order of the entries is the same as the property creation order.
Return an exact integer to be used as hashtable key for stack.
Hashtables having a <stack>
as key can be instantiated as
follows:
(make-hashtable stack-hash eq?)
Next: stacks inspection, Up: stacks [Index]