Documentation ¶
Overview ¶
Package object contains our core-definitions for objects.
Index ¶
Constants ¶
const ( INTEGER_OBJ = "INTEGER" FLOAT_OBJ = "FLOAT" BOOLEAN_OBJ = "BOOLEAN" NULL_OBJ = "NULL" RETURN_VALUE_OBJ = "RETURN_VALUE" ERROR_OBJ = "ERROR" STRING_OBJ = "STRING" )
pre-defined constant Type
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Boolean ¶
type Boolean struct { // Value holds the boolean value we wrap. Value bool }
Boolean wraps bool and implements the Object interface.
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
Environment stores our functions, variables, constants, etc.
func NewEnclosedEnvironment ¶
func NewEnclosedEnvironment(outer *Environment) *Environment
NewEnclosedEnvironment create new environment by outer parameter
type Error ¶
type Error struct { // Message contains the error-message we're wrapping Message string }
Error wraps string and implements Object interface.
type Float ¶
type Float struct { // Value holds the float-value this object wraps. Value float64 }
Float wraps float64 and implements the Object interface.
type Integer ¶
type Integer struct { // Value holds the integer value this object wraps Value int64 }
Integer wraps int64 and implements the Object interface.
type Null ¶
type Null struct{}
Null wraps nothing and implements our Object interface.
type Object ¶
type Object interface { // Type returns the type of this object. Type() Type // Inspect returns a string-representation of the given object. Inspect() string }
Object is the interface that all of our various object-types must implmenet.
type ReturnValue ¶
type ReturnValue struct { // Value is the object that is to be returned Value Object }
ReturnValue wraps Object and implements the Object interface.
func (*ReturnValue) Inspect ¶
func (rv *ReturnValue) Inspect() string
Inspect returns a string-representation of the given object.