@include <Stack>

The Stack class provides a simple stack implementation in Bash++.

Methods

@Stack.size

Scope: public

Echoes the number of elements in the stack.

Usage: @Stack.size

@Stack.push

Scope: public

Pushes a value onto the top of the stack.

Usage: @Stack.push $value

Parameters

  • value
    • Type: primitive
    • The value to push onto the top of the stack.

@Stack.pop

Scope: public

Pops the top element off the stack and echoes it.

Usage: @Stack.pop

@Stack.top

Scope: public

Echoes the top element of the stack.

Usage: @Stack.top

@Stack.clear

Scope: public

Removes all elements from the stack.

Usage: @Stack.clear

@Stack.empty

Scope: public

Echoes “true” if the stack is empty, “false” otherwise.

Usage: @Stack.empty