REDUCE

14.1 Simulating a Stack

The following macros are in the USEFUL package. They are convenient for adding and deleting things from the head of a list.

(push ITM:any STK:list): any macro
(push item stack) is equivalent to
(setf stack (cons item stack))

(pop STK:list): any macro
(pop stack) does (setf stack (cdr stack)) and returns the item popped off stack. An additional argument may be supplied to Pop, in which case it is a variable which is SetQ’d to the popped value.