Documentation ¶
Index ¶
- Variables
- func Export(name Symbol, value Node)
- func ExportRange(v Variables)
- func HasValue(node Node) booldeprecated
- func IsNone(node Node) bool
- func IsNull(node Node) booldeprecated
- func IsSome(node Node) bool
- func ListToArray(list Node, slice []Node) error
- func MakeError(e error, s any) error
- func MapCar(ctx context.Context, w *World, funcNode Node, sourceSet []Node, ...) error
- func SeqEach(list Node, f func(Node) error) error
- func Shift(list Node) (Node, Node, error)
- type Array
- type Callable
- type CanKnowLastOutput
- type Cons
- type Dynamics
- type EqlMode
- type ErrEarlyReturns
- type ErrThrown
- type ErrorNode
- type Float
- func (f Float) Add(n Node) (Node, error)
- func (f Float) Divide(n Node) (Node, error)
- func (f Float) Equals(n Node, m EqlMode) bool
- func (f Float) Eval(context.Context, *World) (Node, error)
- func (t Float) GoString() string
- func (f Float) LessThan(n Node) (bool, error)
- func (f Float) Multi(n Node) (Node, error)
- func (f Float) PrintTo(w io.Writer, m PrintMode) (int, error)
- func (t Float) String() string
- func (f Float) Sub(n Node) (Node, error)
- type Function
- func (f *Function) Call(ctx context.Context, w *World, list Node) (Node, error)
- func (f *Function) Equals(n Node, m EqlMode) bool
- func (f *Function) Eval(context.Context, *World) (Node, error)
- func (t Function) GoString() string
- func (*Function) PrintTo(w io.Writer, m PrintMode) (int, error)
- func (t Function) String() string
- type Integer
- func (i Integer) Add(n Node) (Node, error)
- func (i Integer) Divide(n Node) (Node, error)
- func (i Integer) Equals(n Node, m EqlMode) bool
- func (i Integer) Eval(context.Context, *World) (Node, error)
- func (t Integer) GoString() string
- func (i Integer) LessThan(n Node) (bool, error)
- func (i Integer) Multi(n Node) (Node, error)
- func (i Integer) PrintTo(w io.Writer, m PrintMode) (int, error)
- func (t Integer) String() string
- func (i Integer) Sub(n Node) (Node, error)
- type Keyword
- type LispString
- func (L *LispString) Call(ctx context.Context, w *World, n Node) (Node, error)
- func (L *LispString) Equals(_other Node, m EqlMode) bool
- func (L *LispString) Eval(ctx context.Context, w *World) (Node, error)
- func (t LispString) GoString() string
- func (L *LispString) PrintTo(w io.Writer, m PrintMode) (int, error)
- func (t LispString) String() string
- type ListBuilder
- type Node
- func Assoc(key Node, list Node) (Node, error)
- func List(nodes ...Node) Node
- func NReverse(list Node) (Node, error)
- func NewVector(args ...Node) Node
- func Progn(ctx context.Context, w *World, n Node) (value Node, err error)
- func ReadAll(rs io.RuneScanner) ([]Node, error)
- func ReadNode(rs io.RuneScanner) (Node, error)
- func Reverse(list Node) (Node, error)
- type Pair
- type PrintMode
- type Rune
- func (r Rune) Add(n Node) (Node, error)
- func (r Rune) Equals(n Node, m EqlMode) bool
- func (r Rune) Eval(_ context.Context, w *World) (Node, error)
- func (t Rune) GoString() string
- func (r Rune) PrintTo(w io.Writer, m PrintMode) (int, error)
- func (t Rune) String() string
- func (r Rune) Sub(n Node) (Node, error)
- type Scope
- type SeqBuilder
- type Sequence
- type SpecialF
- func (f SpecialF) Call(ctx context.Context, w *World, n Node) (Node, error)
- func (f SpecialF) Equals(n Node, m EqlMode) bool
- func (f SpecialF) Eval(context.Context, *World) (Node, error)
- func (t SpecialF) GoString() string
- func (SpecialF) PrintTo(w io.Writer, m PrintMode) (int, error)
- func (t SpecialF) String() string
- type String
- func (s String) Add(n Node) (Node, error)
- func (s String) EachRune(f func(Rune) error) error
- func (s String) Equals(n Node, m EqlMode) bool
- func (s String) Eval(context.Context, *World) (Node, error)
- func (s String) FirstAndRest() (Node, Node, bool)
- func (s String) GoString() string
- func (s String) LessThan(n Node) (bool, error)
- func (s String) PrintTo(w io.Writer, m PrintMode) (int, error)
- func (s String) String() string
- type StringBuilder
- func (S *StringBuilder) Add(n Node) error
- func (t *StringBuilder) Equals(Node, EqlMode) bool
- func (t *StringBuilder) Eval(context.Context, *World) (Node, error)
- func (S StringBuilder) GoString() string
- func (t *StringBuilder) PrintTo(w io.Writer, m PrintMode) (int, error)
- func (S *StringBuilder) Sequence() Node
- type Symbol
- type Variables
- type VectorBuilder
- type World
- func (w *World) Assert(equation string, expect Node) string
- func (w *World) DefineGlobal(name Symbol, value Node)
- func (w *World) DefineVariable(name Symbol, getter func() Node)
- func (w *World) Dynamic(name Symbol) Node
- func (w *World) Errout() io.Writer
- func (w *World) Get(name Symbol) (Node, error)
- func (w *World) Interpret(ctx context.Context, code string) (Node, error)
- func (w *World) InterpretBytes(ctx context.Context, code []byte) (Node, error)
- func (w *World) InterpretNodes(ctx context.Context, ns []Node) (Node, error)
- func (w *World) Let(scope Scope) *World
- func (w *World) NewDynamics() *Dynamics
- func (w *World) Range(f func(Symbol, Node) error) error
- func (w *World) Set(name Symbol, value Node) error
- func (w *World) SetErrout(writer io.Writer)
- func (w *World) SetOrDefineParameter(name Symbol, value Node)
- func (w *World) SetStdout(writer io.Writer)
- func (w *World) ShiftAndEvalCar(ctx context.Context, list Node) (Node, Node, error)
- func (w *World) Stdin() *_ReaderNode
- func (w *World) Stdout() io.Writer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDevisionByZero = errors.New("devision by zeor") ErrExpectedCharacter = errors.New("expected character") ErrExpectedCons = errors.New("expected CONS") ErrExpectedFunction = errors.New("expected function") ErrExpectedNumber = errors.New("expected number") ErrExpectedReader = errors.New("expected Reader") ErrExpectedSequence = errors.New("expected Sequence") ErrExpectedString = errors.New("expected string") ErrExpectedSymbol = errors.New("expected symbol") ErrExpectedSymbolOrList = errors.New("expected symbol or list") ErrExpectedKeyword = errors.New("expected keyword") ErrExpectedWriter = errors.New("expected Writer") ErrIndexOutOfRange = errors.New("index out of range") ErrInvalidFormat = errors.New("invalid format") ErrNotSupportType = errors.New("not support type") ErrQuit = errors.New("bye") ErrAbort = errors.New("abort") ErrVariableUnbound = errors.New("unbound variable") ErrExpectedArray = errors.New("expected array") ErrExpectedMacro = errors.New("expected macro") ErrTooFewArguments = parser.ErrTooFewArguments ErrTooManyArguments = parser.ErrTooManyArguments ErrCanNotParseNumber = parser.ErrCanNotParseNumber ErrTooShortTokens = parser.ErrTooShortTokens )
View Source
var ErrExpectedHash = errors.New("expected Hash-table")
View Source
var UseStrict = true
Functions ¶
func ExportRange ¶ added in v0.2.0
func ExportRange(v Variables)
func ListToArray ¶
Types ¶
type Array ¶ added in v0.1.4
type Array struct {
// contains filtered or unexported fields
}
type CanKnowLastOutput ¶ added in v0.2.1
type CanKnowLastOutput interface {
IsLastOutputLf() bool
}
type ErrEarlyReturns ¶
func (*ErrEarlyReturns) Error ¶
func (e *ErrEarlyReturns) Error() string
type Function ¶
type Function struct { C int F func(context.Context, *World, []Node) (Node, error) Min int Max int }
type LispString ¶ added in v0.1.4
type LispString struct { S string // contains filtered or unexported fields }
func (*LispString) Equals ¶ added in v0.1.4
func (L *LispString) Equals(_other Node, m EqlMode) bool
func (LispString) GoString ¶ added in v0.1.4
func (t LispString) GoString() string
func (LispString) String ¶ added in v0.1.4
func (t LispString) String() string
type ListBuilder ¶
type ListBuilder struct {
// contains filtered or unexported fields
}
func (*ListBuilder) Add ¶
func (L *ListBuilder) Add(n Node) error
func (*ListBuilder) Sequence ¶
func (L *ListBuilder) Sequence() Node
type Node ¶
type Node interface { Eval(context.Context, *World) (Node, error) Equals(Node, EqlMode) bool PrintTo(io.Writer, PrintMode) (int, error) String() string GoString() string }
var Null Node = _NullType{}
var True Node = _TrueType{}
type SeqBuilder ¶
type StringBuilder ¶
func (*StringBuilder) Add ¶ added in v0.1.4
func (S *StringBuilder) Add(n Node) error
func (StringBuilder) GoString ¶ added in v0.1.4
func (S StringBuilder) GoString() string
func (*StringBuilder) Sequence ¶ added in v0.1.4
func (S *StringBuilder) Sequence() Node
type VectorBuilder ¶
type VectorBuilder struct {
// contains filtered or unexported fields
}
func (*VectorBuilder) Add ¶
func (v *VectorBuilder) Add(value Node) error
func (*VectorBuilder) Sequence ¶
func (v *VectorBuilder) Sequence() Node
type World ¶
type World struct {
// contains filtered or unexported fields
}
func (*World) DefineGlobal ¶
DefineGlobal implements (defglobal) of ISLisp or (defparameter) of CommonLisp.
func (*World) DefineVariable ¶
func (*World) InterpretBytes ¶
func (*World) InterpretNodes ¶
func (*World) NewDynamics ¶ added in v0.3.1
func (*World) SetOrDefineParameter ¶
func (*World) ShiftAndEvalCar ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.