| Stack {Containers} | R Documentation |
This method instanciates class Stack.
aStack = Stack()
John Hughes
aStack = Stack() # Instanciate a stack.
aStack$push(3) # Push a few integers onto the stack.
aStack$push(2)
aStack$push(1)
aStack$top() # Inspect the top element.
while (! aStack$isEmpty()) # Print the elements, emptying the stack in the process.
print(aStack$pop())