lisp

package
v0.0.0-...-fe056f4 Latest Latest
Warning

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

Go to latest
Published: May 12, 2014 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NIL = Atom{"nil"}
	TEE = Atom{"t"}

	QUOTE = Atom{"quote"}
	ATOM  = Atom{"atom"}
	EQ    = Atom{"eq"}
	CAR   = Atom{"car"}
	CDR   = Atom{"cdr"}
	CONS  = Atom{"cons"}
	COND  = Atom{"cond"}
)
View Source
var (
	ERROR_EOF = `End of file during parsing`
	ERROR_DOT = `Invalid read syntax: ". in wrong context"`
)
View Source
var (
	ADD = Atom{"+"}
	SUB = Atom{"-"}
	MUL = Atom{"*"}
	MOD = Atom{"%"}
	DIV = Atom{"/"}
)
View Source
var GlobalEnv = fn_cons(fn_cons(Atom{"os"}, Atom{"mac"}), NIL).(List)

Functions

func InitEnv

func InitEnv()

func Main

func Main()

func ReadChar

func ReadChar(in io.RuneScanner) (r rune, size int, err error)

like in.ReadRune() but ignore all leading whitespace.

Types

type Atom

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

func (Atom) Atomp

func (this Atom) Atomp() bool

func (Atom) Funcp

func (this Atom) Funcp() bool

func (Atom) Listp

func (this Atom) Listp() bool

func (Atom) Numberp

func (this Atom) Numberp() bool

Atom is a Sexper

func (Atom) String

func (this Atom) String() string

func (Atom) Stringp

func (this Atom) Stringp() bool

type Callable

type Callable (func(Sexper) Sexper)

type Evaler

type Evaler interface {
	Get(Sexper) Sexper
	Set(Sexper, Sexper) Evaler
	Eval(Sexper) Sexper
}

Evaler

type Func

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

func (Func) Atomp

func (this Func) Atomp() bool

func (Func) Funcp

func (this Func) Funcp() bool

func (Func) Listp

func (this Func) Listp() bool

func (Func) Numberp

func (this Func) Numberp() bool

Func is a Sexper

func (Func) String

func (this Func) String() string

func (Func) Stringp

func (this Func) Stringp() bool

type List

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

func (List) Atomp

func (this List) Atomp() bool

func (List) Eval

func (this List) Eval(sexp Sexper) Sexper

func (List) Funcp

func (this List) Funcp() bool

func (List) Get

func (this List) Get(key Sexper) Sexper

List is an Evaler

func (List) Listp

func (this List) Listp() bool

func (List) Numberp

func (this List) Numberp() bool

List is a Sexper

func (List) Set

func (this List) Set(key, val Sexper) List

func (List) String

func (this List) String() string

func (List) Stringp

func (this List) Stringp() bool

type Number

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

func (Number) Atomp

func (this Number) Atomp() bool

func (Number) Funcp

func (this Number) Funcp() bool

func (Number) Listp

func (this Number) Listp() bool

func (Number) Numberp

func (this Number) Numberp() bool

Number is a Sexper

func (Number) String

func (this Number) String() string

func (Number) Stringp

func (this Number) Stringp() bool

type Sexper

type Sexper interface {
	Numberp() bool
	Stringp() bool
	Funcp() bool
	Atomp() bool
	Listp() bool
	String() string
}

func ReadAtom

func ReadAtom(in io.RuneScanner) Sexper

sexp reader

func ReadFrom

func ReadFrom(str string) Sexper

func ReadList

func ReadList(in io.RuneScanner) Sexper

func ReadNumber

func ReadNumber(in io.RuneScanner) Sexper

func ReadSexp

func ReadSexp(in io.RuneScanner) Sexper

func ReadString

func ReadString(in io.RuneScanner) Sexper

type String

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

Atom, List, Sexper

func (String) Atomp

func (this String) Atomp() bool

func (String) Funcp

func (this String) Funcp() bool

func (String) Listp

func (this String) Listp() bool

func (String) Numberp

func (this String) Numberp() bool

String is a Sexper

func (String) String

func (this String) String() string

func (String) Stringp

func (this String) Stringp() bool

Jump to

Keyboard shortcuts

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