Stack

Stack collection (LIFO discipline).

Minimal LIFO (last in first out) implementation, as a class. See [deque](Deque.html) for mixed LIFO/FIFO behavior.

Stack

class Stack<T>()

push

Push an element on the top of the stack.

func push(x : T)

isEmpty

True when the stack is empty.

func isEmpty() : Bool

peek

Return and retain the top element, or return null.

func peek() : ?T

pop

Remove and return the top element, or return null.

func pop() : ?T