eval

package
v0.0.0-...-65d0a20 Latest Latest
Warning

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

Go to latest
Published: May 3, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FuncNameQuote is a name for quote function.
	FuncNameQuote = "quote"
	// FuncNameUnquote is a name for unquote function.
	FuncNameUnquote = "unquote"
)

Variables

View Source
var (
	// NilValue represents a value of nil reference.
	NilValue = &object.Nil{}
	// TrueValue represents a value of true literals.
	TrueValue = &object.Boolean{Value: true}
	// FalseValue represents a value of false literals.
	FalseValue = &object.Boolean{Value: false}
)

Functions

func DefineMacros

func DefineMacros(program *ast.Program, env object.Environment)

DefineMacros finds macro definitions in the program, saves them to a given environment and removes them from the AST.

func Eval

func Eval(node ast.Node, env object.Environment) object.Object

Eval evaluates the given node and returns an evaluated object.

func ExpandMacros

func ExpandMacros(program ast.Node, env object.Environment) ast.Node

ExpandMacros expands defined macros and replaces AST nodes with the result of macro expansion.

Types

This section is empty.

Jump to

Keyboard shortcuts

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