lisp

package
v0.0.0-...-1711e6f Latest Latest
Warning

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

Go to latest
Published: May 20, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAtom

func IsAtom(obj Object) bool

func IsNull

func IsNull(obj Object) bool

func ListToSlice

func ListToSlice(obj Object) ([]Object, Object, error)

func ToBool

func ToBool(obj Object) bool

func ToNumber

func ToNumber(obj Object) (int, error)

func ToString

func ToString(obj Object) string

Types

type ApDumpEntry

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

type CEnv

type CEnv = map[string]*Location

type Code

type Code []Insn

func Compile

func Compile(expr Object) (Code, error)

type Compiler

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

func NewCompiler

func NewCompiler() *Compiler

type Cons

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

type Dump

type Dump []Restorer

type Env

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

func (*Env) Locate

func (env *Env) Locate(loc *Location) Object

func (*Env) Pop

func (env *Env) Pop() *Env

func (*Env) Push

func (env *Env) Push(frame Frame) *Env

func (*Env) Update

func (env *Env) Update(loc *Location, val Object)

type Frame

type Frame []Object

type Func

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

func NewFunc

func NewFunc(code Code, env *Env) *Func

type Insn

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

type Location

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

type Object

type Object interface{}

func Car

func Car(obj Object) (Object, error)

func Cdr

func Cdr(obj Object) (Object, error)

func FromBool

func FromBool(b bool) Object

func NewCons

func NewCons(car Object, cdr Object) Object

func ReadFromString

func ReadFromString(input string) (Object, error)

type Op

type Op int
const (
	NIL Op = iota
	LDC
	LD
	LDG
	SV
	SVG
	POP
	ATOM
	NULL
	CAR
	CDR
	CONS
	ADD
	SUB
	MUL
	DIV
	EQ
	GT
	LT
	GTE
	LTE
	SEL
	JOIN
	LDF
	AP
	RTN
	DUM
	RAP
)

type Operand

type Operand interface{}

type PC

type PC int

type Reader

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

func NewReader

func NewReader(reader io.Reader) *Reader

func (*Reader) Read

func (r *Reader) Read() (Object, error)

type Restorer

type Restorer interface {
	// contains filtered or unexported methods
}

type SelDumpEntry

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

type Stack

type Stack []Object

type Symbol

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

func Intern

func Intern(name string) *Symbol

func (*Symbol) SetValue

func (sym *Symbol) SetValue(val Object)

type VM

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

func NewVM

func NewVM(code Code) *VM

func (*VM) Run

func (vm *VM) Run() (Object, error)

Jump to

Keyboard shortcuts

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