value

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	False = Boolean(false)
	True  = Boolean(true)
)
View Source
const (
	// Nil is the constant value nil.
	Nil = nilValue(0)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Boolean

type Boolean bool

func (Boolean) String

func (b Boolean) String() string

func (Boolean) Type

func (Boolean) Type() Type

type Function

type Function struct {
	Name     string
	Callable LuaFn
}

func NewFunction

func NewFunction(name string, callable LuaFn) *Function

func (Function) String

func (f Function) String() string

func (Function) Type

func (Function) Type() Type

type LuaFn

type LuaFn func(...Value) ([]Value, error)

type Number

type Number float64

func NewNumber

func NewNumber(value float64) Number

func (Number) Integral

func (n Number) Integral() (int64, bool)

func (Number) String

func (n Number) String() string

func (Number) Type

func (Number) Type() Type

func (Number) Value

func (n Number) Value() float64

type String

type String string

func NewString

func NewString(value string) String

func (String) String

func (s String) String() string

func (String) Type

func (String) Type() Type

type Table

type Table struct {
	Metatable *Table

	Fields map[Value]Value
}

func NewTable

func NewTable() *Table

func (*Table) Get

func (t *Table) Get(key Value) (Value, bool)

func (*Table) Length

func (t *Table) Length() Value

func (*Table) Set

func (t *Table) Set(key Value, value Value)

func (Table) Type

func (Table) Type() Type

type Type

type Type uint8
const (
	TypeInvalid Type = iota
	TypeNil
	TypeBoolean
	TypeNumber
	TypeString
	TypeFunction
	TypeUserdata
	TypeThread
	TypeTable
)

func (Type) String

func (i Type) String() string

type Value

type Value interface {
	Type() Type
}

Jump to

Keyboard shortcuts

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