Name

Stack, Queue -- restricted forms of lists

(.. Neither of these types is currently implemented. They are nothing more than restricted cases of a List, so if you need them use a List instead.)


Synopsis

// Stack -- form of list with add/remove both at start of list
//
@deftype Stack <List>
- (void)	push: anObject;
-		pop;
@end

//
// Queue -- form of list with add at start of list and remove at last
//
@deftype Queue <List>
- (void)	enqueue: anObject;
-		dequeue;
@end

Description

A Stack is a subtype of List which restricts the addition and removal of members to the start of a list. Queue is a subtype of List which restricts addition of members to the start of the list and removal to the end. Both types define specially named messages to reflect the specialized usage of their resulting add and remove operations.


Interface Reference

Inherited behavior

@deftype Stack <List>
@deftype Queue <List>
...

Stack behavior

- (void)	push: anObject;
-		pop;
...

Queue behavior

- (void)	enqueue: anObject;
-		dequeue;
...


Roger Burkhart <rmb@santafe.edu>
Last modified: