STACKLENGTH can be used to find out how many things are on the stack. When invoked it counts the number of items on the stack and then leaves that number on the stack, for example:
2 + 3, 9 - 5, stacklength() => ** 5 4 2Notice that in Pop-11 a procedure which takes no arguments is invoked by writing its name followed by two parentheses.
DUP
This procedure merely duplicates the top element of the stack.
1,2,3,4, dup() => ** 1 2 3 4 4SETSTACKLENGTH
setstacklength(N)
Increases or decreases the stack length to N, if necessary by removing items or adding occurrences of [], the empty list (because the procedure is used by the Poplog Lisp compiler). Examples:
1,2,3,4, setstacklength(2), setstacklength(6) => ** 1 2 [] [] [] []