object

package
v0.0.0-...-8b6a9a5 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Objects = [...]string{
	NULL:            "NULL",
	ERROR:           "ERROR",
	INTEGER:         "INTEGER",
	BOOLEAN:         "BOOLEAN",
	STRING:          "STRING",
	STRING_HASH_OBJ: "STRING_HASH",
	UUID:            "UUID",
}

Functions

This section is empty.

Types

type Boolean

type Boolean struct {
	Value bool
}

func (*Boolean) HashKey

func (b *Boolean) HashKey() HashKey

func (*Boolean) Inspect

func (b *Boolean) Inspect() string

func (*Boolean) Type

func (b *Boolean) Type() ObjectType

type BuiltinFunction

type BuiltinFunction func(args ...Object) Object

type Environment

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

func NewEnclosedEnvironment

func NewEnclosedEnvironment(outer *Environment) *Environment

func NewEnvironment

func NewEnvironment() *Environment

func (*Environment) Get

func (e *Environment) Get(name string) (Object, bool)

func (*Environment) Set

func (e *Environment) Set(name string, val Object) Object

type Error

type Error struct {
	Message string
}

func (*Error) Inspect

func (e *Error) Inspect() string

func (*Error) Type

func (e *Error) Type() ObjectType

type HashKey

type HashKey struct {
	Type  ObjectType
	Value uint64
}

type Hashable

type Hashable interface {
	HashKey() HashKey
}

type Integer

type Integer struct {
	Value int64
}

func (*Integer) HashKey

func (i *Integer) HashKey() HashKey

func (*Integer) Inspect

func (i *Integer) Inspect() string

func (*Integer) Type

func (i *Integer) Type() ObjectType

type Null

type Null struct{}

func (*Null) Inspect

func (n *Null) Inspect() string

func (*Null) Type

func (n *Null) Type() ObjectType

type Object

type Object interface {
	Type() ObjectType
	Inspect() string
}

type ObjectType

type ObjectType int
const (
	NULL ObjectType
	ERROR
	INTEGER
	BOOLEAN
	STRING
	STRING_HASH_OBJ // This is only used internally. It is not a part of the language.
	UUID
)

type String

type String struct {
	Value string
}

func (*String) HashKey

func (s *String) HashKey() HashKey

func (*String) Inspect

func (s *String) Inspect() string

func (*String) Type

func (s *String) Type() ObjectType

type StringHash

type StringHash struct {
	Value map[string]string
}

This is only used internally. It is not a part of the language.

func (*StringHash) Inspect

func (s *StringHash) Inspect() string

func (*StringHash) Type

func (s *StringHash) Type() ObjectType

type UID

type UID struct {
	Value uuid.UUID
}

func (*UID) HashKey

func (u *UID) HashKey() HashKey

func (*UID) Inspect

func (u *UID) Inspect() string

func (*UID) Type

func (u *UID) Type() ObjectType

Jump to

Keyboard shortcuts

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