Documentation
¶
Index ¶
- Variables
- func ExpectClass[T Node](ctx context.Context, w *World, v Node) (T, error)
- func ExpectGeneric(c Callable) (*_Generic, error)
- func ExpectInterface[T Node](ctx context.Context, w *World, v Node, class Class) (T, error)
- func ExpectNonReservedSymbol(ctx context.Context, w *World, v Node) (_Symbol, error)
- func Export(name Symbol, value Callable)
- func ExportRange(v Functions)
- func HasValue(node Node) booldeprecated
- func IsNonLocalExists(err error) bool
- 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 NewSymbol(s string) _Symbol
- func SeqEach(ctx context.Context, w *World, list Node, f func(Node) error) error
- func Shift(list Node) (Node, Node, error)
- type ArithmeticError
- type Array
- func (*Array) ClassOf() Class
- func (A *Array) Elt(n int) (Node, error)
- func (A *Array) Equals(_B Node, mode EqlMode) bool
- func (A *Array) FirstAndRest() (Node, Node, bool)
- func (t Array) GoString() string
- func (A *Array) PrintTo(w io.Writer, mode PrintMode) (int, error)
- func (t Array) String() string
- type BigInt
- type BuiltInClass
- func (e *BuiltInClass) ClassOf() Class
- func (e *BuiltInClass) Create() Node
- func (e *BuiltInClass) Equals(_other Node, _ EqlMode) bool
- func (e *BuiltInClass) InheritP(c Class) bool
- func (e *BuiltInClass) InstanceP(n Node) bool
- func (e *BuiltInClass) Name() Symbol
- func (e *BuiltInClass) String() string
- type Callable
- type Class
- type Condition
- type Cons
- func (*Cons) ClassOf() Class
- func (cons *Cons) Equals(n Node, m EqlMode) bool
- func (cons *Cons) Eval(ctx context.Context, w *World) (Node, error)
- func (cons *Cons) FirstAndRest() (Node, Node, bool)
- func (t Cons) GoString() string
- func (cons *Cons) PrintTo(w io.Writer, m PrintMode) (int, error)
- func (t Cons) String() string
- type Constants
- type Continuable
- type ControlError
- type DomainError
- type Dynamics
- type EndOfStream
- type EqlMode
- type ErrorNode
- type Float
- func (f Float) Add(ctx context.Context, w *World, n Node) (Node, error)
- func (Float) ClassOf() Class
- func (f Float) Equals(n Node, m EqlMode) bool
- func (f Float) LessThan(ctx context.Context, w *World, n Node) (bool, error)
- func (f Float) Multi(ctx context.Context, w *World, n Node) (Node, error)
- func (f Float) String() string
- func (f Float) Sub(ctx context.Context, w *World, n Node) (Node, error)
- type FuncScope
- type Function
- type Function0
- type Function1
- type Function2
- type FunctionRef
- type Functions
- type IOFile
- func (t *IOFile) ClassOf() Class
- func (iof *IOFile) Close() error
- func (iof *IOFile) Column() int
- func (t *IOFile) Equals(Node, EqlMode) bool
- func (i *IOFile) FilePosition() (int64, error)
- func (iof *IOFile) IsClosed() bool
- func (i *IOFile) QueryStreamReady() (Node, error)
- func (iof *IOFile) Read(b []byte) (int, error)
- func (iof *IOFile) ReadByte() (byte, error)
- func (iof *IOFile) ReadRune() (rune, int, error)
- func (i *IOFile) SetFilePosition(n int64) (int64, error)
- func (t *IOFile) String() string
- func (iof *IOFile) UnreadRune() error
- func (iof *IOFile) Write(b []byte) (int, error)
- type Integer
- func (i Integer) Add(ctx context.Context, w *World, n Node) (Node, error)
- func (i Integer) ClassOf() Class
- func (i Integer) Equals(n Node, m EqlMode) bool
- func (i Integer) LessThan(ctx context.Context, w *World, n Node) (bool, error)
- func (i Integer) Multi(ctx context.Context, w *World, n Node) (Node, error)
- func (i Integer) String() string
- func (i Integer) Sub(ctx context.Context, w *World, n Node) (Node, error)
- type Keyword
- type LispString
- type ListBuilder
- type Node
- func Assoc(ctx context.Context, w *World, key Node, list Node) (Node, error)
- func ExpectList(ctx context.Context, w *World, arg Node) (Node, error)
- func List(nodes ...Node) Node
- func NReverse(ctx context.Context, w *World, list Node) (Node, error)
- func NewVector(ctx context.Context, w *World, 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)
- func UnevalList(list ...Node) Node
- type Pair
- type ParseError
- type PrintMode
- type ProgramError
- type Reserved
- type Rune
- type Scope
- type SeqBuilder
- type Sequence
- type SimpleError
- type SpecialF
- type StorageExhausted
- type StreamError
- type String
- func (s String) Add(ctx context.Context, w *World, n Node) (Node, error)
- func (String) ClassOf() Class
- func (s String) EachRune(f func(Rune) error) error
- func (s String) Equals(n Node, m EqlMode) bool
- func (s String) FirstAndRest() (Node, Node, bool)
- func (s String) GoString() string
- func (s String) LessThan(ctx context.Context, w *World, n Node) (bool, error)
- func (s String) String() string
- type StringBuilder
- func (S *StringBuilder) Add(ctx context.Context, w *World, n Node) error
- func (*StringBuilder) ClassOf() Class
- func (S *StringBuilder) Close() error
- func (S *StringBuilder) Column() int
- func (t *StringBuilder) Equals(other Node, _ EqlMode) bool
- func (S StringBuilder) GoString() string
- func (t *StringBuilder) RawWriter() io.Writer
- func (S *StringBuilder) Sequence() Node
- func (S *StringBuilder) String() string
- type StringReader
- type Symbol
- type Uneval
- 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) Dynamic(name Symbol) Node
- func (w *World) Errout() io.Writer
- func (w *World) Eval(ctx context.Context, node Node) (Node, error)
- func (w *World) Flet(scope FuncScope) *World
- func (W *World) FuncRange(f func(Symbol, Callable) bool)
- func (w *World) Get(name Symbol) (Node, error)
- func (w *World) GetFunc(name Symbol) (Callable, 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) bool)
- func (w *World) Set(name Symbol, value Node) error
- func (w *World) SetErrout(writer io.Writer)
- func (w *World) SetStdout(writer io.Writer)
- func (w *World) ShiftAndEvalCar(ctx context.Context, list Node) (Node, Node, error)
- func (w *World) Stdin() _Reader
- func (w *World) Stdout() io.Writer
- type Writer
- type WriterStream
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAbort = errors.New("abort") ErrDevisionByZero = errors.New("devision by zeor") ErrExpectedClass = errors.New("expected class") ErrExpectedMacro = errors.New("expected macro") ErrExpectedStream = errors.New("expected stream") ErrExpectedWriter = errors.New("expected writer") ErrInvalidFormat = errors.New("invalid format") ErrNoMatchMethods = errors.New("no match methods") ErrNotSupportType = errors.New("not support type") ErrQuit = errors.New("bye") ErrCanNotParseNumber = parser.ErrCanNotParseNumber ErrTooFewArguments = ProgramError{/* contains filtered or unexported fields */} ErrTooManyArguments = ProgramError{/* contains filtered or unexported fields */} ErrTooShortTokens = parser.ErrTooShortTokens ErrIndexOutOfRange = ProgramError{/* contains filtered or unexported fields */} )
View Source
var BuiltInClassObject = NewAbstractClass[*BuiltInClass]("<built-in-class>")
View Source
var NewLineOnFormat = []byte{'\n'}
View Source
var ObjectClass = &BuiltInClass{ name: NewSymbol("<object>"), instanceP: func(Node) bool { return true }, create: func() Node { return nil }, }
Functions ¶
func ExpectClass ¶ added in v0.7.1
func ExpectGeneric ¶ added in v0.6.0
func ExpectInterface ¶ added in v0.7.1
func ExpectNonReservedSymbol ¶ added in v0.7.10
func ExportRange ¶ added in v0.2.0
func ExportRange(v Functions)
func IsNonLocalExists ¶ added in v0.7.5
func ListToArray ¶
Types ¶
type ArithmeticError ¶ added in v0.7.1
type ArithmeticError struct { Operation FunctionRef Operands Node Class Class }
func (*ArithmeticError) ClassOf ¶ added in v0.7.1
func (e *ArithmeticError) ClassOf() Class
func (*ArithmeticError) Equals ¶ added in v0.7.1
func (e *ArithmeticError) Equals(other Node, mode EqlMode) bool
func (*ArithmeticError) Error ¶ added in v0.7.1
func (e *ArithmeticError) Error() string
func (*ArithmeticError) String ¶ added in v0.7.1
func (e *ArithmeticError) String() string
type Array ¶ added in v0.1.4
type Array struct {
// contains filtered or unexported fields
}
type BuiltInClass ¶ added in v0.7.17
type BuiltInClass struct {
// contains filtered or unexported fields
}
func NewAbstractClass ¶ added in v0.7.17
func NewAbstractClass[T Node](name string, super ...Class) *BuiltInClass
func NewBuiltInClass ¶ added in v0.7.17
func NewBuiltInClass[T Node](name string, super ...Class) *BuiltInClass
func (*BuiltInClass) ClassOf ¶ added in v0.7.17
func (e *BuiltInClass) ClassOf() Class
func (*BuiltInClass) Create ¶ added in v0.7.17
func (e *BuiltInClass) Create() Node
func (*BuiltInClass) Equals ¶ added in v0.7.17
func (e *BuiltInClass) Equals(_other Node, _ EqlMode) bool
func (*BuiltInClass) InheritP ¶ added in v0.7.17
func (e *BuiltInClass) InheritP(c Class) bool
func (*BuiltInClass) InstanceP ¶ added in v0.7.17
func (e *BuiltInClass) InstanceP(n Node) bool
func (*BuiltInClass) Name ¶ added in v0.7.17
func (e *BuiltInClass) Name() Symbol
func (*BuiltInClass) String ¶ added in v0.7.17
func (e *BuiltInClass) String() string
type Continuable ¶ added in v0.7.17
type ControlError ¶ added in v0.7.1
type ControlError struct {
// contains filtered or unexported fields
}
func (ControlError) ClassOf ¶ added in v0.7.1
func (e ControlError) ClassOf() Class
func (ControlError) Error ¶ added in v0.7.1
func (e ControlError) Error() string
func (ControlError) String ¶ added in v0.7.1
func (e ControlError) String() string
func (ControlError) Unwrap ¶ added in v0.7.1
func (e ControlError) Unwrap() error
type DomainError ¶ added in v0.6.0
func (*DomainError) ClassOf ¶ added in v0.6.0
func (e *DomainError) ClassOf() Class
func (*DomainError) Equals ¶ added in v0.6.0
func (e *DomainError) Equals(_other Node, mode EqlMode) bool
func (*DomainError) Error ¶ added in v0.6.0
func (e *DomainError) Error() string
func (*DomainError) String ¶ added in v0.6.0
func (e *DomainError) String() string
type EndOfStream ¶ added in v0.7.2
type EndOfStream struct {
Stream Node
}
func (EndOfStream) ClassOf ¶ added in v0.7.2
func (e EndOfStream) ClassOf() Class
func (EndOfStream) Error ¶ added in v0.7.2
func (e EndOfStream) Error() string
func (EndOfStream) String ¶ added in v0.7.2
func (e EndOfStream) String() string
type Function ¶
type FunctionRef ¶ added in v0.7.0
type FunctionRef struct {
// contains filtered or unexported fields
}
func (FunctionRef) ClassOf ¶ added in v0.7.0
func (f FunctionRef) ClassOf() Class
func (FunctionRef) Equals ¶ added in v0.7.0
func (f FunctionRef) Equals(other Node, mode EqlMode) bool
func (FunctionRef) GoString ¶ added in v0.7.0
func (f FunctionRef) GoString() string
func (FunctionRef) String ¶ added in v0.7.0
func (f FunctionRef) String() string
type IOFile ¶ added in v0.7.6
type IOFile struct {
// contains filtered or unexported fields
}
func (*IOFile) FilePosition ¶ added in v0.7.6
func (*IOFile) QueryStreamReady ¶ added in v0.7.6
func (*IOFile) SetFilePosition ¶ added in v0.7.6
func (*IOFile) UnreadRune ¶ added in v0.7.6
type LispString ¶ added in v0.1.4
type LispString struct { S string // contains filtered or unexported fields }
type ListBuilder ¶
type ListBuilder struct {
// contains filtered or unexported fields
}
func (*ListBuilder) Sequence ¶
func (L *ListBuilder) Sequence() Node
type Node ¶
var Null Node = _NullType{}
var True Node = _TrueType{}
func ExpectList ¶ added in v0.7.16
func UnevalList ¶ added in v0.7.1
type ParseError ¶ added in v0.7.1
type ParseError struct { ExpectedClass Class // contains filtered or unexported fields }
func (*ParseError) ClassOf ¶ added in v0.7.1
func (p *ParseError) ClassOf() Class
func (*ParseError) Error ¶ added in v0.7.1
func (p *ParseError) Error() string
func (*ParseError) String ¶ added in v0.7.1
func (p *ParseError) String() string
type ProgramError ¶ added in v0.7.1
type ProgramError struct {
// contains filtered or unexported fields
}
func (ProgramError) ClassOf ¶ added in v0.7.1
func (e ProgramError) ClassOf() Class
func (ProgramError) Error ¶ added in v0.7.1
func (e ProgramError) Error() string
func (ProgramError) String ¶ added in v0.7.1
func (e ProgramError) String() string
func (ProgramError) Unwrap ¶ added in v0.7.1
func (e ProgramError) Unwrap() error
type Reserved ¶ added in v0.7.10
type Reserved int
func NewReserved ¶ added in v0.7.10
func (Reserved) OriginalString ¶ added in v0.7.10
type SeqBuilder ¶
type SimpleError ¶ added in v0.7.11
type SimpleError struct { FormatString Node FormatArguments Node // contains filtered or unexported fields }
func (*SimpleError) ClassOf ¶ added in v0.7.11
func (s *SimpleError) ClassOf() Class
func (*SimpleError) ContinuableString ¶ added in v0.7.17
func (s *SimpleError) ContinuableString() Node
func (*SimpleError) Equals ¶ added in v0.7.11
func (s *SimpleError) Equals(other Node, m EqlMode) bool
func (*SimpleError) Error ¶ added in v0.7.16
func (s *SimpleError) Error() string
func (*SimpleError) SetContinuableString ¶ added in v0.7.17
func (s *SimpleError) SetContinuableString(cs String)
func (*SimpleError) String ¶ added in v0.7.11
func (s *SimpleError) String() string
type StorageExhausted ¶ added in v0.7.1
type StorageExhausted struct{}
func (StorageExhausted) ClassOf ¶ added in v0.7.1
func (s StorageExhausted) ClassOf() Class
func (StorageExhausted) Equals ¶ added in v0.7.1
func (s StorageExhausted) Equals(n Node, _ EqlMode) bool
func (StorageExhausted) Error ¶ added in v0.7.1
func (s StorageExhausted) Error() string
func (StorageExhausted) String ¶ added in v0.7.1
func (s StorageExhausted) String() string
type StreamError ¶ added in v0.7.2
type StreamError struct {
Stream Node
}
func (StreamError) ClassOf ¶ added in v0.7.2
func (s StreamError) ClassOf() Class
func (StreamError) Error ¶ added in v0.7.2
func (s StreamError) Error() string
func (StreamError) String ¶ added in v0.7.2
func (s StreamError) String() string
type String ¶
type String string
type StringBuilder ¶
func (*StringBuilder) ClassOf ¶ added in v0.6.0
func (*StringBuilder) ClassOf() Class
func (*StringBuilder) Close ¶ added in v0.7.13
func (S *StringBuilder) Close() error
func (*StringBuilder) Column ¶ added in v0.7.6
func (S *StringBuilder) Column() int
func (*StringBuilder) Equals ¶ added in v0.1.4
func (t *StringBuilder) Equals(other Node, _ EqlMode) bool
func (StringBuilder) GoString ¶ added in v0.1.4
func (S StringBuilder) GoString() string
func (*StringBuilder) RawWriter ¶ added in v0.7.17
func (t *StringBuilder) RawWriter() io.Writer
func (*StringBuilder) Sequence ¶ added in v0.1.4
func (S *StringBuilder) Sequence() Node
func (*StringBuilder) String ¶ added in v0.7.6
func (S *StringBuilder) String() string
type StringReader ¶ added in v0.7.6
func (StringReader) ClassOf ¶ added in v0.7.6
func (sr StringReader) ClassOf() Class
func (StringReader) Close ¶ added in v0.7.13
func (sr StringReader) Close() error
func (StringReader) Equals ¶ added in v0.7.6
func (sr StringReader) Equals(other Node, _ EqlMode) bool
func (StringReader) QueryStreamReady ¶ added in v0.7.6
func (sr StringReader) QueryStreamReady() (Node, error)
func (StringReader) String ¶ added in v0.7.6
func (sr StringReader) String() string
type VectorBuilder ¶
type VectorBuilder struct {
// contains filtered or unexported fields
}
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) InterpretBytes ¶
func (*World) InterpretNodes ¶
func (*World) NewDynamics ¶ added in v0.3.1
func (*World) ShiftAndEvalCar ¶
type WriterStream ¶ added in v0.7.17
type WriterStream struct {
// contains filtered or unexported fields
}
func NewWriterStream ¶ added in v0.7.17
func NewWriterStream(w io.Writer) *WriterStream
func (WriterStream) ClassOf ¶ added in v0.7.17
func (WriterStream) ClassOf() Class
func (*WriterStream) Column ¶ added in v0.7.17
func (w *WriterStream) Column() int
func (WriterStream) RawWriter ¶ added in v0.7.17
func (t WriterStream) RawWriter() io.Writer
func (WriterStream) String ¶ added in v0.7.17
func (t WriterStream) String() string
Source Files
¶
- array.go
- atom.go
- builtinclass.go
- class.go
- cmds.go
- cond.go
- cons.go
- convert.go
- error.go
- format.go
- functionref.go
- generic.go
- hash.go
- input-stream.go
- io.go
- iofile.go
- lambda.go
- list.go
- macro.go
- math.go
- misc.go
- number.go
- operator.go
- output-stream.go
- parse.go
- progn.go
- sequence.go
- setq.go
- string-stream.go
- string.go
- symbol.go
- utils.go
- world.go
Click to show internal directories.
Click to hide internal directories.