Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

v0 state

Back to all declarations

stack

[]int

stack holds the shared RPN operand stack, bottom (index 0) to top.

Value

<zero>

ErrUnderflow

*errors.errorString

ErrUnderflow is raised when an operator needs more operands than available.

Open
OID
089375…61dc:5
ErrUnderflow details

Inspect pointer

ErrDivByZero

*errors.errorString

ErrDivByZero is raised on division by zero.

Open
OID
089375…61dc:8
ErrDivByZero details

Inspect pointer

Push

func(token string)

Push consumes a single token: an integer is pushed onto the stack; an operator (+, -, \*, /) pops two operands and pushes the result.

Open
OID
089375…61dc:10
Push details

Inspect func

Clear

func()

Clear empties the shared stack.

Open
OID
089375…61dc:12
Clear details

Inspect func

Depth

func() int

Depth returns the number of values currently on the stack.

Open
OID
089375…61dc:13
Depth details

Inspect func

Top

func() (int, bool)

Top returns the top value and whether the stack is non-empty.

Open
OID
089375…61dc:14
Top details

Inspect func

Render

func(path string) string

Render renders the current stack, the top value as the result, and a short usage guide.

Open
OID
089375…61dc:15
Render details

Inspect func
stack : []int =<zero>
ErrUnderflow : *errors.errorString Inspect
ErrDivByZero : *errors.errorString Inspect
Push : func(token string) Inspect
Clear : func() Inspect
Depth : func() int Inspect
Top : func() (int, bool) Inspect
Render : func(path string) string Inspect