stack

package
v0.0.0-...-7fad4fb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2022 License: Apache-2.0 Imports: 1 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Popn

func Popn(stack StackFrame, n int) (values []StackFrame, rest StackFrame)

func String

func String(stack StackFrame) string

Types

type StackEnd

type StackEnd struct{}

func (StackEnd) Height

func (s StackEnd) Height() int

func (StackEnd) Up

func (s StackEnd) Up() StackFrame

func (StackEnd) Value

func (s StackEnd) Value() interface{}

type StackFrame

type StackFrame interface {
	Up() StackFrame
	Height() int
	Value() interface{}
}

func NewFrame

func NewFrame(up StackFrame, value interface{}) StackFrame

func Replace

func Replace(stack StackFrame, num int, value interface{}) (StackFrame, interface{})

func Swap

func Swap(stack StackFrame, num int) StackFrame

func UpBy

func UpBy(stack StackFrame, num int) StackFrame

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL