Documentation ¶
Index ¶
- Constants
- Variables
- func Float[T constraints.Float](value *Value) T
- func Int[T constraints.Integer](value *Value) T
- type Callback
- type ClassInfo
- type FuncInfo
- type Hash
- type HashKeyValue
- type Loader
- type Plasma
- func (plasma *Plasma) ArrayClass() *Value
- func (plasma *Plasma) BoolClass() *Value
- func (plasma *Plasma) BytesClass() *Value
- func (plasma *Plasma) Execute(bytecode []byte) (result chan *Value, err chan error, stop chan struct{})
- func (plasma *Plasma) ExecuteString(scriptCode string) (result chan *Value, err chan error, stop chan struct{})
- func (plasma *Plasma) False() *Value
- func (plasma *Plasma) FloatClass() *Value
- func (plasma *Plasma) FromValue(value *Value) (any, error)
- func (plasma *Plasma) FunctionClass() *Value
- func (plasma *Plasma) HashClass() *Value
- func (plasma *Plasma) IntClass() *Value
- func (plasma *Plasma) Load(symbol string, loader Loader)
- func (plasma *Plasma) LoadGo(symbol string, v any) error
- func (plasma *Plasma) MetaClass() *Value
- func (plasma *Plasma) NewArray(values []*Value) *Value
- func (plasma *Plasma) NewBool(b bool) *Value
- func (plasma *Plasma) NewBuiltInFunction(parent *Symbols, callback Callback) *Value
- func (plasma *Plasma) NewBytes(contents []byte) *Value
- func (plasma *Plasma) NewClass() *Value
- func (plasma *Plasma) NewFloat(f float64) *Value
- func (plasma *Plasma) NewHash(hash *Hash) *Value
- func (plasma *Plasma) NewInt(i int64) *Value
- func (plasma *Plasma) NewInternalHash() *Hash
- func (plasma *Plasma) NewNone() *Value
- func (plasma *Plasma) NewString(contents []byte) *Value
- func (plasma *Plasma) NewTuple(values []*Value) *Value
- func (plasma *Plasma) NewValue(parent *Symbols, typeId TypeId, class *Value) *Value
- func (plasma *Plasma) None() *Value
- func (plasma *Plasma) NoneTypeClass() *Value
- func (plasma *Plasma) RootSymbols() *Symbols
- func (plasma *Plasma) StringClass() *Value
- func (plasma *Plasma) ToValue(symbols *Symbols, v any) (*Value, error)
- func (plasma *Plasma) True() *Value
- func (plasma *Plasma) TupleClass() *Value
- func (plasma *Plasma) ValueClass() *Value
- func (plasma *Plasma) ZeroCopyArray(vt *Symbols, v any) *Value
- type PlasmaCallback
- type Symbols
- type TypeId
- type Value
- func (value *Value) ArrayEqual(other *Value) bool
- func (value *Value) Bool() bool
- func (value *Value) BoolEqual(other *Value) bool
- func (value *Value) BuiltInClassEqual(other *Value) bool
- func (value *Value) BuiltInFunctionEqual(other *Value) bool
- func (value *Value) Bytes() []byte
- func (value *Value) BytesEqual(other *Value) bool
- func (value *Value) Call(argument ...*Value) (*Value, error)
- func (value *Value) ClassEqual(other *Value) bool
- func (value *Value) Del(symbol string) error
- func (value *Value) Equal(other *Value) bool
- func (value *Value) FloatEqual(other *Value) bool
- func (value *Value) FunctionEqual(other *Value) bool
- func (value *Value) Get(symbol string) (*Value, error)
- func (value *Value) GetAny() any
- func (value *Value) GetBool() bool
- func (value *Value) GetBytes() []byte
- func (value *Value) GetCallback() Callback
- func (value *Value) GetClass() *Value
- func (value *Value) GetClassInfo() *ClassInfo
- func (value *Value) GetFloat64() float64
- func (value *Value) GetFuncInfo() FuncInfo
- func (value *Value) GetHash() *Hash
- func (value *Value) GetInt64() int64
- func (value *Value) GetValues() []*Value
- func (value *Value) HashEqual(other *Value) bool
- func (value *Value) Implements(class *Value) bool
- func (value *Value) IntEqual(other *Value) bool
- func (value *Value) NoneEqual(other *Value) bool
- func (value *Value) Set(symbol string, v *Value)
- func (value *Value) SetAny(v any)
- func (value *Value) String() string
- func (value *Value) StringEqual(other *Value) bool
- func (value *Value) TupleEqual(other *Value) bool
- func (value *Value) TypeId() TypeId
- func (value *Value) ValueEqual(other *Value) bool
- func (value *Value) Values() []*Value
- func (value *Value) VirtualTable() *Symbols
Constants ¶
View Source
const (
MaxDoCallSearch = 3
)
Variables ¶
View Source
var ( NotOperable = fmt.Errorf("not operable") NotIndexable = fmt.Errorf("not indexable") NotComparable = fmt.Errorf("not comparable") )
View Source
var (
NotHashable = fmt.Errorf("not hashable")
)
View Source
var (
SymbolNotFoundError = "symbol not found: %s"
)
Functions ¶
func Float ¶
func Float[T constraints.Float](value *Value) T
Types ¶
type Hash ¶
type Hash struct {
// contains filtered or unexported fields
}
type HashKeyValue ¶
type Plasma ¶
type Plasma struct { Stdin io.Reader Stdout, Stderr io.Writer // contains filtered or unexported fields }
func (*Plasma) ArrayClass ¶
func (*Plasma) BytesClass ¶
func (*Plasma) ExecuteString ¶
func (*Plasma) FloatClass ¶
func (*Plasma) FromValue ¶
FromValue maps a Go value to a plasma Value, this function easy the work for interfacing with plasma
func (*Plasma) FunctionClass ¶
func (*Plasma) NewBuiltInFunction ¶
NewBuiltInFunction Creates a new built-in function Value
func (*Plasma) NewInternalHash ¶
NewInternalHash Creates a new Hash object to handle hashing operations
func (*Plasma) NoneTypeClass ¶
func (*Plasma) RootSymbols ¶
func (*Plasma) StringClass ¶
func (*Plasma) ToValue ¶
ToValue maps a Plasma Value to a Go value, this function easy the work for interfacing with plasma
func (*Plasma) TupleClass ¶
func (*Plasma) ValueClass ¶
type PlasmaCallback ¶
type Symbols ¶
type Symbols struct { Parent *Symbols // contains filtered or unexported fields }
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
func (*Value) ArrayEqual ¶
func (*Value) BuiltInClassEqual ¶
func (*Value) BuiltInFunctionEqual ¶
func (*Value) BytesEqual ¶
func (*Value) ClassEqual ¶
func (*Value) FloatEqual ¶
func (*Value) FunctionEqual ¶
func (*Value) GetCallback ¶
GetCallback cast the internal value to Callback
func (*Value) GetClassInfo ¶
GetClassInfo cast the internal value to *ClassInfo
func (*Value) GetFloat64 ¶
GetFloat64 cast the internal value to float64
func (*Value) GetFuncInfo ¶
GetFuncInfo cast the internal value to FuncInfo
func (*Value) Implements ¶
func (*Value) StringEqual ¶
func (*Value) TupleEqual ¶
func (*Value) ValueEqual ¶
func (*Value) VirtualTable ¶
Click to show internal directories.
Click to hide internal directories.