StackEdit on GitHub
An immutable stack implementation. A stack is a LIFO (last-in-first-out) data structure where new values are added, retrieved, and removed from the end.
Creates a new stack.
Checks if the given stack contains no items.
item is the value at the top of the stack, and
Adds a new item to the top of the stack.
Removes the item at the top of the stack.