Documentation ¶
Overview ¶
Package malarkey implements an interpreter for Mal-arkey, a tiny Lisp.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Env ¶
type Env struct {
// contains filtered or unexported fields
}
Env is a map of symbols to bound values.
type FunctionTCO ¶
type FunctionTCO struct { AST Value Params []Value Env *Env Fn func(args ...Value) Value IsMacro bool }
FunctionTCO is a `fn*`-defined function that can be evaluated in a TCO style.
type Reader ¶
Reader reads tokens.
type Value ¶
type Value struct { Type string Val interface{} }
Value is a mal value with explicit type. Types: * "list" - []Value * "vector" - []Value * "hash-map" - map[string]Value * "symbol" - string * "string" - string * "integer" - int64 * "float" - float64 * "boolean" - bool * "nil" - nil * "atom" - int. atom id (`atoms` idx) hack to dig myself out of non-pointer vals. i liked the bias to immutability * "function" - func(args ...Value) Value * "function-tco" - {
- AST: Value
- Params: Value
- Env: *Env
- Fn: func(args ...Value) Value
- IsMacro bool }