411 REFERENCE · Wikibooks
Maxima/Algorithms
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
Stack ( LIFO)
thumb|right|Vectors made with Maxima CAS
Stack implementation using list:
/* create stack */
stack:[1];
/* push on stack */
stack:endcons(2,stack);
stack:endcons(3,stack);
block
(
loop,
stack:delete(last(stack),stack), /* pop from stack */
disp(stack), /* display */
if is(not emptyp(stack)) then go(loop)
);
stack;