Documentation ¶
Index ¶
- Constants
- func IsNil(a Atom) bool
- func IsTrue(a Atom) bool
- func Traverse(a Atom, visitor Visitor) (err error)
- func Walk(a Atom, fn func(Atom) error) error
- type Atom
- func Caaaar(a Atom) (Atom, error)
- func Caaadr(a Atom) (Atom, error)
- func Caaar(a Atom) (Atom, error)
- func Caadar(a Atom) (Atom, error)
- func Caaddr(a Atom) (Atom, error)
- func Caadr(a Atom) (Atom, error)
- func Caar(a Atom) (Atom, error)
- func Cadaar(a Atom) (Atom, error)
- func Cadadr(a Atom) (Atom, error)
- func Cadar(a Atom) (Atom, error)
- func Caddar(a Atom) (Atom, error)
- func Cadddr(a Atom) (Atom, error)
- func Caddr(a Atom) (Atom, error)
- func Cadr(a Atom) (Atom, error)
- func Car(a Atom) (Atom, error)
- func Cdaaar(a Atom) (Atom, error)
- func Cdaadr(a Atom) (Atom, error)
- func Cdaar(a Atom) (Atom, error)
- func Cdadar(a Atom) (Atom, error)
- func Cdaddr(a Atom) (Atom, error)
- func Cdadr(a Atom) (Atom, error)
- func Cdar(a Atom) (Atom, error)
- func Cddaar(a Atom) (Atom, error)
- func Cddadr(a Atom) (Atom, error)
- func Cddar(a Atom) (Atom, error)
- func Cdddar(a Atom) (Atom, error)
- func Cddddr(a Atom) (Atom, error)
- func Cdddr(a Atom) (Atom, error)
- func Cddr(a Atom) (Atom, error)
- func Cdr(a Atom) (Atom, error)
- func Dup(a Atom) Atom
- func List(args ...Atom) Atom
- func Map(list Atom, mapfn MapFunc) (result Atom, err error)
- func Pair(a Atom) (lhs, rhs Atom, err error)
- type Bool
- type Cons
- type Dupper
- type Float
- type Int
- type MapFunc
- type Mapper
- type Numeric
- type String
- type Symbol
- type Vector
- type Visitor
Constants ¶
const ( Quote = Symbol("quote") Quasiquote = Symbol("quasiquote") Unquote = Symbol("unquote") )
Variables ¶
This section is empty.
Functions ¶
func Traverse ¶
Traverse will recursively visit all cons pairs and left and right elements, in order. Traversal ends when a visitor returns a nil visitor for nested elements and all adjacent and upper elements are traversed. If a Vector is encountered, the vector itself is passed to the visitor function followed by its elements (passed to the visitor returned for the Vector).
func Walk ¶
Walk recursively visits all cons pairs in a singly-linked list, calling fn for the car of each cons pair and walking through each cdr it encounters a nil cdr. If a cdr is encountered that is neither a cons pair nor nil, Walk returns an error. If the atom, a, is a Vector, it will call fn for each element of the vector.
Types ¶
type Atom ¶
type Atom interface { // SkimAtom is an empty method -- it exists only to mark a type as an Atom at compile time. SkimAtom() String() string }
Atom defines any value understood to be a member of a skim list, including lists themselves.
type Dupper ¶
Dupper is an interface for cloneable atoms. The Dup method returns a deep clone of an atom. Any atom not implementing this is assumed to be un-clone-able and should be treated as a value (i.e., does not need to be cloned).
type MapFunc ¶
MapFunc is a function used to map an atom to another atom. It may return an error, in which case the caller should assume the result atom is unusable unless documented otherwise for special uses of a specific MapFunc.