Documentation ¶
Overview ¶
Package slurp provides Interpreter that composes builtin implementations of Env, Analyzer and Reader that supports a working LISP dialect.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrParseSpecial = errors.New("invalid special form")
ErrParseSpecial is returned when parsing a special form invocation fails due to malformed syntax.
Functions ¶
Types ¶
type Interpreter ¶ added in v0.2.0
type Interpreter struct {
// contains filtered or unexported fields
}
Interpreter represents a Slurp interpreter session.
func (*Interpreter) Bind ¶ added in v0.2.0
func (ins *Interpreter) Bind(vals map[string]core.Any) error
Bind can be used to set global bindings that will be available while executing forms.
type Option ¶
type Option func(ins *Interpreter)
Option values can be used with New() to customise slurp instance during initialisation.
func WithAnalyzer ¶
WithAnalyzer sets the analyzer to be used by the slurp instance for syntax analysis and macro expansions. If nil, uses builtin analyzer with standard special forms.
Directories ¶
Path | Synopsis |
---|---|
Package builtin provides builtin value types and implementations of different Slurp core interfaces (e.g., Analyzer, Exprs etc.)
|
Package builtin provides builtin value types and implementations of different Slurp core interfaces (e.g., Analyzer, Exprs etc.) |
Package core defines the core contracts of slurp.
|
Package core defines the core contracts of slurp. |
examples
|
|
conj
Package main builds on `simple` to demonstrate a naive implementation of Clojure's conj.
|
Package main builds on `simple` to demonstrate a naive implementation of Clojure's conj. |
Package reader implements a highly customizable and generic reader, reader-macros for primitive runtime types and reader-macro factories for collection types like vector, map, set.
|
Package reader implements a highly customizable and generic reader, reader-macros for primitive runtime types and reader-macro factories for collection types like vector, map, set. |
Package repl provides facilities to build an interactive REPL using slurp.
|
Package repl provides facilities to build an interactive REPL using slurp. |
Click to show internal directories.
Click to hide internal directories.