env

package
v0.0.0-...-5b4db0f Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

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

Jump to

Keyboard shortcuts

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