object

package
v0.0.0-...-30a0b69 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2020 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NIL_OBJ     ObjectType = "nil"
	BOOL_OBJ               = "bool"
	INTEGER_OBJ            = "int"
	FLOAT_OBJ              = "float"
	CHAR_OBJ               = "char"
	STRING_OBJ             = "string"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BinaryOperable

type BinaryOperable interface {
	BinaryOp(op token.TokenType, rhs Object) (Object, error)
}

type Bool

type Bool bool

func (Bool) Equals

func (b Bool) Equals(rhs Object) bool

func (Bool) String

func (b Bool) String() string

func (Bool) Truthy

func (b Bool) Truthy() bool

func (Bool) Type

func (b Bool) Type() ObjectType

type Char

type Char rune

func (Char) Equals

func (c Char) Equals(rhs Object) bool

func (Char) String

func (c Char) String() string

func (Char) Truthy

func (c Char) Truthy() bool

func (Char) Type

func (c Char) Type() ObjectType

type Float

type Float float64

func (Float) Equals

func (f Float) Equals(rhs Object) bool

func (Float) String

func (f Float) String() string

func (Float) Truthy

func (f Float) Truthy() bool

func (Float) Type

func (f Float) Type() ObjectType

type Int

type Int int64

func (Int) Equals

func (i Int) Equals(rhs Object) bool

func (Int) String

func (i Int) String() string

func (Int) Truthy

func (i Int) Truthy() bool

func (Int) Type

func (i Int) Type() ObjectType

type Nil

type Nil struct{}

func (Nil) Equals

func (n Nil) Equals(rhs Object) bool

func (Nil) String

func (n Nil) String() string

func (Nil) Truthy

func (n Nil) Truthy() bool

func (Nil) Type

func (n Nil) Type() ObjectType

type Nilable

type Nilable interface {
	IsNil() bool
}

type Object

type Object interface {
	Type() ObjectType
	Truthy() bool
	Equals(rhs Object) bool
	String() string
}

type ObjectType

type ObjectType string

type Orderable

type Orderable interface {
	LessThan(rhs Object) bool
}

type String

type String string

func (String) Equals

func (s String) Equals(rhs Object) bool

func (String) String

func (s String) String() string

func (String) Truthy

func (s String) Truthy() bool

func (String) Type

func (s String) Type() ObjectType

Jump to

Keyboard shortcuts

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