Documentation
¶
Index ¶
- Variables
- func ExpectClass[T Node](ctx context.Context, w *World, v Node) (T, error)
- func ExpectGeneric(c Callable) (*genericType, 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 IsNone(node Node) bool
- 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 ArithmeticErrorInterface
- type Array
- func (a *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
- func (b BigInt) ClassOf() Class
- func (b BigInt) Equals(n Node, m EqlMode) bool
- func (b BigInt) LessThan(ctx context.Context, w *World, other Node) (bool, error)
- func (b BigInt) Multi(ctx context.Context, w *World, other Node) (Node, error)
- func (b BigInt) Sub(ctx context.Context, w *World, other Node) (Node, error)
- 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
- func (e *BuiltInClass) Supers() []Class
- type Callable
- type Class
- type Condition
- type Cons
- func (*Cons) ClassOf() Class
- func (cons *Cons) Elt(n int) (Node, error)
- 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 ControlFlow
- type DivisionByZero
- type DomainError
- 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 FloatingPointOverflow
- type FloatingPointUnderflow
- 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 (iof *IOFile) ElementClass() int64
- 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 Node
- 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)
- type Pair
- type ParseError
- type PrintMode
- type ProgramError
- type Reserved
- type Rune
- type Scope
- type Sequence
- type SimpleError
- type SpecialF
- type SpecialN
- 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) Elt(n int) (Node, 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 Symbol
- type Variables
- 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) 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 ( ErrExpectedClass = errors.New("expected class") ErrInvalidFormat = errors.New("invalid format") ErrNoMatchMethods = errors.New("no match methods") ErrNotSupportType = errors.New("not support type") ErrTooFewArguments = ProgramError{/* contains filtered or unexported fields */} ErrTooManyArguments = ProgramError{/* contains filtered or unexported fields */} ErrTooShortTokens = parser.ErrTooShortTokens ErrIndexOutOfRange = ProgramError{/* contains filtered or unexported fields */} ErrDotEnditList = ProgramError{/* contains filtered or unexported fields */} )
View Source
var BuiltInClassObject = NewAbstractClass[*BuiltInClass]("<built-in-class>")
View Source
var ExhaustThreshold int64 = 123456789
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 ListToArray ¶
Types ¶
type ArithmeticError ¶ added in v0.7.1
type ArithmeticError struct {
Operation FunctionRef
Operands Node
}
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) GetOperands ¶ added in v0.7.19
func (A *ArithmeticError) GetOperands() Node
func (*ArithmeticError) GetOperation ¶ added in v0.7.19
func (A *ArithmeticError) GetOperation() FunctionRef
func (*ArithmeticError) String ¶ added in v0.7.1
func (e *ArithmeticError) String() string
type ArithmeticErrorInterface ¶ added in v0.7.19
type ArithmeticErrorInterface interface {
GetOperation() FunctionRef
GetOperands() Node
Node
}
type Array ¶ added in v0.1.4
type Array struct {
// contains filtered or unexported fields
}
type BigInt ¶ added in v0.7.1
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
func (*BuiltInClass) Supers ¶ added in v0.7.20
func (e *BuiltInClass) Supers() []Class
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 ControlFlow ¶ added in v0.7.23
type ControlFlow interface {
IsControlFlow()
}
type DivisionByZero ¶ added in v0.7.19
type DivisionByZero struct {
ArithmeticError
}
func (*DivisionByZero) ClassOf ¶ added in v0.7.19
func (d *DivisionByZero) ClassOf() Class
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 FloatingPointOverflow ¶ added in v0.7.19
type FloatingPointOverflow struct {
ArithmeticError
}
func (*FloatingPointOverflow) ClassOf ¶ added in v0.7.19
func (f *FloatingPointOverflow) ClassOf() Class
type FloatingPointUnderflow ¶ added in v0.7.19
type FloatingPointUnderflow struct {
ArithmeticError
}
func (*FloatingPointUnderflow) ClassOf ¶ added in v0.7.19
func (f *FloatingPointUnderflow) ClassOf() Class
type Function ¶
type Function struct {
C int
F func(context.Context, *World, []Node) (Node, error)
Min int
Max int
}
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) ElementClass ¶ added in v0.7.22
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 Node ¶
var Null Node = nullType{}
var True Node = trueType{}
func ExpectList ¶ added in v0.7.16
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 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 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) 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
- autoload.go
- bigint.go
- builtinclass.go
- class.go
- cmds.go
- cond.go
- cons.go
- convert.go
- core.go
- error.go
- float.go
- format.go
- functionref.go
- generic.go
- input-stream.go
- integer.go
- io.go
- iofile.go
- lambda.go
- lazyform.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-reader.go
- string-writer.go
- string.go
- symbol.go
- utils.go
- world.go
Click to show internal directories.
Click to hide internal directories.
