vida

package module
v0.0.0-...-585303a Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2025 License: Apache-2.0 Imports: 25 Imported by: 0

README

Vida

The official repo of the Vida programming language.

Vida is a simple and elegant computer language.

It features a minimal set of constructs that makes it easy to learn and suitable for most common programming tasks.

Vida can be seamlessly extended and embedded in host environments or used as standalone language.

Documentation

Index

Constants

View Source
const (
	DefaultInputPrompt = "Input > "
)
View Source
const VidaFileExtension = ".vida"

Variables

View Source
var NilValue = Nil{}

Functions

func About

func About() string

func FormatValue

func FormatValue(format string, a ...Value) (string, error)

Format is like fmt.Sprintf but using Values.

func Name

func Name() string

func PrintAST

func PrintAST(path string) error

func PrintBytecode

func PrintBytecode(script *Script, name string) string

func PrintCoreLibInformation

func PrintCoreLibInformation()

func PrintMachineCode

func PrintMachineCode(path string) error

func PrintTokens

func PrintTokens(path string) error

func Version

func Version() string

Types

type Array

type Array struct {
	ReferenceSemanticsImpl
	Value []Value
}

func (*Array) Binop

func (xs *Array) Binop(op uint64, rhs Value) (Value, error)

func (*Array) Boolean

func (xs *Array) Boolean() Bool

func (*Array) Clone

func (xs *Array) Clone() Value

func (*Array) Equals

func (xs *Array) Equals(other Value) Bool

func (*Array) IGet

func (xs *Array) IGet(index Value) (Value, error)

func (*Array) ISet

func (xs *Array) ISet(index, val Value) error

func (*Array) IsCallable

func (xs *Array) IsCallable() Bool

func (*Array) IsIterable

func (xs *Array) IsIterable() Bool

func (*Array) Iterator

func (xs *Array) Iterator() Value

func (*Array) MarshalJSON

func (xs *Array) MarshalJSON() ([]byte, error)

func (*Array) ObjectKey

func (xs *Array) ObjectKey() string

func (*Array) Prefix

func (xs *Array) Prefix(op uint64) (Value, error)

func (Array) String

func (xs Array) String() string

func (*Array) Type

func (xs *Array) Type() string

type ArrayIterator

type ArrayIterator struct {
	ReferenceSemanticsImpl
	Array []Value
	Init  int
	End   int
}

func (*ArrayIterator) Binop

func (it *ArrayIterator) Binop(uint64, Value) (Value, error)

func (*ArrayIterator) Boolean

func (it *ArrayIterator) Boolean() Bool

func (*ArrayIterator) Clone

func (it *ArrayIterator) Clone() Value

func (*ArrayIterator) Equals

func (it *ArrayIterator) Equals(Value) Bool

func (*ArrayIterator) IGet

func (it *ArrayIterator) IGet(Value) (Value, error)

func (*ArrayIterator) ISet

func (it *ArrayIterator) ISet(Value, Value) error

func (*ArrayIterator) IsCallable

func (it *ArrayIterator) IsCallable() Bool

func (*ArrayIterator) IsIterable

func (it *ArrayIterator) IsIterable() Bool

func (*ArrayIterator) Iterator

func (it *ArrayIterator) Iterator() Value

func (*ArrayIterator) Key

func (it *ArrayIterator) Key() Value

func (*ArrayIterator) Next

func (it *ArrayIterator) Next() bool

func (*ArrayIterator) Prefix

func (it *ArrayIterator) Prefix(uint64) (Value, error)

func (ArrayIterator) String

func (it ArrayIterator) String() string

func (*ArrayIterator) Type

func (it *ArrayIterator) Type() string

func (*ArrayIterator) Value

func (it *ArrayIterator) Value() Value

type Bool

type Bool bool

func (Bool) Binop

func (b Bool) Binop(op uint64, rhs Value) (Value, error)

func (Bool) Boolean

func (b Bool) Boolean() Bool

func (Bool) Call

func (b Bool) Call(args ...Value) (Value, error)

func (Bool) Clone

func (b Bool) Clone() Value

func (Bool) Equals

func (b Bool) Equals(other Value) Bool

func (Bool) IGet

func (b Bool) IGet(index Value) (Value, error)

func (Bool) ISet

func (b Bool) ISet(index, val Value) error

func (Bool) IsCallable

func (b Bool) IsCallable() Bool

func (Bool) IsIterable

func (b Bool) IsIterable() Bool

func (Bool) Iterator

func (b Bool) Iterator() Value

func (Bool) ObjectKey

func (b Bool) ObjectKey() string

func (Bool) Prefix

func (b Bool) Prefix(op uint64) (Value, error)

func (Bool) String

func (b Bool) String() string

func (Bool) Type

func (b Bool) Type() string

type Bytes

type Bytes struct {
	ReferenceSemanticsImpl
	Value []byte
}

func (*Bytes) Binop

func (b *Bytes) Binop(op uint64, rhs Value) (Value, error)

func (*Bytes) Boolean

func (b *Bytes) Boolean() Bool

func (*Bytes) Clone

func (b *Bytes) Clone() Value

func (*Bytes) Equals

func (b *Bytes) Equals(other Value) Bool

func (*Bytes) IGet

func (b *Bytes) IGet(index Value) (Value, error)

func (*Bytes) ISet

func (b *Bytes) ISet(index, val Value) error

func (*Bytes) IsCallable

func (b *Bytes) IsCallable() Bool

func (*Bytes) IsIterable

func (b *Bytes) IsIterable() Bool

func (*Bytes) Iterator

func (b *Bytes) Iterator() Value

func (*Bytes) ObjectKey

func (b *Bytes) ObjectKey() string

func (*Bytes) Prefix

func (b *Bytes) Prefix(op uint64) (Value, error)

func (Bytes) String

func (b Bytes) String() string

func (*Bytes) Type

func (b *Bytes) Type() string

type BytesIterator

type BytesIterator struct {
	ReferenceSemanticsImpl
	Bytes []byte
	Init  int
	End   int
}

func (*BytesIterator) Binop

func (bi *BytesIterator) Binop(uint64, Value) (Value, error)

func (*BytesIterator) Boolean

func (bi *BytesIterator) Boolean() Bool

func (*BytesIterator) Clone

func (bi *BytesIterator) Clone() Value

func (*BytesIterator) Equals

func (bi *BytesIterator) Equals(Value) Bool

func (*BytesIterator) IGet

func (bi *BytesIterator) IGet(Value) (Value, error)

func (*BytesIterator) ISet

func (bi *BytesIterator) ISet(Value, Value) error

func (*BytesIterator) IsCallable

func (bi *BytesIterator) IsCallable() Bool

func (*BytesIterator) IsIterable

func (bi *BytesIterator) IsIterable() Bool

func (*BytesIterator) Iterator

func (bi *BytesIterator) Iterator() Value

func (*BytesIterator) Key

func (bi *BytesIterator) Key() Value

func (*BytesIterator) Next

func (bi *BytesIterator) Next() bool

func (*BytesIterator) Prefix

func (bi *BytesIterator) Prefix(uint64) (Value, error)

func (BytesIterator) String

func (bi BytesIterator) String() string

func (*BytesIterator) Type

func (bi *BytesIterator) Type() string

func (*BytesIterator) Value

func (bi *BytesIterator) Value() Value

type CoreFunction

type CoreFunction struct {
	ReferenceSemanticsImpl
	Code       []uint64
	Info       []freeInfo
	Free       int
	Arity      int
	IsVar      bool
	ScriptName string
}

func (*CoreFunction) Binop

func (c *CoreFunction) Binop(uint64, Value) (Value, error)

func (*CoreFunction) Boolean

func (c *CoreFunction) Boolean() Bool

func (*CoreFunction) Clone

func (f *CoreFunction) Clone() Value

func (*CoreFunction) Equals

func (c *CoreFunction) Equals(other Value) Bool

func (*CoreFunction) IGet

func (c *CoreFunction) IGet(Value) (Value, error)

func (*CoreFunction) ISet

func (c *CoreFunction) ISet(Value, Value) error

func (*CoreFunction) IsCallable

func (c *CoreFunction) IsCallable() Bool

func (*CoreFunction) IsIterable

func (c *CoreFunction) IsIterable() Bool

func (*CoreFunction) Iterator

func (c *CoreFunction) Iterator() Value

func (*CoreFunction) Prefix

func (c *CoreFunction) Prefix(uint64) (Value, error)

func (CoreFunction) String

func (f CoreFunction) String() string

func (*CoreFunction) Type

func (c *CoreFunction) Type() string

type Enum

type Enum struct {
	Pairs map[string]Integer
}

func (*Enum) Binop

func (e *Enum) Binop(op uint64, rhs Value) (Value, error)

func (*Enum) Boolean

func (e *Enum) Boolean() Bool

func (*Enum) Call

func (e *Enum) Call(args ...Value) (Value, error)

func (*Enum) Clone

func (e *Enum) Clone() Value

func (*Enum) Equals

func (e *Enum) Equals(other Value) Bool

func (*Enum) IGet

func (e *Enum) IGet(index Value) (Value, error)

func (*Enum) ISet

func (e *Enum) ISet(Value, Value) error

func (*Enum) IsCallable

func (e *Enum) IsCallable() Bool

func (*Enum) IsIterable

func (e *Enum) IsIterable() Bool

func (*Enum) Iterator

func (e *Enum) Iterator() Value

func (*Enum) MarshalJSON

func (e *Enum) MarshalJSON() ([]byte, error)

func (*Enum) ObjectKey

func (e *Enum) ObjectKey() string

func (*Enum) Prefix

func (e *Enum) Prefix(op uint64) (Value, error)

func (Enum) String

func (e Enum) String() string

func (*Enum) Type

func (e *Enum) Type() string

type Error

type Error struct {
	ValueSemanticsImpl
	Message Value
}

func (Error) Binop

func (e Error) Binop(op uint64, rhs Value) (Value, error)

func (Error) Boolean

func (e Error) Boolean() Bool

func (Error) Clone

func (e Error) Clone() Value

func (Error) Equals

func (e Error) Equals(other Value) Bool

func (Error) IGet

func (e Error) IGet(index Value) (Value, error)

func (Error) ISet

func (e Error) ISet(index, val Value) error

func (Error) IsCallable

func (e Error) IsCallable() Bool

func (Error) IsIterable

func (e Error) IsIterable() Bool

func (Error) Iterator

func (e Error) Iterator() Value

func (Error) ObjectKey

func (e Error) ObjectKey() string

func (Error) Prefix

func (e Error) Prefix(op uint64) (Value, error)

func (Error) String

func (e Error) String() string

func (Error) Type

func (e Error) Type() string

type ErrorInfo

type ErrorInfo map[string]map[int]uint

type FileHandler

type FileHandler struct {
	ReferenceSemanticsImpl
	Handler  *os.File
	IsClosed bool
}

FileHandler API Type FileHandler is a wrap over *os.File

func (*FileHandler) Binop

func (file *FileHandler) Binop(op uint64, rhs Value) (Value, error)

func (*FileHandler) Boolean

func (file *FileHandler) Boolean() Bool

Implementation of the interface Value

func (*FileHandler) Clone

func (file *FileHandler) Clone() Value

func (*FileHandler) Equals

func (file *FileHandler) Equals(other Value) Bool

func (*FileHandler) IGet

func (file *FileHandler) IGet(Value) (Value, error)

func (*FileHandler) ISet

func (file *FileHandler) ISet(Value, Value) error

func (*FileHandler) IsCallable

func (file *FileHandler) IsCallable() Bool

func (*FileHandler) IsIterable

func (file *FileHandler) IsIterable() Bool

func (*FileHandler) Iterator

func (file *FileHandler) Iterator() Value

func (*FileHandler) Prefix

func (file *FileHandler) Prefix(op uint64) (Value, error)

func (*FileHandler) String

func (file *FileHandler) String() string

func (*FileHandler) Type

func (file *FileHandler) Type() string

type Float

type Float float64

func (Float) Binop

func (f Float) Binop(op uint64, rhs Value) (Value, error)

func (Float) Boolean

func (f Float) Boolean() Bool

func (Float) Call

func (f Float) Call(args ...Value) (Value, error)

func (Float) Clone

func (f Float) Clone() Value

func (Float) Equals

func (f Float) Equals(other Value) Bool

func (Float) IGet

func (f Float) IGet(index Value) (Value, error)

func (Float) ISet

func (f Float) ISet(index, val Value) error

func (Float) IsCallable

func (f Float) IsCallable() Bool

func (Float) IsIterable

func (f Float) IsIterable() Bool

func (Float) Iterator

func (f Float) Iterator() Value

func (Float) ObjectKey

func (f Float) ObjectKey() string

func (Float) Prefix

func (f Float) Prefix(op uint64) (Value, error)

func (Float) String

func (f Float) String() string

func (Float) Type

func (f Float) Type() string

type Function

type Function struct {
	ReferenceSemanticsImpl
	Free   []Value
	CoreFn *CoreFunction
}

func (*Function) Binop

func (f *Function) Binop(op uint64, r Value) (Value, error)

func (*Function) Boolean

func (f *Function) Boolean() Bool

func (*Function) Clone

func (f *Function) Clone() Value

func (*Function) Equals

func (f *Function) Equals(other Value) Bool

func (*Function) IGet

func (f *Function) IGet(Value) (Value, error)

func (*Function) ISet

func (f *Function) ISet(Value, Value) error

func (*Function) IsCallable

func (f *Function) IsCallable() Bool

func (*Function) IsIterable

func (f *Function) IsIterable() Bool

func (*Function) Iterator

func (f *Function) Iterator() Value

func (*Function) ObjectKey

func (f *Function) ObjectKey() string

func (*Function) Prefix

func (f *Function) Prefix(op uint64) (Value, error)

func (Function) String

func (f Function) String() string

func (*Function) Type

func (f *Function) Type() string

type GFn

type GFn func(args ...Value) (Value, error)

func (GFn) Binop

func (gfn GFn) Binop(op uint64, r Value) (Value, error)

func (GFn) Boolean

func (gfn GFn) Boolean() Bool

func (GFn) Call

func (gfn GFn) Call(args ...Value) (Value, error)

func (GFn) Clone

func (gFn GFn) Clone() Value

func (GFn) Equals

func (gfn GFn) Equals(other Value) Bool

func (GFn) IGet

func (gfn GFn) IGet(index Value) (Value, error)

func (GFn) ISet

func (gfn GFn) ISet(index, val Value) error

func (GFn) IsCallable

func (gfn GFn) IsCallable() Bool

func (GFn) IsIterable

func (gfn GFn) IsIterable() Bool

func (GFn) Iterator

func (gfn GFn) Iterator() Value

func (GFn) MarshalJSON

func (gfn GFn) MarshalJSON() ([]byte, error)

func (GFn) ObjectKey

func (gfn GFn) ObjectKey() string

func (GFn) Prefix

func (gfn GFn) Prefix(op uint64) (Value, error)

func (GFn) String

func (gfn GFn) String() string

func (GFn) Type

func (gfn GFn) Type() string

type GlobalState

type GlobalState struct {
	*VM
	Main    *Thread
	Current *Thread
	Pool    *threadPool
}

type Integer

type Integer int64

func StringLength

func StringLength(input *String) Integer

func (Integer) Binop

func (l Integer) Binop(op uint64, rhs Value) (Value, error)

func (Integer) Boolean

func (i Integer) Boolean() Bool

func (Integer) Call

func (i Integer) Call(args ...Value) (Value, error)

func (Integer) Clone

func (i Integer) Clone() Value

func (Integer) Equals

func (i Integer) Equals(other Value) Bool

func (Integer) IGet

func (i Integer) IGet(index Value) (Value, error)

func (Integer) ISet

func (i Integer) ISet(index, val Value) error

func (Integer) IsCallable

func (i Integer) IsCallable() Bool

func (Integer) IsIterable

func (i Integer) IsIterable() Bool

func (Integer) Iterator

func (i Integer) Iterator() Value

func (Integer) ObjectKey

func (i Integer) ObjectKey() string

func (Integer) Prefix

func (i Integer) Prefix(op uint64) (Value, error)

func (Integer) String

func (i Integer) String() string

func (Integer) Type

func (i Integer) Type() string

type IntegerIterator

type IntegerIterator struct {
	ReferenceSemanticsImpl
	Init Integer
	End  Integer
}

func (*IntegerIterator) Binop

func (it *IntegerIterator) Binop(uint64, Value) (Value, error)

func (*IntegerIterator) Boolean

func (it *IntegerIterator) Boolean() Bool

func (*IntegerIterator) Clone

func (it *IntegerIterator) Clone() Value

func (*IntegerIterator) Equals

func (it *IntegerIterator) Equals(Value) Bool

func (*IntegerIterator) IGet

func (it *IntegerIterator) IGet(Value) (Value, error)

func (*IntegerIterator) ISet

func (it *IntegerIterator) ISet(Value, Value) error

func (*IntegerIterator) IsCallable

func (it *IntegerIterator) IsCallable() Bool

func (*IntegerIterator) IsIterable

func (it *IntegerIterator) IsIterable() Bool

func (*IntegerIterator) Iterator

func (it *IntegerIterator) Iterator() Value

func (*IntegerIterator) Key

func (it *IntegerIterator) Key() Value

func (*IntegerIterator) Next

func (it *IntegerIterator) Next() bool

func (*IntegerIterator) Prefix

func (it *IntegerIterator) Prefix(uint64) (Value, error)

func (IntegerIterator) String

func (it IntegerIterator) String() string

func (*IntegerIterator) Type

func (it *IntegerIterator) Type() string

func (*IntegerIterator) Value

func (it *IntegerIterator) Value() Value

type Interpreter

type Interpreter struct {
	// contains filtered or unexported fields
}

func NewDebugger

func NewDebugger(path string, extensionlibloader map[string]func() Value) (*Interpreter, error)

func NewInterpreter

func NewInterpreter(path string, extensionlibloader map[string]func() Value) (*Interpreter, error)

func (*Interpreter) Debug

func (i *Interpreter) Debug() (Result, error)

func (*Interpreter) MeasureRunTime

func (i *Interpreter) MeasureRunTime() (Result, error)

func (*Interpreter) PrintCallStack

func (i *Interpreter) PrintCallStack()

func (*Interpreter) Run

func (i *Interpreter) Run() (Result, error)

type Iterator

type Iterator interface {
	Next() bool
	Key() Value
	Value() Value
}

type LibsLoader

type LibsLoader map[string]func() Value

type Nil

type Nil struct {
	ValueSemanticsImpl
}

func (Nil) Binop

func (n Nil) Binop(op uint64, rhs Value) (Value, error)

func (Nil) Boolean

func (n Nil) Boolean() Bool

func (Nil) Clone

func (n Nil) Clone() Value

func (Nil) Equals

func (n Nil) Equals(other Value) Bool

func (Nil) IGet

func (n Nil) IGet(index Value) (Value, error)

func (Nil) ISet

func (n Nil) ISet(index, val Value) error

func (Nil) IsCallable

func (n Nil) IsCallable() Bool

func (Nil) IsIterable

func (n Nil) IsIterable() Bool

func (Nil) Iterator

func (n Nil) Iterator() Value

func (Nil) ObjectKey

func (n Nil) ObjectKey() string

func (Nil) Prefix

func (n Nil) Prefix(op uint64) (Value, error)

func (Nil) String

func (n Nil) String() string

func (Nil) Type

func (n Nil) Type() string

type Object

type Object struct {
	ReferenceSemanticsImpl
	Value map[string]Value
}

func (*Object) Binop

func (o *Object) Binop(op uint64, rhs Value) (Value, error)

func (*Object) Boolean

func (o *Object) Boolean() Bool

func (*Object) Call

func (o *Object) Call(args ...Value) (Value, error)

func (*Object) Clone

func (o *Object) Clone() Value

func (*Object) Equals

func (o *Object) Equals(other Value) Bool

func (*Object) IGet

func (o *Object) IGet(index Value) (Value, error)

func (*Object) ISet

func (o *Object) ISet(index, val Value) error

func (*Object) IsCallable

func (o *Object) IsCallable() Bool

func (*Object) IsIterable

func (o *Object) IsIterable() Bool

func (*Object) Iterator

func (o *Object) Iterator() Value

func (*Object) MarshalJSON

func (o *Object) MarshalJSON() ([]byte, error)

func (*Object) ObjectKey

func (o *Object) ObjectKey() string

func (*Object) Prefix

func (o *Object) Prefix(op uint64) (Value, error)

func (*Object) String

func (o *Object) String() string

func (*Object) Type

func (o *Object) Type() string

type ObjectIterator

type ObjectIterator struct {
	ReferenceSemanticsImpl
	Keys []string
	Obj  map[string]Value
	Init int
	End  int
}

func (*ObjectIterator) Binop

func (it *ObjectIterator) Binop(uint64, Value) (Value, error)

func (*ObjectIterator) Boolean

func (it *ObjectIterator) Boolean() Bool

func (*ObjectIterator) Clone

func (it *ObjectIterator) Clone() Value

func (*ObjectIterator) Equals

func (it *ObjectIterator) Equals(Value) Bool

func (*ObjectIterator) IGet

func (it *ObjectIterator) IGet(Value) (Value, error)

func (*ObjectIterator) ISet

func (it *ObjectIterator) ISet(Value, Value) error

func (*ObjectIterator) IsCallable

func (it *ObjectIterator) IsCallable() Bool

func (*ObjectIterator) IsIterable

func (it *ObjectIterator) IsIterable() Bool

func (*ObjectIterator) Iterator

func (it *ObjectIterator) Iterator() Value

func (*ObjectIterator) Key

func (it *ObjectIterator) Key() Value

func (*ObjectIterator) Next

func (it *ObjectIterator) Next() bool

func (*ObjectIterator) Prefix

func (it *ObjectIterator) Prefix(uint64) (Value, error)

func (ObjectIterator) String

func (it ObjectIterator) String() string

func (*ObjectIterator) Type

func (it *ObjectIterator) Type() string

func (*ObjectIterator) Value

func (it *ObjectIterator) Value() Value

type ReferenceSemanticsImpl

type ReferenceSemanticsImpl struct{}

func (*ReferenceSemanticsImpl) Binop

func (*ReferenceSemanticsImpl) Boolean

func (i *ReferenceSemanticsImpl) Boolean() Bool

func (*ReferenceSemanticsImpl) Call

func (i *ReferenceSemanticsImpl) Call(args ...Value) (Value, error)

func (*ReferenceSemanticsImpl) Clone

func (i *ReferenceSemanticsImpl) Clone() Value

func (*ReferenceSemanticsImpl) Equals

func (i *ReferenceSemanticsImpl) Equals(Value) Bool

func (*ReferenceSemanticsImpl) IGet

func (*ReferenceSemanticsImpl) ISet

func (*ReferenceSemanticsImpl) IsCallable

func (i *ReferenceSemanticsImpl) IsCallable() Bool

func (*ReferenceSemanticsImpl) IsIterable

func (i *ReferenceSemanticsImpl) IsIterable() Bool

func (*ReferenceSemanticsImpl) Iterator

func (i *ReferenceSemanticsImpl) Iterator() Value

func (*ReferenceSemanticsImpl) MarshalJSON

func (i *ReferenceSemanticsImpl) MarshalJSON() ([]byte, error)

func (*ReferenceSemanticsImpl) ObjectKey

func (i *ReferenceSemanticsImpl) ObjectKey() string

func (*ReferenceSemanticsImpl) Prefix

func (i *ReferenceSemanticsImpl) Prefix(uint64) (Value, error)

func (ReferenceSemanticsImpl) String

func (i ReferenceSemanticsImpl) String() string

func (*ReferenceSemanticsImpl) Type

func (i *ReferenceSemanticsImpl) Type() string

type Result

type Result string
const Failure Result = "Failure"
const Success Result = "Success"

type Script

type Script struct {
	Store        *[]Value
	Konstants    *[]Value
	MainFunction *Function
	ErrorInfo
}

func (Script) String

func (s Script) String() string

type String

type String struct {
	ReferenceSemanticsImpl
	Runes []rune
	Value string
}

func (*String) Binop

func (s *String) Binop(op uint64, rhs Value) (Value, error)

func (*String) Boolean

func (s *String) Boolean() Bool

func (*String) Clone

func (s *String) Clone() Value

func (*String) Equals

func (s *String) Equals(other Value) Bool

func (*String) IGet

func (s *String) IGet(index Value) (Value, error)

func (*String) ISet

func (s *String) ISet(index, val Value) error

func (*String) IsCallable

func (s *String) IsCallable() Bool

func (*String) IsIterable

func (s *String) IsIterable() Bool

func (*String) Iterator

func (s *String) Iterator() Value

func (*String) MarshalJSON

func (s *String) MarshalJSON() ([]byte, error)

func (*String) ObjectKey

func (s *String) ObjectKey() string

func (*String) Prefix

func (s *String) Prefix(op uint64) (Value, error)

func (String) String

func (s String) String() string

func (*String) Type

func (s *String) Type() string

type StringIterator

type StringIterator struct {
	ReferenceSemanticsImpl
	Runes []rune
	Init  int
	End   int
}

func (*StringIterator) Binop

func (it *StringIterator) Binop(uint64, Value) (Value, error)

func (*StringIterator) Boolean

func (it *StringIterator) Boolean() Bool

func (*StringIterator) Clone

func (it *StringIterator) Clone() Value

func (*StringIterator) Equals

func (it *StringIterator) Equals(Value) Bool

func (*StringIterator) IGet

func (it *StringIterator) IGet(Value) (Value, error)

func (*StringIterator) ISet

func (it *StringIterator) ISet(Value, Value) error

func (*StringIterator) IsCallable

func (it *StringIterator) IsCallable() Bool

func (*StringIterator) IsIterable

func (it *StringIterator) IsIterable() Bool

func (*StringIterator) Iterator

func (it *StringIterator) Iterator() Value

func (*StringIterator) Key

func (it *StringIterator) Key() Value

func (*StringIterator) Next

func (it *StringIterator) Next() bool

func (*StringIterator) Prefix

func (it *StringIterator) Prefix(uint64) (Value, error)

func (StringIterator) String

func (it StringIterator) String() string

func (*StringIterator) Type

func (it *StringIterator) Type() string

func (*StringIterator) Value

func (it *StringIterator) Value() Value

type Thread

type Thread struct {
	ReferenceSemanticsImpl
	Frames  []frame
	Stack   []Value
	Script  *Script
	Frame   *frame
	Invoker *Thread
	State   ThreadState
	Channel Value
	Reg     uint64
	// contains filtered or unexported fields
}

func (*Thread) Binop

func (th *Thread) Binop(op uint64, rhs Value) (Value, error)

func (*Thread) Boolean

func (th *Thread) Boolean() Bool

func (*Thread) Clone

func (th *Thread) Clone() Value

func (*Thread) Equals

func (th *Thread) Equals(other Value) Bool

func (*Thread) ObjectKey

func (th *Thread) ObjectKey() string

func (*Thread) Prefix

func (th *Thread) Prefix(op uint64) (Value, error)

func (*Thread) String

func (th *Thread) String() string

func (*Thread) Type

func (th *Thread) Type() string

type ThreadState

type ThreadState int
const (
	Ready ThreadState = iota
	Running
	Suspended
	Waiting
	Completed
)

func (ThreadState) String

func (state ThreadState) String() string

type Time

type Time time.Time

func (Time) Binop

func (t Time) Binop(op uint64, rhs Value) (Value, error)

func (Time) Boolean

func (t Time) Boolean() Bool

func (Time) Call

func (t Time) Call(args ...Value) (Value, error)

func (Time) Clone

func (t Time) Clone() Value

func (Time) Equals

func (t Time) Equals(other Value) Bool

func (Time) IGet

func (t Time) IGet(index Value) (Value, error)

func (Time) ISet

func (t Time) ISet(index, val Value) error

func (Time) IsCallable

func (t Time) IsCallable() Bool

func (Time) IsIterable

func (t Time) IsIterable() Bool

func (Time) Iterator

func (t Time) Iterator() Value

func (Time) ObjectKey

func (t Time) ObjectKey() string

func (Time) Prefix

func (t Time) Prefix(op uint64) (Value, error)

func (Time) String

func (t Time) String() string

func (Time) Type

func (t Time) Type() string

type VM

type VM struct {
	*Thread
}

func (*VM) Inspect

func (vm *VM) Inspect(ip int)

type Value

type Value interface {
	Boolean() Bool
	Prefix(uint64) (Value, error)
	Binop(uint64, Value) (Value, error)
	IGet(Value) (Value, error)
	ISet(Value, Value) error
	Equals(Value) Bool
	IsIterable() Bool
	Iterator() Value
	IsCallable() Bool
	Call(args ...Value) (Value, error)
	String() string
	Type() string
	Clone() Value
	ObjectKey() string
}

func DeepEqual

func DeepEqual(args ...Value) (Value, error)

func IsMemberOf

func IsMemberOf(args ...Value) (Value, error)

type ValueSemanticsImpl

type ValueSemanticsImpl struct{}

func (ValueSemanticsImpl) Binop

func (i ValueSemanticsImpl) Binop(uint64, Value) (Value, error)

func (ValueSemanticsImpl) Boolean

func (i ValueSemanticsImpl) Boolean() Bool

func (ValueSemanticsImpl) Call

func (i ValueSemanticsImpl) Call(args ...Value) (Value, error)

func (ValueSemanticsImpl) Clone

func (i ValueSemanticsImpl) Clone() Value

func (ValueSemanticsImpl) Equals

func (i ValueSemanticsImpl) Equals(Value) Bool

func (ValueSemanticsImpl) IGet

func (i ValueSemanticsImpl) IGet(Value) (Value, error)

func (ValueSemanticsImpl) ISet

func (ValueSemanticsImpl) IsCallable

func (i ValueSemanticsImpl) IsCallable() Bool

func (ValueSemanticsImpl) IsIterable

func (i ValueSemanticsImpl) IsIterable() Bool

func (ValueSemanticsImpl) Iterator

func (i ValueSemanticsImpl) Iterator() Value

func (ValueSemanticsImpl) MarshalJSON

func (i ValueSemanticsImpl) MarshalJSON() ([]byte, error)

func (ValueSemanticsImpl) ObjectKey

func (i ValueSemanticsImpl) ObjectKey() string

func (ValueSemanticsImpl) Prefix

func (i ValueSemanticsImpl) Prefix(uint64) (Value, error)

func (ValueSemanticsImpl) String

func (i ValueSemanticsImpl) String() string

func (ValueSemanticsImpl) Type

func (i ValueSemanticsImpl) Type() string

Directories

Path Synopsis
cli
alpha command
vida command

Jump to

Keyboard shortcuts

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