Since the stack object is a subclass of collection, many of the methods provided by collection are also available to stack. One major difference between collection and stack, however, is that the stack will only forward messages to the top n objects in the stack, as defined by the forward=n message (n=1 by default).
pop! Delete the top element from the stack.
pop? Get the value on the top of the stack, then delete it from the stack.
?, value? Obtain the top element of the stack.
forward= value Set the number of entries on the top of the stack to forward unknown messages to.
forward? Get the number of entries forwarded to.
pop! print:members print:number_members ;
actor new: [astack pop?]; astack print:members print:number_members ;
actor new: astack; /* stack responds to ? or value? */ astack print:members print:number_members ;
astack members+(d,e,f) /* Note that members+ and push: are aliased */ print:members print:number_members ;
actor print:instances;