stack

package
v0.0.0-...-a2101d5 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package stack implements a stack of VType values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stack

type Stack []types.VType

func New

func New() *Stack

New returns a new empty Stack.

func (*Stack) Clear

func (k *Stack) Clear()

Clear removes all elements from the Stack.

func (*Stack) Empty

func (k *Stack) Empty() bool

Empty returns true if the Stack contains no items, false otherwise.

func (*Stack) Peek

func (k *Stack) Peek(n int) []types.VType

Peek returns a list of the top n items on the Stack.

func (*Stack) Pop

func (k *Stack) Pop() types.VType

Pop takes the top element from the Stack and returns it.

func (*Stack) PopString

func (k *Stack) PopString() *vstring.VString

PopString takes the top element from the Stack and returns the string value of it.

func (*Stack) Push

func (k *Stack) Push(s types.VType)

Push adds a new item to the top of the Stack.

func (*Stack) Size

func (k *Stack) Size() int

Size returns the size of the Stack.

func (Stack) String

func (k Stack) String() string

String returns a string representation of the Stack.

func (*Stack) Top

func (k *Stack) Top() types.VType

Top returns the top element of the Stack without removing it.

func (Stack) TruncatedString

func (k Stack) TruncatedString() string

TruncatedString returns a string representation of the Stack showing only the top 7 (or less) values.

Jump to

Keyboard shortcuts

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