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

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

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
01695e…8a9f:5
ErrUnderflow details

Inspect pointer

ErrDivByZero

*errors.errorString

ErrDivByZero is raised on division by zero.

Open
OID
01695e…8a9f: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
01695e…8a9f:10
Push details

Inspect func

Clear

func()

Clear empties the shared stack.

Open
OID
01695e…8a9f:12
Clear details

Inspect func

Depth

func() int

Depth returns the number of values currently on the stack.

Open
OID
01695e…8a9f:13
Depth details

Inspect func

Top

func() (int, bool)

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

Open
OID
01695e…8a9f: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
01695e…8a9f: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