Documentation ¶
Index ¶
- type Environment
- func (e *Environment) Debug() string
- func (e *Environment) Define(name string, value ast.Expression)
- func (e *Environment) Get(name string) (value ast.Expression, found bool)
- func (e *Environment) GetAt(distance int, name string) (value ast.Expression, found bool)
- func (e *Environment) Set(name string, value ast.Expression) bool
- func (e *Environment) SetAt(distance int, name string, value ast.Expression) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Environment ¶
type Environment struct { Parent *Environment // contains filtered or unexported fields }
func New ¶
func New(outer *Environment) *Environment
func (*Environment) Debug ¶
func (e *Environment) Debug() string
func (*Environment) Define ¶
func (e *Environment) Define(name string, value ast.Expression)
Define sets the value of "name" to "value" within the current scope.
func (*Environment) Get ¶
func (e *Environment) Get(name string) (value ast.Expression, found bool)
Get returns "name"'s value from the closest scope that has "name" defined. "found" is true if a value for "name" was found, or false if no scope in the environment contained a defintion for it.
func (*Environment) GetAt ¶
func (e *Environment) GetAt(distance int, name string) (value ast.Expression, found bool)
func (*Environment) Set ¶
func (e *Environment) Set(name string, value ast.Expression) bool
Set sets the value of the variable "name" to "value" within the closest scope that defines "name". The return value is true if the value was set within that scope, or false if no enclosign scope had the variable defined.
func (*Environment) SetAt ¶
func (e *Environment) SetAt(distance int, name string, value ast.Expression) bool
Click to show internal directories.
Click to hide internal directories.