lisp

package
v0.0.0-...-b44ac9e Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var False = Value{symbolValue, "false"}
View Source
var Nil = Value{nilValue, nil}
View Source
var True = Value{symbolValue, "true"}

Functions

This section is empty.

Types

type Builtin

type Builtin struct{}

func (Builtin) Add

func (Builtin) Add(vars ...Value) (Value, error)

func (Builtin) Car

func (Builtin) Car(vars ...Value) (Value, error)

func (Builtin) Cdr

func (Builtin) Cdr(vars ...Value) (Value, error)

func (Builtin) Cons

func (Builtin) Cons(vars ...Value) (Value, error)

func (Builtin) Display

func (Builtin) Display(vars ...Value) (Value, error)

func (Builtin) Gt

func (Builtin) Gt(vars ...Value) (Value, error)

func (Builtin) Gte

func (Builtin) Gte(vars ...Value) (Value, error)

func (Builtin) Lt

func (Builtin) Lt(vars ...Value) (Value, error)

func (Builtin) Lte

func (Builtin) Lte(vars ...Value) (Value, error)

func (Builtin) Mul

func (Builtin) Mul(vars ...Value) (Value, error)

func (Builtin) Sub

func (Builtin) Sub(vars ...Value) (Value, error)

type Cons

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

func (Cons) Eval

func (c Cons) Eval() (val Value, err error)

func (Cons) Execute

func (cons Cons) Execute() (Value, error)

func (Cons) Len

func (c Cons) Len() int

func (Cons) List

func (c Cons) List() bool

func (Cons) Map

func (c Cons) Map(f func(v Value) (Value, error)) ([]Value, error)

func (Cons) String

func (c Cons) String() string

func (Cons) Stringify

func (c Cons) Stringify() []string

func (Cons) Vector

func (c Cons) Vector() Vector

type Env

type Env map[string]Value

type Pattern

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

type Proc

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

func (Proc) Call

func (p Proc) Call(params Vector) (val Value, err error)

func (Proc) String

func (p Proc) String() string

type Scope

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

func NewScope

func NewScope() *Scope

func (*Scope) AddEnv

func (s *Scope) AddEnv() *Env

func (*Scope) Create

func (s *Scope) Create(key string, value Value) Value

func (*Scope) DropEnv

func (s *Scope) DropEnv() *Env

func (*Scope) Dup

func (s *Scope) Dup() *Scope

func (*Scope) Env

func (s *Scope) Env() *Env

func (*Scope) Get

func (s *Scope) Get(key string) (val Value, ok bool)

func (*Scope) Set

func (s *Scope) Set(key string, value Value) Value

type Token

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

func (Token) String

func (t Token) String() string

type Tokens

type Tokens []*Token

func NewTokens

func NewTokens(program string) (tokens Tokens)

func (Tokens) Expand

func (tokens Tokens) Expand() (result Tokens, err error)

Expand until there are no more expansions to do

func (Tokens) Parse

func (tokens Tokens) Parse() (cons Cons, err error)

type Value

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

func EvalString

func EvalString(line string) (Value, error)

func (Value) Cons

func (v Value) Cons() Cons

func (Value) Eval

func (v Value) Eval() (Value, error)

func (Value) Inspect

func (v Value) Inspect() string

func (Value) Number

func (v Value) Number() float64

func (Value) String

func (v Value) String() string

type Vector

type Vector []Value

func (Vector) Inspect

func (s Vector) Inspect() string

func (Vector) String

func (s Vector) String() string

Jump to

Keyboard shortcuts

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