elpsutil

package
v1.16.8 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(env *lisp.LEnv, fn Loader) *lisp.LVal

Load loads an elps package implemented in Go.

Types

type Builtin

type Builtin struct {
	// contains filtered or unexported fields
}

Builtin captures Go functions that are callable from elps.

func Function

func Function(name string, formals *lisp.LVal, fun lisp.LBuiltin) *Builtin

Function is a helper to construct builtins.

func (*Builtin) Eval

func (fun *Builtin) Eval(env *lisp.LEnv, args *lisp.LVal) *lisp.LVal

Eval evaluates a function on an environment.

func (*Builtin) Formals

func (fun *Builtin) Formals() *lisp.LVal

Formals returns the formal arguments of a function.

func (*Builtin) Name

func (fun *Builtin) Name() string

Name returns the name of a function.

type Loader

type Loader = lisp.Loader

Loader is a generic function to initialize/load an LEnv. A Loader should first define and switch into the package(s) it loads. Typically, after a Loader executes LEnv.InPackage() is executed to switch back into the user package.

A chain of loaders may be formed to load a library.

func LibraryLoader

func LibraryLoader(ps ...Package) Loader

LibraryLoader loads multiple elps packages implemented in Go.

func LoadAll

func LoadAll(fn ...Loader) Loader

LoadAll loads multiple elps files implemented in Go.

func PackageLoader

func PackageLoader(p Package) Loader

PackageLoader loads an elps package implemented in Go.

type Package

type Package interface {
	PackageName() string
}

Package is an elps package implemented in Go.

type PackageBuiltins

type PackageBuiltins interface {
	Package
	Builtins() []lisp.LBuiltinDef
}

PackageBuiltins retrieves the exposed builtins for an elps package implemented in Go.

type PackageInit

type PackageInit interface {
	Package
	PackageInit(env *lisp.LEnv) *lisp.LVal
}

PackageInit allows initialization of an elps package implemented in Go.

type PackageMacros

type PackageMacros interface {
	Package
	Macros() []lisp.LBuiltinDef
}

PackageMacros returns the macros for an elps package implemented in Go.

type PackageSpecialOps

type PackageSpecialOps interface {
	Package
	SpecialOps() []lisp.LBuiltinDef
}

PackageSpecialOps returns the special operators for an elps package implemented in Go.

Jump to

Keyboard shortcuts

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