Documentation
¶
Index ¶
- func ToMapKey(o *Object) string
- type Closure
- type Object
- func Make(val any, of checker.Type) *Object
- func MakeBool(b bool) *Object
- func MakeDynamic(val any) *Object
- func MakeErr(err *Object) *Object
- func MakeFloat(f float64) *Object
- func MakeInt(i int) *Object
- func MakeList(of checker.Type, items ...*Object) *Object
- func MakeMap(keyType, valueType checker.Type) *Object
- func MakeNone(of checker.Type) *Object
- func MakeOk(err *Object) *Object
- func MakeStr(s string) *Object
- func MakeStruct(of checker.Type, fields map[string]*Object) *Object
- func Void() *Object
- func (o Object) AsBool() bool
- func (o Object) AsFloat() float64
- func (o Object) AsInt() int
- func (o *Object) AsList() []*Object
- func (o *Object) AsMap() map[string]*Object
- func (o Object) AsString() string
- func (o *Object) Copy() *Object
- func (o Object) Equals(other Object) bool
- func (o *Object) GoValue() any
- func (o Object) IsErr() bool
- func (o Object) IsFloat() bool
- func (o Object) IsInt() (int, bool)
- func (o Object) IsNone() bool
- func (o Object) IsOk() bool
- func (o Object) IsResult() bool
- func (o Object) IsStr() (string, bool)
- func (o Object) IsStruct() bool
- func (o *Object) List_Push(item *Object)
- func (o Object) Map_GetKey(str string) *Object
- func (o *Object) Map_Set(key, val *Object) bool
- func (o *Object) MarshalJSON() ([]byte, error)
- func (o *Object) MarshalJSONTo(enc *jsontext.Encoder) error
- func (o Object) Raw() any
- func (o *Object) Set(v any)
- func (o *Object) SetRefinedType(declared checker.Type)
- func (o Object) String() string
- func (o Object) Struct_Get(key string) *Object
- func (o Object) ToNone() *Object
- func (o Object) ToSome(val any) *Object
- func (o Object) Type() checker.Type
- func (o *Object) UnwrapResult() *Object
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Object ¶
type Object struct {
// contains filtered or unexported fields
}
func MakeDynamic ¶
func (Object) Equals ¶
simply compares the raw representations.
the checker rules should prevent more complex comparisons.
func (Object) Map_GetKey ¶
Ard primitives can be used as keys. The raw representation is a string, so convert the string from Go back to Ard
func (*Object) Map_Set ¶
map_set sets a key-value pair in the map object. returns true if successful, false otherwise.
func (*Object) MarshalJSON ¶
MarshalJSON implements the traditional JSON marshaling interface
func (*Object) MarshalJSONTo ¶
MarshalJSONTo implements JSON v2 marshaling interface
func (*Object) SetRefinedType ¶
todo: eliminating unknown generics in the checker needs more work, particularly for nested scopes - see decode::nullable
- the checker successfully refines on variable definitions
- it does not work on chained expressions let result = returns_generic() result.expect("foobar").do_stuff() // .expect(...) returns an open generic
func (Object) Struct_Get ¶
func (*Object) UnwrapResult ¶
Click to show internal directories.
Click to hide internal directories.