Documentation
¶
Overview ¶
Package slip is an implementation of a LISP environment.
Index ¶
- Constants
- Variables
- func AddClassHook(id string, fun func(p *Package, key string))
- func AddDefunHook(id string, fun func(p *Package, key string))
- func AddPackage(pkg *Package)
- func AddSetHook(id string, fun func(p *Package, key string))
- func AddUnsetHook(id string, fun func(p *Package, key string))
- func Append(b []byte, obj Object) []byte
- func AppendDoc(b []byte, text string, indent, right int, ansi bool, firstIndent ...int) []byte
- func ArithmeticPanic(s *Scope, depth int, operation Object, operands List, format string, ...)
- func ByteFromReader(r io.Reader) (b byte, err error)
- func CellPanic(s *Scope, depth int, name Object, format string, args ...any)
- func CheckArgCount(s *Scope, depth int, obj Object, args List, mn, mx int)
- func CheckSendArgCount(s *Scope, depth int, self Instance, method string, args List, mn, mx int)
- func ClassNotFoundPanic(s *Scope, depth int, name Object, format string, args ...any)
- func ControlPanic(s *Scope, depth int, format string, args ...any)
- func Define(creator func(args List) Object, doc *FuncDoc, pkgs ...*Package)
- func DescribeVar(sym Symbol) string
- func DivisionByZeroPanic(s *Scope, depth int, operation Object, operands List, format string, ...)
- func EndOfFilePanic(s *Scope, depth int, stream Stream, format string, args ...any)
- func ErrorPanic(s *Scope, depth int, format string, args ...any)
- func FilePanic(s *Scope, depth int, pathname Object, format string, args ...any)
- func HasVar(sym Symbol) bool
- func InvalidMethodPanic(s *Scope, depth int, class, qualifier, name Object, format string, args ...any)
- func IsNil(v any) bool
- func LessThan(v0, v1 Object) bool
- func MethodArgChoicePanic(s *Scope, depth int, inst Instance, method string, cnt int, choices string)
- func MethodArgCountCheck(s *Scope, depth int, inst Instance, method string, cnt, mn, mx int)
- func MethodArgCountPanic(s *Scope, depth int, inst Instance, method string, cnt, mn, mx int)
- func MustBeString(arg Object, name string) (str string)
- func NewMarker(b byte) marker
- func NoApplicableMethodPanic(s *Scope, depth int, gf Object, fargs List, format string, args ...any)
- func ObjectAppend(b []byte, obj Object) []byte
- func ObjectEqual(x, y Object) (eq bool)
- func ObjectString(obj Object) string
- func PackagePanic(s *Scope, depth int, pkg *Package, format string, args ...any)
- func PanicSeriousCondition()
- func ParsePanic(s *Scope, depth int, format string, args ...any)
- func PrintNotReadablePanic(s *Scope, depth int, object Object, format string, args ...any)
- func ProgramPanic(s *Scope, depth int, format string, args ...any)
- func ReadStreamEach(r io.Reader, s *Scope, caller Caller)
- func ReadStreamPush(r io.Reader, s *Scope, channel chan Object)
- func ReaderPanic(s *Scope, depth int, stream Stream, format string, args ...any)
- func RegisterClass(name string, c Class)
- func RemoveClassHook(id string)
- func RemoveDefunHook(id string)
- func RemovePackage(pkg *Package)
- func RemoveSetHook(id string)
- func RemoveUnsetHook(id string)
- func RemoveVar(sym Symbol)
- func RuneFromReader(reader io.Reader) (r rune, size int, err error)
- func SetVar(sym Symbol, value Object)
- func Simplify(obj Object) any
- func StreamPanic(s *Scope, depth int, stream Stream, format string, args ...any)
- func TypePanic(s *Scope, depth int, use string, value Object, wants ...string)
- func UnboundSlotPanic(s *Scope, depth int, instance Object, name Object, format string, args ...any)
- func UnboundVariablePanic(s *Scope, depth int, name Object, format string, args ...any)
- func UndefinedFunctionPanic(s *Scope, depth int, name Object, format string, args ...any)
- func Untrace(args List)
- func Warn(format string, args ...any)
- func Write(obj Object)
- type App
- type AppArg
- type Array
- func (obj *Array) Adjust(dimensions []int, elementType Symbol, initElement Object, initContent List) *Array
- func (obj *Array) Adjustable() bool
- func (obj *Array) Append(b []byte) []byte
- func (obj *Array) ArrayType() Symbol
- func (obj *Array) AsList() (list List)
- func (obj *Array) Dimensions() []int
- func (obj *Array) ElementType() Symbol
- func (obj *Array) Elements() []Object
- func (obj *Array) Equal(other Object) (eq bool)
- func (obj *Array) Eval(s *Scope, depth int) Object
- func (obj *Array) Get(indexes ...int) Object
- func (obj *Array) Hierarchy() []Symbol
- func (obj *Array) Length() int
- func (obj *Array) LoadForm() Object
- func (obj *Array) MajorGet(index int) Object
- func (obj *Array) MajorIndex(indexes ...int) int
- func (obj *Array) MajorSet(index int, value Object)
- func (obj *Array) Rank() int
- func (obj *Array) Set(value Object, indexes ...int)
- func (obj *Array) SetAll(all List)
- func (obj *Array) SetElementType(ts Object)
- func (obj *Array) Simplify() any
- func (obj *Array) String() string
- type ArrayLike
- type Bignum
- func (obj *Bignum) Append(b []byte) []byte
- func (obj *Bignum) Equal(other Object) (eq bool)
- func (obj *Bignum) Eval(s *Scope, depth int) Object
- func (obj *Bignum) Hierarchy() []Symbol
- func (obj *Bignum) Int64() int64
- func (obj *Bignum) IntegerType() Symbol
- func (obj *Bignum) IsInt64() bool
- func (obj *Bignum) LoadForm() Object
- func (obj *Bignum) NumberType() Symbol
- func (obj *Bignum) RationalType() Symbol
- func (obj *Bignum) Readably(b []byte, p *Printer) []byte
- func (obj *Bignum) RealType() Symbol
- func (obj *Bignum) RealValue() float64
- func (obj *Bignum) Simplify() any
- func (obj *Bignum) String() string
- type Bit
- func (obj Bit) Append(b []byte) []byte
- func (obj Bit) Equal(other Object) (eq bool)
- func (obj Bit) Eval(s *Scope, depth int) Object
- func (obj Bit) Hierarchy() []Symbol
- func (obj Bit) Int64() (i int64)
- func (obj Bit) IntegerType() Symbol
- func (obj Bit) IsInt64() bool
- func (obj Bit) LoadForm() Object
- func (obj Bit) NumberType() Symbol
- func (obj Bit) RationalType() Symbol
- func (obj Bit) RealType() Symbol
- func (obj Bit) RealValue() float64
- func (obj Bit) Simplify() any
- func (obj Bit) String() string
- type BitVector
- func (obj *BitVector) Adjust(dims []int, eType Symbol, initVal Object, initContent List, fillPtr int) VectorLike
- func (obj *BitVector) Adjustable() bool
- func (obj *BitVector) Append(b []byte) []byte
- func (obj *BitVector) ArrayType() Symbol
- func (obj *BitVector) AsBignum() *Bignum
- func (obj *BitVector) AsFixnum() (Fixnum, bool)
- func (obj *BitVector) AsList() List
- func (obj *BitVector) At(pos uint) bool
- func (obj *BitVector) Dimensions() []int
- func (obj *BitVector) Duplicate() *BitVector
- func (obj *BitVector) ElementType() Symbol
- func (obj *BitVector) Equal(other Object) (eq bool)
- func (obj *BitVector) Eval(s *Scope, depth int) Object
- func (obj *BitVector) FillPointer() int
- func (obj *BitVector) Get(indexes ...int) Object
- func (obj *BitVector) Grow(cnt int)
- func (obj *BitVector) Hierarchy() []Symbol
- func (obj *BitVector) Length() int
- func (obj *BitVector) LoadForm() Object
- func (obj *BitVector) MajorGet(index int) Object
- func (obj *BitVector) MajorIndex(indexes ...int) int
- func (obj *BitVector) MajorSet(index int, value Object)
- func (obj *BitVector) Pop() (element Object)
- func (obj *BitVector) Push(values ...Object) (index int)
- func (obj *BitVector) Put(pos uint, value bool)
- func (obj *BitVector) Rank() int
- func (obj *BitVector) Reverse()
- func (obj *BitVector) SequenceType() Symbol
- func (obj *BitVector) Set(value Object, indexes ...int)
- func (obj *BitVector) SetElementType(ts Object)
- func (obj *BitVector) SetFillPointer(fp int)
- func (obj *BitVector) Simplify() any
- func (obj *BitVector) String() string
- type BoundCaller
- type Byte
- type Caller
- type Character
- func (obj Character) Append(b []byte) []byte
- func (obj Character) Equal(other Object) bool
- func (obj Character) Eval(s *Scope, depth int) Object
- func (obj Character) Hierarchy() []Symbol
- func (obj Character) LoadForm() Object
- func (obj Character) Readably(b []byte, p *Printer) []byte
- func (obj Character) Simplify() any
- func (obj Character) String() string
- type Class
- type Code
- type Combination
- type Complex
- func (obj Complex) Append(b []byte) []byte
- func (obj Complex) Equal(other Object) (eq bool)
- func (obj Complex) Eval(s *Scope, depth int) Object
- func (obj Complex) Hierarchy() []Symbol
- func (obj Complex) LoadForm() Object
- func (obj Complex) NumberType() Symbol
- func (obj Complex) Simplify() any
- func (obj Complex) String() string
- type Describer
- type DocArg
- type DoubleFloat
- func (obj DoubleFloat) Append(b []byte) []byte
- func (obj DoubleFloat) Equal(other Object) (eq bool)
- func (obj DoubleFloat) Eval(s *Scope, depth int) Object
- func (obj DoubleFloat) FloatType() Symbol
- func (obj DoubleFloat) Hierarchy() []Symbol
- func (obj DoubleFloat) LoadForm() Object
- func (obj DoubleFloat) NumberType() Symbol
- func (obj DoubleFloat) Readably(b []byte, p *Printer) []byte
- func (obj DoubleFloat) RealType() Symbol
- func (obj DoubleFloat) RealValue() float64
- func (obj DoubleFloat) Simplify() any
- func (obj DoubleFloat) String() string
- type Dynamic
- type FileStream
- func (obj *FileStream) Append(b []byte) []byte
- func (obj *FileStream) Close() error
- func (obj *FileStream) Equal(other Object) bool
- func (obj *FileStream) Eval(s *Scope, depth int) Object
- func (obj *FileStream) FileLength() (length Object)
- func (obj *FileStream) Hierarchy() []Symbol
- func (obj *FileStream) IsOpen() bool
- func (obj *FileStream) LastByte() byte
- func (obj *FileStream) Read(b []byte) (int, error)
- func (obj *FileStream) ReadByte() (b byte, err error)
- func (obj *FileStream) ReadRune() (r rune, size int, err error)
- func (obj *FileStream) Seek(offset int64, whence int) (n int64, err error)
- func (obj *FileStream) Simplify() any
- func (obj *FileStream) StreamType() Symbol
- func (obj *FileStream) String() string
- func (obj *FileStream) UnreadRune() error
- func (obj *FileStream) Write(b []byte) (int, error)
- type FillPtrVector
- type Fixnum
- func (obj Fixnum) Append(b []byte) []byte
- func (obj Fixnum) Equal(other Object) (eq bool)
- func (obj Fixnum) Eval(s *Scope, depth int) Object
- func (obj Fixnum) Hierarchy() []Symbol
- func (obj Fixnum) Int64() int64
- func (obj Fixnum) IntegerType() Symbol
- func (obj Fixnum) IsInt64() bool
- func (obj Fixnum) LoadForm() Object
- func (obj Fixnum) NumberType() Symbol
- func (obj Fixnum) RationalType() Symbol
- func (obj Fixnum) Readably(b []byte, p *Printer) []byte
- func (obj Fixnum) RealType() Symbol
- func (obj Fixnum) RealValue() float64
- func (obj Fixnum) Simplify() any
- func (obj Fixnum) String() string
- type Float
- type FuncDoc
- type FuncInfo
- func (obj *FuncInfo) Append(b []byte) []byte
- func (obj *FuncInfo) Apply(s *Scope, args List, depth int) (result Object)
- func (obj *FuncInfo) Describe(b []byte, indent, right int, ansi bool) []byte
- func (obj *FuncInfo) Equal(other Object) (eq bool)
- func (obj *FuncInfo) Eval(s *Scope, depth int) Object
- func (obj *FuncInfo) FuncDocs() *FuncDoc
- func (obj *FuncInfo) Hierarchy() []Symbol
- func (obj *FuncInfo) LoadForm() Object
- func (obj *FuncInfo) Simplify() any
- func (obj *FuncInfo) String() string
- type Function
- func (f *Function) Append(b []byte) []byte
- func (f *Function) Apply(s *Scope, args List, depth int) (result Object)
- func (f *Function) Caller() Caller
- func (f *Function) CompileArgs()
- func (f *Function) Equal(other Object) bool
- func (f *Function) Eval(s *Scope, depth int) (result Object)
- func (f *Function) GetArgs() List
- func (f *Function) GetName() string
- func (f *Function) GetPkg() *Package
- func (f *Function) Hierarchy() []Symbol
- func (f *Function) LoadForm() Object
- func (f *Function) Simplify() any
- func (f *Function) SkipArgEval(i int) (skip bool)
- func (f *Function) String() string
- type Funky
- type HasFuncDocs
- type HashTable
- func (obj HashTable) Append(b []byte) []byte
- func (obj HashTable) Equal(other Object) (eq bool)
- func (obj HashTable) Eval(s *Scope, depth int) Object
- func (obj HashTable) Hierarchy() []Symbol
- func (obj HashTable) Length() int
- func (obj HashTable) LoadForm() Object
- func (obj HashTable) Simplify() any
- func (obj HashTable) String() string
- type IOStream
- func (obj *IOStream) Append(b []byte) []byte
- func (obj *IOStream) Close() (err error)
- func (obj *IOStream) Equal(other Object) bool
- func (obj *IOStream) Eval(s *Scope, depth int) Object
- func (obj *IOStream) Hierarchy() []Symbol
- func (obj *IOStream) IsOpen() bool
- func (obj *IOStream) LastByte() byte
- func (obj *IOStream) Read(b []byte) (cnt int, err error)
- func (obj *IOStream) Simplify() any
- func (obj *IOStream) StreamType() Symbol
- func (obj *IOStream) String() string
- func (obj *IOStream) Write(b []byte) (int, error)
- type Import
- type InputStream
- func (obj *InputStream) Append(b []byte) []byte
- func (obj *InputStream) Equal(other Object) bool
- func (obj *InputStream) Eval(s *Scope, depth int) Object
- func (obj *InputStream) Hierarchy() []Symbol
- func (obj *InputStream) Simplify() any
- func (obj *InputStream) StreamType() Symbol
- func (obj *InputStream) String() string
- type Instance
- type Integer
- type Lambda
- func (lam *Lambda) Append(b []byte) []byte
- func (lam *Lambda) BoundCall(s *Scope, depth int) (result Object)
- func (lam *Lambda) Call(s *Scope, args List, depth int) (result Object)
- func (lam *Lambda) Compile(s *Scope, extraVars ...string)
- func (lam *Lambda) Docs() (docs string)
- func (lam *Lambda) Equal(other Object) bool
- func (lam *Lambda) Eval(s *Scope, depth int) (result Object)
- func (lam *Lambda) Hierarchy() []Symbol
- func (lam *Lambda) LoadForm() Object
- func (lam *Lambda) Simplify() any
- func (lam *Lambda) String() string
- type LastBytePeeker
- type List
- func (obj List) Append(b []byte) []byte
- func (obj List) Car() (car Object)
- func (obj List) Cdr() (cdr Object)
- func (obj List) Equal(other Object) (eq bool)
- func (obj List) Eval(s *Scope, depth int) Object
- func (obj List) Hierarchy() []Symbol
- func (obj List) Length() int
- func (obj List) LoadForm() Object
- func (obj List) SequenceType() Symbol
- func (obj List) Simplify() any
- func (obj List) String() string
- type LoadFormer
- type Locker
- type LongFloat
- func (obj *LongFloat) Append(b []byte) []byte
- func (obj *LongFloat) Equal(other Object) (eq bool)
- func (obj *LongFloat) Eval(s *Scope, depth int) Object
- func (obj *LongFloat) FloatType() Symbol
- func (obj *LongFloat) Hierarchy() []Symbol
- func (obj *LongFloat) LoadForm() Object
- func (obj *LongFloat) NumberType() Symbol
- func (obj *LongFloat) Readably(b []byte, p *Printer) []byte
- func (obj *LongFloat) RealType() Symbol
- func (obj *LongFloat) RealValue() float64
- func (obj *LongFloat) Simplify() any
- func (obj *LongFloat) String() string
- type Method
- func (m *Method) Append(b []byte) []byte
- func (m *Method) BoundCall(s *Scope, depth int) Object
- func (m *Method) BoundInnerCall(s *Scope, depth int) (result Object)
- func (m *Method) Call(s *Scope, args List, depth int) Object
- func (m *Method) CompareArgs(fd *FuncDoc)
- func (m *Method) Equal(other Object) (eq bool)
- func (m *Method) Eval(s *Scope, depth int) Object
- func (m *Method) HasMethodFromClass(from string) bool
- func (m *Method) Hierarchy() []Symbol
- func (m *Method) InnerCall(s *Scope, args List, depth int) (result Object)
- func (m *Method) Simplify() any
- func (m *Method) String() string
- type NoOpLocker
- type Number
- type Object
- func ArithmeticErrorNew(s *Scope, depth int, operation Object, operands List, format string, ...) Object
- func CellErrorNew(s *Scope, depth int, name Object, format string, args ...any) Object
- func ClassNotFoundNew(s *Scope, depth int, name Object, format string, args ...any) Object
- func Coerce(object, typeSpec Object) (result Object)
- func CoerceToList(arg Object) (result Object)
- func CoerceToOctets(arg Object) (result Object)
- func CoerceToString(arg Object) (result Object)
- func CoerceToVector(arg Object, mods ...Object) (result Object)
- func Compile(src []byte, s *Scope) (result Object)
- func CompileList(list List) (f Object)
- func CompileString(src string, s *Scope) Object
- func ControlErrorNew(s *Scope, depth int, format string, args ...any) Object
- func DefaultPreSet(p *Package, name string, value Object) (string, Object)
- func DivisionByZeroNew(s *Scope, depth int, operation Object, operands List, format string, ...) Object
- func EndOfFileNew(s *Scope, depth int, stream Stream, format string, args ...any) Object
- func ErrorNew(s *Scope, depth int, format string, args ...any) Object
- func EvalArg(s *Scope, args List, index, depth int) (v Object)
- func FileErrorNew(s *Scope, depth int, pathname Object, format string, args ...any) Object
- func GetArgsKeyValue(args List, key Symbol) (value Object, has bool)
- func GetVar(sym Symbol) (Object, bool)
- func InvalidMethodErrorNew(s *Scope, depth int, class, qualifier, name Object, format string, args ...any) Object
- func ListToFunc(s *Scope, list List, depth int) Object
- func NewCondition(report Object) Object
- func NewSeriousCondition() Object
- func NewWarning(format string, args ...any) Object
- func NoApplicableMethodErrorNew(s *Scope, depth int, gf Object, fargs List, format string, args ...any) Object
- func NormalizeNumber(v0, v1 Object) (n0, n1 Object)
- func PackageErrorNew(s *Scope, depth int, pkg *Package, format string, args ...any) Object
- func ParseErrorNew(s *Scope, depth int, format string, args ...any) Object
- func PrintNotReadableNew(s *Scope, depth int, object Object, format string, args ...any) Object
- func ProgramErrorNew(s *Scope, depth int, format string, args ...any) Object
- func ReaderErrorNew(s *Scope, depth int, stream Stream, format string, args ...any) Object
- func SimpleObject(val any) (obj Object)
- func StreamErrorNew(s *Scope, depth int, stream Stream, format string, args ...any) Object
- func TimeComponents(s *Scope, obj Time, args List, depth int) Object
- func ToOctet(arg Object) (result Object)
- func TypeErrorNew(s *Scope, depth int, use string, value Object, wants ...string) Object
- func UnboundSlotNew(s *Scope, depth int, instance Object, name Object, format string, args ...any) Object
- func UnboundVariableNew(s *Scope, depth int, name Object, format string, args ...any) Object
- func UndefinedFunctionNew(s *Scope, depth int, name Object, format string, args ...any) Object
- type Octet
- func (obj Octet) Append(b []byte) []byte
- func (obj Octet) Equal(other Object) (eq bool)
- func (obj Octet) Eval(s *Scope, depth int) Object
- func (obj Octet) Hierarchy() []Symbol
- func (obj Octet) Int64() int64
- func (obj Octet) IntegerType() Symbol
- func (obj Octet) IsInt64() bool
- func (obj Octet) LoadForm() Object
- func (obj Octet) NumberType() Symbol
- func (obj Octet) RationalType() Symbol
- func (obj Octet) Readably(b []byte, p *Printer) []byte
- func (obj Octet) RealType() Symbol
- func (obj Octet) RealValue() float64
- func (obj Octet) Simplify() any
- func (obj Octet) String() string
- type Octets
- func (obj Octets) Adjust(dims []int, eType Symbol, initVal Object, initContent List, fillPtr int) VectorLike
- func (obj Octets) Adjustable() bool
- func (obj Octets) Append(b []byte) []byte
- func (obj Octets) ArrayType() Symbol
- func (obj Octets) AsList() List
- func (obj Octets) Dimensions() []int
- func (obj Octets) ElementType() Symbol
- func (obj Octets) Equal(other Object) (eq bool)
- func (obj Octets) Eval(s *Scope, depth int) Object
- func (obj Octets) Get(indexes ...int) Object
- func (obj Octets) Hierarchy() []Symbol
- func (obj Octets) Length() int
- func (obj Octets) LoadForm() Object
- func (obj Octets) MajorGet(index int) Object
- func (obj Octets) MajorIndex(indexes ...int) int
- func (obj Octets) MajorSet(index int, value Object)
- func (obj Octets) Rank() int
- func (obj Octets) SequenceType() Symbol
- func (obj Octets) Set(value Object, indexes ...int)
- func (obj Octets) SetElementType(ts Object)
- func (obj Octets) Simplify() any
- func (obj Octets) String() string
- type OutputStream
- func (obj *OutputStream) Append(b []byte) []byte
- func (obj *OutputStream) Close() (err error)
- func (obj *OutputStream) Equal(other Object) bool
- func (obj *OutputStream) Eval(s *Scope, depth int) Object
- func (obj *OutputStream) Hierarchy() []Symbol
- func (obj *OutputStream) IsOpen() (open bool)
- func (obj *OutputStream) LastByte() byte
- func (obj *OutputStream) Simplify() any
- func (obj *OutputStream) StreamType() Symbol
- func (obj *OutputStream) String() string
- func (obj *OutputStream) Write(b []byte) (int, error)
- type Package
- func (obj *Package) AllClasses() []Class
- func (obj *Package) Append(b []byte) []byte
- func (obj *Package) DefConst(name string, value Object, doc string) (vv *VarVal)
- func (obj *Package) DefLambda(name string, lam *Lambda, fc func(args List) Object, kind Symbol) (fi *FuncInfo)
- func (obj *Package) Define(creator func(args List) Object, doc *FuncDoc, aux ...any) *FuncInfo
- func (obj *Package) Describe(b []byte, indent, right int, ansi bool) []byte
- func (obj *Package) EachClass(cb func(c Class))
- func (obj *Package) EachClassName(cb func(name string))
- func (obj *Package) EachFuncInfo(cb func(fi *FuncInfo))
- func (obj *Package) EachFuncName(cb func(name string))
- func (obj *Package) EachVarName(cb func(name string))
- func (obj *Package) EachVarVal(cb func(name string, vv *VarVal))
- func (obj *Package) Equal(other Object) (eq bool)
- func (obj *Package) Eval(s *Scope, depth int) Object
- func (obj *Package) Export(name string)
- func (obj *Package) FindClass(name string) (c Class)
- func (obj *Package) Get(name string) (value Object, has bool)
- func (obj *Package) GetFunc(name string) (fi *FuncInfo)
- func (obj *Package) GetVarVal(name string) (vv *VarVal)
- func (obj *Package) Has(name string) (has bool)
- func (obj *Package) Hierarchy() []Symbol
- func (obj *Package) Import(pkg *Package, varName string)
- func (obj *Package) Initialize(vars map[string]*VarVal, local ...any)
- func (obj *Package) JustGet(name string) (value Object)
- func (obj *Package) LoadForm() Object
- func (obj *Package) LoadPath() string
- func (obj *Package) PkgPath() string
- func (obj *Package) Readably(b []byte, p *Printer) []byte
- func (obj *Package) RegisterClass(name string, c Class)
- func (obj *Package) Remove(name string) (removed bool)
- func (obj *Package) Set(name string, value Object, privates ...bool) (vv *VarVal)
- func (obj *Package) SetIfHas(name string, value Object, private bool) (vv *VarVal)
- func (obj *Package) Simplify() any
- func (obj *Package) String() string
- func (obj *Package) Undefine(name string)
- func (obj *Package) Unexport(name string)
- func (obj *Package) Unuse(pkg *Package)
- func (obj *Package) Use(pkg *Package)
- type Panic
- func (p *Panic) Append(b []byte) []byte
- func (p *Panic) AppendFull(b []byte) []byte
- func (p *Panic) AppendToStack(name string, args List)
- func (p *Panic) Equal(other Object) bool
- func (p *Panic) Error() string
- func (p *Panic) Eval(s *Scope, depth int) Object
- func (p *Panic) Hierarchy() []Symbol
- func (p *Panic) Simplify() any
- func (p *Panic) Stack() []string
- func (p *Panic) String() string
- type PartialPanic
- type Placer
- type Printer
- type Ratio
- func (obj *Ratio) Append(b []byte) []byte
- func (obj *Ratio) Equal(other Object) (eq bool)
- func (obj *Ratio) Eval(s *Scope, depth int) Object
- func (obj *Ratio) Hierarchy() []Symbol
- func (obj *Ratio) LoadForm() Object
- func (obj *Ratio) NumberType() Symbol
- func (obj *Ratio) RationalType() Symbol
- func (obj *Ratio) Readably(b []byte, p *Printer) []byte
- func (obj *Ratio) RealType() Symbol
- func (obj *Ratio) RealValue() float64
- func (obj *Ratio) Simplify() any
- func (obj *Ratio) String() string
- type Rational
- type Readble
- type Real
- type Receiver
- type Ref
- type ReturnResult
- type RuneReader
- func (obj *RuneReader) Close() (err error)
- func (obj *RuneReader) IsOpen() bool
- func (obj *RuneReader) PushRune(r rune)
- func (obj *RuneReader) Read(b []byte) (cnt int, err error)
- func (obj *RuneReader) ReadByte() (b byte, err error)
- func (obj *RuneReader) ReadRune() (r rune, size int, err error)
- func (obj *RuneReader) UnreadRune() (err error)
- type RuneStream
- type Scope
- func (s *Scope) AddParent(p *Scope)
- func (s *Scope) AllVars() map[string]Object
- func (s *Scope) Bound(sym Symbol) bool
- func (s *Scope) Eval(obj Object, depth int) (result Object)
- func (s *Scope) Get(sym Symbol) Object
- func (s *Scope) Has(sym Symbol) bool
- func (s *Scope) InBlock(name Object) bool
- func (s *Scope) Let(sym Symbol, value Object)
- func (s *Scope) LocalGet(sym Symbol) (Object, bool)
- func (s *Scope) Lock()
- func (s *Scope) NewScope() *Scope
- func (s *Scope) Parents() []*Scope
- func (s *Scope) Remove(sym Symbol) bool
- func (s *Scope) Set(sym Symbol, value Object)
- func (s *Scope) SetSynchronized(on bool)
- func (s *Scope) String() string
- func (s *Scope) Synchronized() bool
- func (s *Scope) Unlock()
- func (s *Scope) UnsafeLet(sym Symbol, value Object)
- type ScopedAppender
- type Sequence
- type ShortFloat
- type SignedByte
- func (obj *SignedByte) Append(b []byte) []byte
- func (obj *SignedByte) AsFixOrBig() Object
- func (obj *SignedByte) Dup() *SignedByte
- func (obj *SignedByte) Equal(other Object) (eq bool)
- func (obj *SignedByte) Eval(s *Scope, depth int) Object
- func (obj *SignedByte) Hierarchy() []Symbol
- func (obj *SignedByte) Int64() (i int64)
- func (obj *SignedByte) IntegerType() Symbol
- func (obj *SignedByte) IsInt64() (ii bool)
- func (obj *SignedByte) IsNeg() bool
- func (obj *SignedByte) LoadForm() Object
- func (obj *SignedByte) Neg()
- func (obj *SignedByte) NumberType() Symbol
- func (obj *SignedByte) RationalType() Symbol
- func (obj *SignedByte) RealType() Symbol
- func (obj *SignedByte) RealValue() (rv float64)
- func (obj *SignedByte) SetBit(index uint, value bool)
- func (obj *SignedByte) Simplify() any
- func (obj *SignedByte) Size() int
- func (obj *SignedByte) String() string
- type Simple
- type SingleFloat
- func (obj SingleFloat) Append(b []byte) []byte
- func (obj SingleFloat) Equal(other Object) (eq bool)
- func (obj SingleFloat) Eval(s *Scope, depth int) Object
- func (obj SingleFloat) FloatType() Symbol
- func (obj SingleFloat) Hierarchy() []Symbol
- func (obj SingleFloat) LoadForm() Object
- func (obj SingleFloat) NumberType() Symbol
- func (obj SingleFloat) Readably(b []byte, p *Printer) []byte
- func (obj SingleFloat) RealType() Symbol
- func (obj SingleFloat) RealValue() float64
- func (obj SingleFloat) Simplify() any
- func (obj SingleFloat) String() string
- type SpecialSyntax
- type Stream
- type String
- func (obj String) Append(b []byte) []byte
- func (obj String) Equal(other Object) bool
- func (obj String) Eval(s *Scope, depth int) Object
- func (obj String) Hierarchy() []Symbol
- func (obj String) Length() int
- func (obj String) LoadForm() Object
- func (obj String) Readably(b []byte, p *Printer) []byte
- func (obj String) SequenceType() Symbol
- func (obj String) Simplify() any
- func (obj String) String() string
- type StringStream
- func (obj *StringStream) Append(b []byte) []byte
- func (obj *StringStream) Close() error
- func (obj *StringStream) Content() string
- func (obj *StringStream) Equal(other Object) bool
- func (obj *StringStream) Eval(s *Scope, depth int) Object
- func (obj *StringStream) Hierarchy() []Symbol
- func (obj *StringStream) IsOpen() bool
- func (obj *StringStream) LastByte() (b byte)
- func (obj *StringStream) Read(p []byte) (n int, err error)
- func (obj *StringStream) ReadAt(p []byte, off int64) (n int, err error)
- func (obj *StringStream) ReadByte() (b byte, err error)
- func (obj *StringStream) ReadRune() (r rune, size int, err error)
- func (obj *StringStream) Seek(offset int64, whence int) (n int64, err error)
- func (obj *StringStream) Simplify() any
- func (obj *StringStream) StreamType() Symbol
- func (obj *StringStream) String() string
- func (obj *StringStream) UnreadRune() error
- func (obj *StringStream) Write(b []byte) (int, error)
- func (obj *StringStream) WriteAt(b []byte, off int64) (int, error)
- type Symbol
- func (obj Symbol) Append(b []byte) []byte
- func (obj Symbol) Equal(other Object) bool
- func (obj Symbol) Eval(s *Scope, depth int) Object
- func (obj Symbol) Hierarchy() []Symbol
- func (obj Symbol) LoadForm() Object
- func (obj Symbol) Readably(b []byte, p *Printer) []byte
- func (obj Symbol) Simplify() any
- func (obj Symbol) String() string
- type Tail
- type Time
- func (obj Time) Append(b []byte) []byte
- func (obj Time) Class() Class
- func (obj Time) Describe(b []byte, indent, right int, ansi bool) []byte
- func (obj Time) Equal(other Object) (eq bool)
- func (obj Time) Eval(s *Scope, depth int) Object
- func (obj Time) HasMethod(method string) bool
- func (obj Time) Hierarchy() []Symbol
- func (obj Time) Init(scope *Scope, args List, depth int)
- func (obj Time) LoadForm() Object
- func (obj Time) Receive(s *Scope, message string, args List, depth int) Object
- func (obj Time) Simplify() any
- func (obj Time) String() string
- type Undefined
- type UnsignedByte
- func (obj *UnsignedByte) Append(b []byte) []byte
- func (obj *UnsignedByte) AsFixOrBig() Object
- func (obj *UnsignedByte) Dup() *UnsignedByte
- func (obj *UnsignedByte) Equal(other Object) (eq bool)
- func (obj *UnsignedByte) Eval(s *Scope, depth int) Object
- func (obj *UnsignedByte) GetBit(index uint) (value bool)
- func (obj *UnsignedByte) Hierarchy() []Symbol
- func (obj *UnsignedByte) Int64() (i int64)
- func (obj *UnsignedByte) IntegerType() Symbol
- func (obj *UnsignedByte) Invert()
- func (obj *UnsignedByte) IsInt64() (ii bool)
- func (obj *UnsignedByte) LoadForm() Object
- func (obj *UnsignedByte) NumberType() Symbol
- func (obj *UnsignedByte) RationalType() Symbol
- func (obj *UnsignedByte) RealType() Symbol
- func (obj *UnsignedByte) RealValue() (rv float64)
- func (obj *UnsignedByte) SetBit(index uint, value bool)
- func (obj *UnsignedByte) Simplify() any
- func (obj *UnsignedByte) Size() int
- func (obj *UnsignedByte) String() string
- type Values
- func (obj Values) Append(b []byte) []byte
- func (obj Values) Equal(other Object) (eq bool)
- func (obj Values) Eval(s *Scope, depth int) Object
- func (obj Values) First() Object
- func (obj Values) Hierarchy() []Symbol
- func (obj Values) LoadForm() Object
- func (obj Values) Simplify() any
- func (obj Values) String() string
- type VarVal
- type Vector
- func (obj *Vector) Adjust(dims []int, elementType Symbol, initElement Object, initContent List, ...) VectorLike
- func (obj *Vector) Append(b []byte) []byte
- func (obj *Vector) ArrayType() Symbol
- func (obj *Vector) AsList() List
- func (obj *Vector) Equal(other Object) (eq bool)
- func (obj *Vector) Eval(s *Scope, depth int) Object
- func (obj *Vector) FillPointer() int
- func (obj *Vector) Hierarchy() []Symbol
- func (obj *Vector) Pop() (element Object)
- func (obj *Vector) Push(values ...Object) (index int)
- func (obj *Vector) SequenceType() Symbol
- func (obj *Vector) SetFillPointer(fp int)
- func (obj *Vector) Simplify() any
- func (obj *Vector) String() string
- type VectorLike
- type WhopLoc
- func (wl *WhopLoc) Append(b []byte) []byte
- func (wl *WhopLoc) Continue(s *Scope, args List, depth int) Object
- func (wl *WhopLoc) Equal(other Object) (eq bool)
- func (wl *WhopLoc) Eval(s *Scope, depth int) Object
- func (wl *WhopLoc) HasNext() bool
- func (wl *WhopLoc) Hierarchy() []Symbol
- func (wl *WhopLoc) Simplify() interface{}
- func (wl *WhopLoc) String() string
Constants ¶
const ( ArraySymbol = Symbol("array") ArrayMaxRank = 1024 ArrayMaxDimension = 0x10000000 )
ArraySymbol is the symbol with a value of "array".
const ( // AmpBody is &body. AmpBody = "&body" // AmpKey is &key. AmpKey = "&key" // AmpOptional is &optional. AmpOptional = "&optional" // AmpRest is &rest. AmpRest = "&rest" // AmpAux is &aux. AmpAux = "&aux" // AmpAllowOtherKeys is &allow-other-keys AmpAllowOtherKeys = "&allow-other-keys" )
const ( // BuiltInSymbol is the symbol with a value of "built-in". BuiltInSymbol = Symbol("built-in") // FunctionSymbol is the symbol with a value of "function". FunctionSymbol = Symbol("function") // MacroSymbol is the symbol with a value of "macro". MacroSymbol = Symbol("macro") // LambdaSymbol is the symbol with a value of "lambda". LambdaSymbol = Symbol("lambda") // FlosSymbol is the symbol with a value of "flos-function" for FLOS functions. FlosSymbol = Symbol("flos-function") // MethodSymbol is the symbol with a value of "method" for Flavors // methods. MethodSymbol = Symbol("method") // GenericFunctionSymbol is the symbol with a value of "generic-function" // for CLOS generics and methods. GenericFunctionSymbol = Symbol("generic-function") )
const ( // ListSymbol is the symbol with a value of "list". ListSymbol = Symbol("list") // ConsSymbol is the symbol with a value of "cons". ConsSymbol = Symbol("cons") )
const ArithmeticErrorSymbol = Symbol("arithmetic-error")
ArithmeticErrorSymbol is the symbol with a value of "arithmetic-error".
const BignumSymbol = Symbol("bignum")
BignumSymbol is the symbol with a value of "bignum".
const BitSymbol = Symbol("bit")
BitSymbol is the symbol with a value of "bit".
const BitVectorSymbol = Symbol("bit-vector")
BitVectorSymbol is the symbol with a value of "bit-vector".
const ByteSymbol = Symbol("byte")
ByteSymbol is the symbol with a value of "byte".
const CellErrorSymbol = Symbol("cell-error")
CellErrorSymbol is the symbol with a value of "cell-error".
const CharacterSymbol = Symbol("character")
CharacterSymbol is the Symbol with a value of "character".
const ClassNotFoundSymbol = Symbol("class-not-found")
ClassNotFoundSymbol is the symbol with a value of "unbound-slot".
const ComplexSymbol = Symbol("complex")
ComplexSymbol is the symbol with a value of "complex".
const ConditionSymbol = Symbol("condition")
ConditionSymbol is the symbol with a value of "condition".
const ControlErrorSymbol = Symbol("control-error")
ControlErrorSymbol is the symbol with a value of "control-error".
const (
DefaultRightMargin = 120
)
const DivisionByZeroSymbol = Symbol("division-by-zero")
DivisionByZeroSymbol is the symbol with a value of "division-by-zero".
const DoubleFloatSymbol = Symbol("double-float")
DoubleFloatSymbol is the symbol with a value of "doubleFloat".
const EndOfFileSymbol = Symbol("end-of-file")
EndOfFileSymbol is the symbol with a value of "end-of-file".
const ErrorSymbol = Symbol("error")
ErrorSymbol is the symbol with a value of "error".
const FileErrorSymbol = Symbol("file-error")
FileErrorSymbol is the symbol with a value of "file-error".
const FileStreamSymbol = Symbol("file-stream")
FileStreamSymbol is the symbol with a value of "file-stream".
const FixnumSymbol = Symbol("fixnum")
FixnumSymbol is the symbol with a value of "fixnum".
const FloatSymbol = Symbol("float")
FloatSymbol is the symbol with a value of "float".
const HashTableSymbol = Symbol("hash-table")
HashTableSymbol is the symbol with a value of "hash-table".
const IOStreamSymbol = Symbol("io-stream")
IOStreamSymbol is the symbol with a value of "io-stream".
const InputStreamSymbol = Symbol("input-stream")
InputStreamSymbol is the symbol with a value of "input-stream".
const IntegerSymbol = Symbol("integer")
IntegerSymbol is the symbol with a value of "integer".
const InvalidMethodErrorSymbol = Symbol("invalid-method-error")
InvalidMethodErrorSymbol is the symbol with a value of "invalid-method-error".
const (
LongFloatSymbol = Symbol("long-float")
)
LongFloatSymbol is the symbol with a value of "longFloat".
const NoApplicableMethodErrorSymbol = Symbol("no-applicable-method-error")
NoApplicableMethodErrorSymbol is the symbol with a value of "no-applicable-method-error".
const Novalue = novalue(0)
Novalue represents no value. It is used by built in functions such apropos that have no return value.
const NumberSymbol = Symbol("number")
NumberSymbol is the symbol with a value of "number".
const OctetSymbol = Symbol("octet")
OctetSymbol is the symbol with a value of "octet".
const OctetsSymbol = Symbol("octets")
OctetsSymbol is the symbol with a value of "octets".
const OutputStreamSymbol = Symbol("output-stream")
OutputStreamSymbol is the symbol with a value of "output-stream".
const PackageErrorSymbol = Symbol("package-error")
PackageErrorSymbol is the symbol with a value of "package-error".
const PackageSymbol = Symbol("package")
PackageSymbol is the symbol with a value of "package".
const ParseErrorSymbol = Symbol("parse-error")
ParseErrorSymbol is the symbol with a value of "parse-error".
const PrintNotReadableSymbol = Symbol("print-not-readable")
PrintNotReadableSymbol is the symbol with a value of "print-not-readable".
const ProgramErrorSymbol = Symbol("program-error")
ProgramErrorSymbol is the symbol with a value of "program-error".
const RatioSymbol = Symbol("ratio")
RatioSymbol is the symbol with a value of "ratio".
const RationalSymbol = Symbol("rational")
RationalSymbol is the symbol with a value of "rational".
const ReaderErrorSymbol = Symbol("reader-error")
ReaderErrorSymbol is the symbol with a value of "reader-error".
const RealSymbol = Symbol("real")
RealSymbol is the symbol with a value of "real".
const SequenceSymbol = Symbol("sequence")
SequenceSymbol is the symbol with a value of "sequence".
const SeriousConditionSymbol = Symbol("serious-condition")
SeriousConditionSymbol is the symbol with a value of "serious-condition".
const ShortFloatSymbol = Symbol("short-float")
ShortFloatSymbol is the symbol with a value of "shortFloat".
const SignedByteSymbol = Symbol("signed-byte")
SignedByteSymbol is the symbol with a value of "signed-byte".
const SimpleSymbol = Symbol("simple")
SimpleSymbol is the symbol with a value of "simple".
const SingleFloatSymbol = Symbol("single-float")
SingleFloatSymbol is the symbol with a value of "singleFloat".
const StreamErrorSymbol = Symbol("stream-error")
StreamErrorSymbol is the symbol with a value of "stream-error".
const StreamSymbol = Symbol("stream")
StreamSymbol is the symbol with a value of "stream".
const StringStreamSymbol = Symbol("string-stream")
StringStreamSymbol is the symbol with a value of "string-stream".
const StringSymbol = Symbol("string")
StringSymbol is the symbol with a value of "string".
const SymbolSymbol = Symbol("symbol")
SymbolSymbol is the symbol with a value of "symbol".
const TimeSymbol = Symbol("time")
TimeSymbol is the symbol with a value of "time".
const True = boolean(true)
True is the true boolean value.
const TrueSymbol = Symbol("t")
TrueSymbol is the symbol with a value of "t".
const TypeErrorSymbol = Symbol("type-error")
TypeErrorSymbol is the symbol with a value of "type-error".
const Unbound = unbound(0)
Unbound indicates a variable is unbound.
const UnboundSlotSymbol = Symbol("unbound-slot")
UnboundSlotSymbol is the symbol with a value of "unbound-slot".
const UnboundVariableSymbol = Symbol("unbound-variable")
UnboundVariableSymbol is the symbol with a value of "unbound-variable".
const UndefinedFunctionSymbol = Symbol("undefined-function")
UndefinedFunctionSymbol is the symbol with a value of "undefined-function".
const UnsignedByteSymbol = Symbol("unsigned-byte")
UnsignedByteSymbol is the symbol with a value of "unsigned-byte".
const ValuesSymbol = Symbol("values")
ValuesSymbol is the symbol with a value of "values".
const VectorSymbol = Symbol("vector")
VectorSymbol is the symbol with a value of "vector".
const WarningSymbol = Symbol("warning")
WarningSymbol is the symbol with a value of "serious-condition".
const WhopLocSymbol = Symbol("whopper-location")
WhopLocSymbol is the symbol with a value of "whopLoc".
Variables ¶
var ( CLPkg = Package{ Name: "common-lisp", Nicknames: []string{"cl"}, Doc: "Home of symbols defined by the ANSI LISP language specification.", PreSet: DefaultPreSet, Locked: true, // contains filtered or unexported fields } // ErrorOutput backs *error-output*. ErrorOutput Object = (*FileStream)(os.Stderr) // StandardOutput backs *standard-output*. StandardOutput Object = (*FileStream)(os.Stdout) // TrqaceOutput backs *trace-output*. TraceOutput Object = (*FileStream)(os.Stdout) // StandardInput backs *standard-input*. StandardInput Object = (*FileStream)(os.Stdin) // WorkingDir *default-pathname-defaults* WorkingDir, _ = os.Getwd() // Interactive flag. If true then warnings are output to *standard-output* // otherwise they are output to *error-output*. Interactive bool // CurrentPackage is the current package. CurrentPackage *Package )
CLPkg is the COMMON-LISP package.
var CurrentPackageLoadPath = ""
CurrentPackageLoadPath is the current load path and is used to set the LoadPath of a package when it is added. This is set and unset by the cl:require function.
var ( KeywordPkg = Package{ Name: "keyword", Nicknames: []string{}, Doc: "Home of keyword symbols.", PreSet: keywordPreSet, // contains filtered or unexported fields } )
KeywordPkg is the KEYWORD package.
var ( // UserPkg is the common-lisp-user package. UserPkg = Package{ Name: "common-lisp-user", Nicknames: []string{"cl-user", "user"}, Doc: "The default package for user code and variables.", Imports: map[string]*Import{}, PreSet: DefaultPreSet, } )
Functions ¶
func AddClassHook ¶ added in v1.3.1
AddClassHook add a hook that is called after a class is added.
func AddDefunHook ¶ added in v0.9.5
AddDefunHook add a hook that is called after a function is added.
func AddSetHook ¶ added in v0.9.5
AddSetHook adds a hook that is called after setting a variable or after a defvar or defparameter is called.
func AddUnsetHook ¶ added in v0.9.5
AddUnsetHook add a hook that is called when a variable is unset or removed.
func AppendDoc ¶
AppendDoc appends text after formatting and converting _ and __ either to ANSI underline and bold or is not ANSI removing them.
func ArithmeticPanic ¶ added in v0.7.0
func ArithmeticPanic(s *Scope, depth int, operation Object, operands List, format string, args ...any)
ArithmeticPanic raises a ArithmeticError (arithmetic-error) describing a arithmetic error.
func ByteFromReader ¶ added in v1.3.1
ByteFromReader reads a byte.
func CheckArgCount ¶ added in v1.3.1
CheckArgCount panics if the number of arguments is outside the range specified.
func CheckSendArgCount ¶ added in v1.3.1
CheckSendArgCount panics if the number of arguments is outside the range specified.
func ClassNotFoundPanic ¶ added in v0.7.0
ClassNotFoundPanic raises a ClassNotFound (unbound-slot) describing a class-not-found error.
func ControlPanic ¶ added in v0.7.0
ControlPanic raises a ControlError (control-error) describing a control error.
func Define ¶
Define a new golang function. If the package is provided the function is added to that package otherwise it is added to CurrentPackage (*package*).
func DescribeVar ¶
DescribeVar returns the documentation for the variable bound to the sym argument.
func DivisionByZeroPanic ¶ added in v1.0.0
func DivisionByZeroPanic(s *Scope, depth int, operation Object, operands List, format string, args ...any)
DivisionByZeroPanic raises a DivisionByZero (division-by-zero) describing a division by zero error.
func EndOfFilePanic ¶ added in v1.0.0
EndOfFilePanic raises a EndOfFile (end-of-file) describing a stream error.
func ErrorPanic ¶ added in v1.3.1
ErrorPanic raises an error.
func InvalidMethodPanic ¶ added in v1.3.1
func InvalidMethodPanic(s *Scope, depth int, class, qualifier, name Object, format string, args ...any)
InvalidMethodPanic raises a invalid-method-error describing a invalid-method-error error.
func IsNil ¶ added in v1.3.1
IsNil checks for a nil value of an interface. Go values have two components not exposed, a type component and a value component. Further reading: https://research.swtch.com/interfaces. To ascertain whether the value is nil we ignore the type component and just check if the value component is set to 0.
func MethodArgChoicePanic ¶ added in v1.3.1
func MethodArgChoicePanic(s *Scope, depth int, inst Instance, method string, cnt int, choices string)
MethodArgChoicePanic raises a panic describing an invalid choice when the expected argument are a choice of a set of values.
func MethodArgCountCheck ¶ added in v1.3.1
MethodArgCountCheck raises a panic describing the wrong number of arguments to a method if the argument count is outside the expected bounds.
func MethodArgCountPanic ¶ added in v1.3.1
MethodArgCountPanic raises a panic describing the wrong number of arguments to a method.
func MustBeString ¶ added in v0.9.0
MustBeString returns a string if the arg is a symbol or string. If not a type error is raised with the name argument as the expected field in the error.
func NoApplicableMethodPanic ¶ added in v1.3.1
func NoApplicableMethodPanic(s *Scope, depth int, gf Object, fargs List, format string, args ...any)
NoApplicableMethodPanic raises a no-applicable-method-error describing a no-applicable-method-error error.
func ObjectAppend ¶
ObjectAppend appends Object or "nil" if nil.
func ObjectEqual ¶
ObjectEqual compares two Object for equality returning true if they are equal.
func ObjectString ¶
ObjectString returns the string for an Object or "nil" if nil.
func PackagePanic ¶ added in v0.7.0
PackagePanic raises a PackageError (package-error) describing a package error.
func PanicSeriousCondition ¶ added in v1.3.1
func PanicSeriousCondition()
PanicSeriousCondition raises a serious-condition describing a serious condition.
func ParsePanic ¶ added in v0.7.0
ParsePanic raises a ParseError (parse-error) describing a parse error.
func PrintNotReadablePanic ¶ added in v1.3.1
PrintNotReadablePanic raises a print-not-readable.
func ProgramPanic ¶ added in v0.7.0
ProgramPanic raises a ProgramError (program-error) describing a program error.
func ReadStreamEach ¶ added in v0.9.5
ReadStreamEach reads LISP source code from a stream and calls the callback for each s-expressions read.
func ReadStreamPush ¶ added in v0.9.5
ReadStreamPush reads LISP source code from a stream and pushes s-expressions read onto a channel.
func ReaderPanic ¶ added in v0.7.0
ReaderPanic raises a ReaderError (reader-error) describing a parse error.
func RegisterClass ¶ added in v0.9.5
RegisterClass a class.
func RemoveClassHook ¶ added in v1.3.1
func RemoveClassHook(id string)
RemoveClassHook removes the class hook with the specified ID.
func RemoveDefunHook ¶ added in v0.9.5
func RemoveDefunHook(id string)
RemoveDefunHook removes the defun hook with the specified ID.
func RemovePackage ¶ added in v0.9.5
func RemovePackage(pkg *Package)
RemovePackage deletes a package.
func RemoveSetHook ¶ added in v0.9.5
func RemoveSetHook(id string)
RemoveSetHook removes the set hook with the specified ID.
func RemoveUnsetHook ¶ added in v0.9.5
func RemoveUnsetHook(id string)
RemoveUnsetHook removes the unset hook with the specified ID.
func RuneFromReader ¶ added in v1.3.1
RuneFromReader read a rune from an io.Reader.
func StreamPanic ¶ added in v0.7.0
StreamPanic raises a StreamError (stream-error) describing a stream error.
func TypePanic ¶ added in v0.7.0
TypePanic raises a TypeError (type-error) describing an incorrect type being used.
func UnboundSlotPanic ¶ added in v0.7.0
func UnboundSlotPanic(s *Scope, depth int, instance Object, name Object, format string, args ...any)
UnboundSlotPanic raises a UnboundSlot (unbound-slot) describing a unbound-slot error.
func UnboundVariablePanic ¶ added in v0.7.0
UnboundVariablePanic raises a UnboundVariable (unbound-variable) describing a unbound-variable error.
func UndefinedFunctionPanic ¶ added in v0.7.0
UndefinedFunctionPanic raises a UndefinedFunction (undefined-function) describing a undefined-function error.
Types ¶
type App ¶ added in v1.1.0
type App struct {
// Title is the name of the application.
Title string
// Usage for help documentation.
Usage func()
// Plugins is a list of paths to the plugin packages to be included in the
// go.mod file. (e.g., src/message.so)
Plugins []string
// Options identify the command line options for the application.
Options []*AppArg
// LispCode are the filepaths to the LISP source code. This use used
// during development and to form an encrypted and embedded file when the
// application is generated.
LispCode []string
// Source for the application. This is expected to be a single LISP file
// that may be encryped with a key specified as a command line argument or
// in a file.
Source *embed.FS
// KeyFlag is the command line flag for specifying a decryption key if the
// source is encrypted.
KeyFlag string
// KeyFile is the path to the key file containing a decryption key if one
// is needed.
KeyFile string
// EntryFunction is the name of a function or a lambda that takes no
// arguments. This is called to run the application. It is started within
// a scope that includes the command line argument variables already
// bound.
EntryFunction string
// OnPanic is called if a panic is raised. It should return the exit code
// for the application.
OnPanic func(f any) int
}
App has multiple roles related to developing, generating, and running an application. During development of a standalone SLIP application the App can execute LISP code from source files. Once development is complete then App can be used to generate a standalone application project. When that application is run the App functions assist in setting up and evaluating the LISP code that implements the application behavior.
func (*App) BuildEmbed ¶ added in v1.1.0
BuildEmbed sources and plugin libraries to the specified directory. If a non empty key is provided then lisp sources are encrypted.
type AppArg ¶ added in v1.1.0
type AppArg struct {
// Flag is the command line flag such as 'v' which matches '-v' on the
// command line.
Flag string
// Doc is the documentation or description of the flag as it appears in
// the help display that is triggered a '-h' on the command line.
Doc string
// Default is the default SLIP object that will be assigned to the
// variable associated with the flag unless over-ridden by a command line
// option.
Default Object
// Type is the SLIP type to coerce the command line option value into.
Type string
// Var is the name of the variable to that is bound to the flag value.
Var string
// contains filtered or unexported fields
}
AppArg are used to specify then variables that will be set from the command line arguments.
func (*AppArg) DefaultReadable ¶ added in v1.1.0
DefaultReadable returns the readable string that reads into the default value.
func (*AppArg) SetFlag ¶ added in v1.1.0
SetFlag sets the command line flag option for the argument.
func (*AppArg) UpdateScope ¶ added in v1.1.0
UpdateScope updates the scope with the values in the app arg.
type Array ¶
type Array struct {
// contains filtered or unexported fields
}
Array is an n dimensional collection of Objects.
func NewArray ¶
func NewArray( dimensions []int, elementType Symbol, initElement Object, initContent List, adjustable bool) *Array
NewArray creates a new array with the specified dimensions and initial value.
func (*Array) Adjust ¶ added in v0.9.5
func (obj *Array) Adjust(dimensions []int, elementType Symbol, initElement Object, initContent List) *Array
Adjust array with new parameters.
func (*Array) Adjustable ¶ added in v0.9.5
Adjustable returns true if the array is adjustable.
func (*Array) ElementType ¶ added in v0.9.5
ElementType returns the element-type of the array.
func (*Array) LoadForm ¶ added in v1.3.1
LoadForm returns a form that can be evaluated to create the object.
func (*Array) MajorIndex ¶ added in v0.9.5
MajorIndex for the indexes provided.
func (*Array) SetElementType ¶ added in v1.0.0
SetElementType returns the element-type of the array.
type ArrayLike ¶ added in v1.0.0
type ArrayLike interface {
Object
// ArrayType returns the array type.
ArrayType() Symbol
// Dimensions of the array.
Dimensions() []int
// Length returns the length of the object.
Length() int
// AsList the Object into set of nested lists.
AsList() List
// Rank of the array is returned,
Rank() int
// Adjustable returns true if the array is adjustable.
Adjustable() bool
// ElementType returns the element-type of the array.
ElementType() Symbol
// SetElementType sets the element-type of the array.
SetElementType(ts Object)
// Get the value at the location identified by the indexes.
Get(indexes ...int) Object
// Set a value at the location identified by the indexes.
Set(value Object, indexes ...int)
// MajorIndex for the indexes provided.
MajorIndex(indexes ...int) int
// MajorGet for the index provided.
MajorGet(index int) Object
// MajorSet for the index provided.
MajorSet(index int, value Object)
}
ArrayLike is an interface that all array and vectors implement.
type Bignum ¶
Bignum is a numerator and denominator pair.
func (*Bignum) IsInt64 ¶ added in v1.0.0
IsInt64 returns true if the instance can be represented by an int64.
func (*Bignum) LoadForm ¶ added in v1.3.1
LoadForm returns a form that can be evaluated to create the object.
func (*Bignum) RationalType ¶
RationalType returns 'bignum.
func (*Bignum) Readably ¶ added in v1.3.1
Readably appends the object to a byte slice. If p.Readbly is true the objects is appended in a readable format otherwise a simple append which may or may not be readable.
type Bit ¶ added in v1.0.0
type Bit byte
Bit represents a one bit integer.
func (Bit) Equal ¶ added in v1.0.0
Equal returns true if this Object and the other are equal in value.
func (Bit) Hierarchy ¶ added in v1.0.0
Hierarchy returns the class hierarchy as symbols for the instance.
func (Bit) IntegerType ¶ added in v1.0.0
IntegerType returns 'bit.
func (Bit) IsInt64 ¶ added in v1.0.0
IsInt64 returns true if the instance can be represented by an int64.
func (Bit) LoadForm ¶ added in v1.3.1
LoadForm returns a form that can be evaluated to create the object.
func (Bit) RationalType ¶ added in v1.0.0
RationalType returns 'bit.
type BitVector ¶ added in v1.0.0
type BitVector struct {
// Bytes in left to right order, the last byte includes padding on the low
// bits if needed.
Bytes []byte
Len uint
FillPtr int
CanAdjust bool
}
BitVector represents an integer with a specific number of bits.
func ReadBitVector ¶ added in v1.0.0
ReadBitVector parses a sequence of 0 and 1 to form a bit-vector.
func (*BitVector) Adjust ¶ added in v1.0.0
func (obj *BitVector) Adjust(dims []int, eType Symbol, initVal Object, initContent List, fillPtr int) VectorLike
Adjust array with new parameters.
func (*BitVector) Adjustable ¶ added in v1.0.0
Adjustable returns true if the array is adjustable.
func (*BitVector) AsFixnum ¶ added in v1.0.0
AsFixnum returns a Fixnum with the same bits as the vector. If more than 64 bits are in the vector then the first 64 bits are used to form the Fixnum and the boolean return is false.
func (*BitVector) At ¶ added in v1.0.0
At returns true if the bit at pos is set or false if not set.
func (*BitVector) Dimensions ¶ added in v1.0.0
Dimensions of the array.
func (*BitVector) ElementType ¶ added in v1.0.0
ElementType returns the element-type of the array.
func (*BitVector) Equal ¶ added in v1.0.0
Equal returns true if this Object and the other are equal in value.
func (*BitVector) FillPointer ¶ added in v1.0.0
FillPointer returns the fill-pointer as an int.
func (*BitVector) Hierarchy ¶ added in v1.0.0
Hierarchy returns the class hierarchy as symbols for the instance.
func (*BitVector) LoadForm ¶ added in v1.3.1
LoadForm returns a form that can be evaluated to create the object.
func (*BitVector) MajorIndex ¶ added in v1.0.0
MajorIndex for the indexes provided.
func (*BitVector) Pop ¶ added in v1.0.0
Pop a value from the vector. The vector elements are not changed if there is a fill-pointer. If there is no fill pointer then the length of the vector is shortened by one. Note a vector-pop without a fill pointer is not standard common lisp.
func (*BitVector) SequenceType ¶ added in v1.0.0
SequenceType() Symbol returns 'bit-vector.
func (*BitVector) SetElementType ¶ added in v1.0.0
SetElementType sets the element-type of the bit-vector.
func (*BitVector) SetFillPointer ¶ added in v1.0.0
SetFillPointer sets the fill-pointer.
type BoundCaller ¶ added in v0.7.0
type BoundCaller interface {
// BoundCall applies a function to a set of already evaluated and bound
// arguments.
BoundCall(s *Scope, depth int) Object
}
BoundCaller is an interface shared functions that can be invoked with arguments already bound to the scope.
type Caller ¶
type Caller interface {
// Call applies a function to a set of already evaluated arguments.
Call(s *Scope, args List, depth int) Object
}
Caller is an interface shared by all functions.
type Character ¶
type Character rune
Character is a character Object.
func ReadCharacter ¶
ReadCharacter read a character from bytes that would follow #\.
func (Character) LoadForm ¶ added in v1.3.1
LoadForm returns a form that can be evaluated to create the object.
type Class ¶ added in v0.7.0
type Class interface {
Object
// Name of the class.
Name() string
// Package the class is defined in.
Pkg() *Package
// Documentation of the class.
Documentation() string
// SetDocumentation of the class.
SetDocumentation(doc string)
// Describe the class in detail.
Describe(b []byte, indent, right int, ansi bool) []byte
// MakeInstance creates a new instance but does not call the :init method.
MakeInstance() Instance
// Inherits returns true if this Class inherits from a specified Class.
Inherits(c Class) bool
// InheritsList returns a list of all inherited classes.
InheritsList() []Class
// LoadForm should return a list that can be evaluated to create the class
// or nil if the class is a built in class. As an example, a flavor would
// be created by a defflavor expression.
LoadForm() Object
// Metaclass returns the name of the class's meta class which can be
// built-in-class, standard-class, flavor, or condition-class.
Metaclass() Symbol
// VarNames for DefMethod, requiredVars and defaultVars combined.
VarNames() []string
}
Class represents all class types.
type Code ¶
type Code []Object
Code is a list of S-Expressions read from LISP source code. It is a means of keeping loaded code together so that it can be evaluated and optimized for subsequent evaluations.
func ReadStream ¶ added in v0.9.5
ReadStream reads LISP source code from a stream and return a Code instance.
func ReadString ¶
ReadString reads LISP source code and return a Code instance.
func (Code) Compile ¶
func (c Code) Compile()
Compile all the code elements. This evaluates all the defun, defvar, and defmacro calls and converts unquoted lists to functions.
type Combination ¶ added in v1.3.1
Combination is the combined method functions for a class.
func (*Combination) Empty ¶ added in v1.3.1
func (c *Combination) Empty() bool
Empty return true if there are no daemons in the combination.
func (*Combination) Simplify ¶ added in v1.3.1
func (c *Combination) Simplify() any
Simplify by returning a representation of the combination.
type Complex ¶
type Complex complex128
Complex is a numerator and denominator pair.
type Describer ¶
type Describer interface {
// Describe the instance in detail.
Describe(b []byte, indent, right int, ansi bool) []byte
}
Describer is the interface for types that respond to Describe() for use in the cl::describe function.
type DoubleFloat ¶
type DoubleFloat float64
DoubleFloat is a float64 Object.
func (DoubleFloat) Append ¶
func (obj DoubleFloat) Append(b []byte) []byte
Append a buffer with a representation of the Object.
func (DoubleFloat) Equal ¶
func (obj DoubleFloat) Equal(other Object) (eq bool)
Equal returns true if this Object and the other are equal in value.
func (DoubleFloat) Eval ¶
func (obj DoubleFloat) Eval(s *Scope, depth int) Object
Eval returns self.
func (DoubleFloat) FloatType ¶
func (obj DoubleFloat) FloatType() Symbol
FloatType returns 'double-float.
func (DoubleFloat) Hierarchy ¶
func (obj DoubleFloat) Hierarchy() []Symbol
Hierarchy returns the class hierarchy as symbols for the instance.
func (DoubleFloat) LoadForm ¶ added in v1.3.1
func (obj DoubleFloat) LoadForm() Object
LoadForm returns a form that can be evaluated to create the object.
func (DoubleFloat) NumberType ¶
func (obj DoubleFloat) NumberType() Symbol
NumberType returns 'double-float.
func (DoubleFloat) Readably ¶ added in v1.3.1
func (obj DoubleFloat) Readably(b []byte, p *Printer) []byte
Readably appends the object to a byte slice. If p.Readbly is true the objects is appended in a readable format otherwise a simple append which may or may not be readable.
func (DoubleFloat) RealType ¶
func (obj DoubleFloat) RealType() Symbol
RealType returns 'double-float.
func (DoubleFloat) RealValue ¶
func (obj DoubleFloat) RealValue() float64
RealValue of the number as a float64.
func (DoubleFloat) Simplify ¶
func (obj DoubleFloat) Simplify() any
Simplify the Object into a float64.
func (DoubleFloat) String ¶
func (obj DoubleFloat) String() string
String representation of the Object.
type Dynamic ¶
type Dynamic struct {
Function
}
Dynamic represents a function defined by a call to defun or lambda.
type FileStream ¶
FileStream is a *os.File.
func (*FileStream) Append ¶
func (obj *FileStream) Append(b []byte) []byte
Append a buffer with a representation of the Object.
func (*FileStream) Close ¶
func (obj *FileStream) Close() error
Close made visible since os.File functions are not automatically visible.
func (*FileStream) Equal ¶
func (obj *FileStream) Equal(other Object) bool
Equal returns true if this Object and the other are equal in value.
func (*FileStream) Eval ¶
func (obj *FileStream) Eval(s *Scope, depth int) Object
Eval returns self.
func (*FileStream) FileLength ¶ added in v1.0.0
func (obj *FileStream) FileLength() (length Object)
FileLength return the length of a file.
func (*FileStream) Hierarchy ¶
func (obj *FileStream) Hierarchy() []Symbol
Hierarchy returns the class hierarchy as symbols for the instance.
func (*FileStream) IsOpen ¶ added in v1.0.0
func (obj *FileStream) IsOpen() bool
IsOpen return true if the stream is open or false if not.
func (*FileStream) LastByte ¶ added in v1.0.0
func (obj *FileStream) LastByte() byte
LastByte returns the last byte written or zero if nothing has been written.
func (*FileStream) Read ¶
func (obj *FileStream) Read(b []byte) (int, error)
Read made visible since os.File functions are not automatically visible.
func (*FileStream) ReadByte ¶ added in v1.3.1
func (obj *FileStream) ReadByte() (b byte, err error)
ReadByte reads a byte.
func (*FileStream) ReadRune ¶ added in v1.3.1
func (obj *FileStream) ReadRune() (r rune, size int, err error)
ReadRune returns the next rune in buf from the current position. This is part of the io.RuneReader interface.
func (*FileStream) Seek ¶ added in v1.0.0
func (obj *FileStream) Seek(offset int64, whence int) (n int64, err error)
Seek moves the pos in buf. This is part of the io.Seeker interface.
func (*FileStream) Simplify ¶
func (obj *FileStream) Simplify() any
Simplify the Object into an int64.
func (*FileStream) StreamType ¶
func (obj *FileStream) StreamType() Symbol
StreamType returns 'fileStream.
func (*FileStream) String ¶
func (obj *FileStream) String() string
String representation of the Object.
func (*FileStream) UnreadRune ¶ added in v1.3.1
func (obj *FileStream) UnreadRune() error
UnreadRune calls UnreadRune on the input if not closed.
type FillPtrVector ¶ added in v1.0.0
type FillPtrVector interface {
VectorLike
// FillPointer returns the fill-pointer as an int. A value less than zero
// indicates no fill-pointer is set.
FillPointer() int
// SetFillPointer sets the fill-pointer.
SetFillPointer(int)
// Pop a value from the vector. The vector elements are not changed if
// there is a fill-pointer. If there is no fill pointer then the length of
// the vector is shortened by one.
Pop() (element Object)
// Push a value onto the vector.
Push(values ...Object) (index int)
}
FillPtrVector is a vector with a possible fillpointer
type Fixnum ¶
type Fixnum int64
Fixnum is a int64 Object.
func (Fixnum) IsInt64 ¶ added in v1.0.0
IsInt64 returns true if the instance can be represented by an int64.
func (Fixnum) LoadForm ¶ added in v1.3.1
LoadForm returns a form that can be evaluated to create the object.
func (Fixnum) Readably ¶ added in v1.3.1
Readably appends the object to a byte slice. If p.Readbly is true the objects is appended in a readable format otherwise a simple append which may or may not be readable.
type Float ¶
type Float interface {
Real
// FloatType returns the float type of the instance which can be one of: fixnum or bignum.
FloatType() Symbol
}
Float exists to allow assertions to determine if an Object is an float.
type FuncDoc ¶
type FuncDoc struct {
Name string
Args []*DocArg
Return string // return type
Text string
Examples []string
Kind Symbol
NoExport bool
}
FuncDoc describes a function.
func DescribeFunction ¶
DescribeFunction returns the documentation for the function bound to the sym argument.
type FuncInfo ¶
type FuncInfo struct {
Name string
Create func(args List) Object
Doc *FuncDoc
Pkg *Package // package interned in
Kind Symbol
Aux any
Export bool
}
FuncInfo stores information about a function.
func MustFindFunc ¶ added in v0.9.5
MustFindFunc finds the FuncInfo for a provided name or panics if none exists.
type Function ¶
type Function struct {
// Name of the function.
Name string
// Args are the un-evaluated and un-compiled arguments.
Args List
// Self points to the encapsulating object.
Self Caller
// SkipEval is a slice of flags indicating which arguments should be
// evaluated before calling Self.Call(). The last bool is the value used
// for &rest arguments if present.
SkipEval []bool
Pkg *Package
}
Function is the base type for most if not all functions.
func (*Function) LoadForm ¶ added in v1.3.1
LoadForm returns a form that can be evaluated to create the object.
func (*Function) SkipArgEval ¶ added in v0.9.5
SkipArgEval returns true if the argument eval should be skipped.
type Funky ¶
type Funky interface {
Object
// GetArgs returns the function arguments.
GetArgs() List
// GetName returns the function name.
GetName() string
// Apply evaluates without the need to evaluate the args..
Apply(s *Scope, args List, depth int) Object
// CompileArgs for the function.
CompileArgs()
// Caller returns the function's Caller (Self).
Caller() Caller
// GetPkg returns the package the function was defined in.
GetPkg() *Package
// contains filtered or unexported methods
}
Funky is an interface shared by all functions.
type HasFuncDocs ¶ added in v1.3.1
type HasFuncDocs interface {
// FuncDocs returns the documentation for the object.
FuncDocs() *FuncDoc
}
HasFuncDocs is an interface for objects that have FuncDoc documentation.
type HashTable ¶
HashTable of Objects.
type IOStream ¶ added in v0.9.5
type IOStream struct {
RW io.ReadWriter
}
IOStream is a io.ReadWriter.
func (*IOStream) Close ¶ added in v0.9.5
Close made visible since os.File functions are not automatically visible.
func (*IOStream) Equal ¶ added in v0.9.5
Equal returns true if this Object and the other are equal in value.
func (*IOStream) Hierarchy ¶ added in v0.9.5
Hierarchy returns the class hierarchy as symbols for the instance.
func (*IOStream) LastByte ¶ added in v1.0.0
LastByte returns the last byte written or zero if nothing has been written.
func (*IOStream) Read ¶ added in v0.9.5
Read made visible since io.Read functions are not automatically visible.
func (*IOStream) StreamType ¶ added in v0.9.5
StreamType returns 'ioStream.
type InputStream ¶
type InputStream struct {
RuneReader
}
InputStream wraps a io.Reader.
func NewInputStream ¶ added in v1.3.1
func NewInputStream(r io.Reader) *InputStream
NewInputStream create and return a new InputStream for the provided io.Reader.
func (*InputStream) Append ¶
func (obj *InputStream) Append(b []byte) []byte
Append a buffer with a representation of the Object.
func (*InputStream) Equal ¶
func (obj *InputStream) Equal(other Object) bool
Equal returns true if this Object and the other are equal in value.
func (*InputStream) Eval ¶
func (obj *InputStream) Eval(s *Scope, depth int) Object
Eval returns self.
func (*InputStream) Hierarchy ¶
func (obj *InputStream) Hierarchy() []Symbol
Hierarchy returns the class hierarchy as symbols for the instance.
func (*InputStream) Simplify ¶
func (obj *InputStream) Simplify() any
Simplify the Object into an int64.
func (*InputStream) StreamType ¶
func (obj *InputStream) StreamType() Symbol
StreamType returns 'inputStream.
func (*InputStream) String ¶
func (obj *InputStream) String() string
String representation of the Object.
type Instance ¶ added in v0.7.0
type Instance interface {
Object
Receiver
// Class of the instance.
Class() Class
// IsA returns true if the instance's class is the specified class or a
// sub-class of the specified class.
IsA(class string) bool
// Init the instance slots from the provided args list. If the scope is
// not nil then send :init is called.
Init(scope *Scope, args List, depth int)
// SetSynchronized sets the instance to be thread safe (mutex protected
// slots) or not.
SetSynchronized(on bool)
// Synchronized returns true if the instance is thread safe.
Synchronized() bool
// SlotNames returns a list of the slots names for the instance.
SlotNames() []string
// SlotValue return the value of an instance variable.
SlotValue(name Symbol) (Object, bool)
// SetSlotValue sets the value of an instance variable and return true if
// the name slot exists and was set.
SetSlotValue(sym Symbol, value Object) (has bool)
// GetMethod returns the method if it exists.
GetMethod(name string) *Method
// MethodNames returns a sorted list of the methods of the class.
MethodNames() List
// ID returns unique ID for the instance.
ID() uint64
// Dup returns a duplicate of the instance.
Dup() Instance
}
type Integer ¶
type Integer interface {
Rational
// IntegerType returns the integer type of the instance which can be one
// of: fixnum or bignum.
IntegerType() Symbol
// IsInt64 returns true if the instance can be represented by an int64.
IsInt64() bool
// Int64 returns the closest int64 of the integer.
Int64() int64
}
Integer exists to allow assertions to determine if an Object is an integer.
type Lambda ¶
Lambda is a Caller for forms/objects. It provides a level of indirection so that functions can be defined without regard to the order defined.
func DefLambda ¶
DefLambda parses arguments into a Lambda. Arguments should be a lambda-list followed by an optional documentation strings and then the forms to evaluate when the Lambda is called. The extraVars is a list of variables that will be defined when the lambda is called. This is used for methods where the scope will be an instance of a flavor/class.
func (*Lambda) Compile ¶ added in v1.3.1
Compile forms while in the current package instead of waiting until invoked.
type LastBytePeeker ¶ added in v1.0.0
type LastBytePeeker interface {
// LastByte returns the last byte written or zero if nothing has been written.
LastByte() byte
}
LastBytePeeker is an interface for checking the last byte written.
type List ¶
type List []Object
List of Objects.
func InstanceLoadForm ¶ added in v1.3.1
InstanceLoadForm created a load form for an instance.
func PackageNames ¶
func PackageNames() (names List)
PackageNames returns a sorted list of package names.
func (List) LoadForm ¶ added in v1.3.1
LoadForm returns a form that can be evaluated to create the object or panics if that is not possible.
func (List) SequenceType ¶
SequenceType returns 'list or 'cons if a cons.
type LoadFormer ¶ added in v1.3.1
type LoadFormer interface {
// LoadForm should return a form that can be evaluated to create the object
// or panic if that is not possible.
LoadForm() Object
}
LoadFormer is an interface for objects that implement the LoadForm() function.
type Locker ¶ added in v1.3.1
type Locker interface {
Lock()
Unlock()
TryLock() bool
}
Locker interface is used to act as an interface for either a sync.Mutex or a non-operational stand in for a mutex. Note that changing from one to the other should only be done while there is only one thread using the Locker.
type LongFloat ¶
LongFloat is a big.float Object.
func (*LongFloat) LoadForm ¶ added in v1.3.1
LoadForm returns a form that can be evaluated to create the object.
func (*LongFloat) NumberType ¶
NumberType returns 'long-float.
func (*LongFloat) Readably ¶ added in v1.3.1
Readably appends the object to a byte slice. If p.Readbly is true the objects is appended in a readable format otherwise a simple append which may or may not be readable.
type Method ¶ added in v1.3.1
type Method struct {
Name string
Doc *FuncDoc
Combinations []*Combination
}
Method represents a method for flavors and CLOS generics.
func (*Method) BoundInnerCall ¶ added in v1.3.1
func (*Method) CompareArgs ¶ added in v1.3.1
CompareArgs compares argument types and panics on a mismatch.
func (*Method) Equal ¶ added in v1.3.1
Equal returns true if this Object and the other are equal in value.
func (*Method) HasMethodFromClass ¶ added in v1.3.1
HasMethodFromClass return true if a combinations from a class is present.
func (*Method) Hierarchy ¶ added in v1.3.1
Hierarchy returns the class hierarchy as symbols for the whopLoc.
func (*Method) InnerCall ¶ added in v1.3.1
InnerCall calls the before, after, and primary method daemons.
type NoOpLocker ¶ added in v1.3.1
type NoOpLocker struct{}
NoOpLocker is a Locker that does nothing acting instead like a Mutex that does nothing.
type Number ¶
type Number interface {
Object
// NumberType returns the number type of the instance which can be one of:
// fixnum, bignum, float, ratio, or complex.
NumberType() Symbol
}
Number exists to allow assertions to determine if an Object is an number.
type Object ¶
type Object interface {
fmt.Stringer
// Append the object to a byte slice.
Append(b []byte) []byte
// Simplify the Object into simple go types of nil, bool, int64, float64,
// string, []any, map[string]any, or time.Time.
Simplify() any
// Equal returns true if this Object and the other are equal in value.
Equal(other Object) bool
// Hierarchy returns the class hierarchy as symbols for the instance.
Hierarchy() []Symbol
// Eval the object.
Eval(s *Scope, depth int) Object
}
Object is the interface for all LISP entities other than nil.
func ArithmeticErrorNew ¶ added in v1.3.1
func ArithmeticErrorNew(s *Scope, depth int, operation Object, operands List, format string, args ...any) Object
ArithmeticErrorNew creates a ArithmeticError (arithmetic-error) describing a arithmetic error.
func CellErrorNew ¶ added in v1.3.1
CellErrorNew raises a CellError (cell-error) describing a cell error.
func ClassNotFoundNew ¶ added in v1.3.1
ClassNotFoundNew creates a new ClassNotFound (class-not-found) describing a class-not-found error.
func Coerce ¶ added in v1.0.0
Coerce_ returns object converted to type. A type of t always returns object. Although not Common LISP standard other conversion are supported when possible as indicated in the table where the vertical axis is the source object type and the horizontal axis the target type:
|list | |string | | |vector | | | |octets (bytes) | | | | |bit-vector | | | | | |character | | | | | | |integer | | | | | | | |fixnum | | | | | | | | |octet (byte) | | | | | | | | | |bignum | | | | | | | | | | |float | | | | | | | | | | | |short-float | | | | | | | | | | | | |single-float | | | | | | | | | | | | | |double-float | | | | | | | | | | | | | | |long-float | | | | | | | | | | | | | | | |rational | | | | | | | | | | | | | | | | |ratio | | | | | | | | | | | | | | | | | |complex | | | | | | | | | | | | | | | | | | |symbol | | | | | | | | | | | | | | | | | | | |assoc | | | | | | | | | | | | | | | | | | | | |hash-table | | | | | | | | | | | | | | | | | | | | | |function | | | | | | | | | | | | | | | | | | | | | | |signed-byte | | | | | | | | | | | | | | | | | | | | | | | |unsigned-byte
list |x|x|x|x|x| | | | | | | | | | | | | | | | | | | | string |x|x|x|x| | | | | | | | | | | | | | |x| | |x| | | vector |x|x|x|x|x| | | | | | | | | | | | | | | | | | | | octets |x|x|x|x|x| | | | | | | | | | | | | | | | | | | | bit-vector |x| |x|x|x| |x|x|x|x| | | | | | | | | | | | |x|x| character | | | | | |x|x|x|x|x|x|x|x|x|x|x|x|x| | | | |x|x| integer | | | | |x|x|x|x|x|x|x|x|x|x|x|x|x|x| | | | |x|x| fixnum | | | | |x|x|x|x|x|x|x|x|x|x|x|x|x|x| | | | |x|x| octet | | | | |x|x|x|x|x|x|x|x|x|x|x|x|x|x| | | | |x|x| float | | | | | |x|x|x|x|x|x|x|x|x|x|x|x|x| | | | | | | ratio | | | | | |x|x|x|x|x|x|x|x|x|x|x|x|x| | | | | | | complex | | | | | |x|x|x|x|x|x|x|x|x|x|x|x|x| | | | | | | symbol |x|x|x|x| | | | | | | | | | | | | | |x| | |x| | | assoc |x| | | | | | | | | | | | | | | | | | |x|x| | | | hash-table | | | | | | | | | | | | | | | | | | | |x|x| | | | signed-byte | | | | |x|x|x|x|x|x| | | | | | | | | | | | |x|x| unsigned-byte | | | | |x|x|x|x|x|x| | | | | | | | | | | | |x|x|
func CoerceToList ¶ added in v1.0.0
CoerceToList coerce to a list or panic.
func CoerceToOctets ¶ added in v1.0.0
CoerceToOctets coerces to an octets or panic.
func CoerceToString ¶ added in v1.0.0
CoerceToString coerce to a string or panic.
func CoerceToVector ¶ added in v1.0.0
CoerceToVector coerce to vector or panic
func CompileList ¶
CompileList a list into a function or an undefined function.
func CompileString ¶
CompileString LISP string source code and return an Object.
func ControlErrorNew ¶ added in v1.3.1
ControlErrorNew creates a ControlError (control-error) describing a control error.
func DefaultPreSet ¶
DefaultPreSet is the default function for package PreSet.
func DivisionByZeroNew ¶ added in v1.3.1
func DivisionByZeroNew(s *Scope, depth int, operation Object, operands List, format string, args ...any) Object
DivisionByZeroNew creates a DivisionByZeroPanic (arithmetic-error) describing a arithmetic error.
func EndOfFileNew ¶ added in v1.3.1
EndOfFileNew returns a new EndOfFile (end-of-file) describing a stream error.
func ErrorNew ¶ added in v1.3.1
ErrorNew returns an Error object that can then be used with a call to panic.
func EvalArg ¶
EvalArg converts lists arguments to functions and replaces the argument. Then the argument is evaluated and returned. Non-list arguments are just evaluated.
func FileErrorNew ¶ added in v1.3.1
FileErrorNew creates a FilePanic (file-error) describing a file error.
func GetArgsKeyValue ¶ added in v0.7.0
GetArgsKeyValue returns the value for a key in args. Args must be the arguments after any required or optional arguments.
func InvalidMethodErrorNew ¶ added in v1.3.1
func InvalidMethodErrorNew(s *Scope, depth int, class, qualifier, name Object, format string, args ...any) Object
InvalidMethodErrorNew raises a invalid-method-error describing a invalid-method-error error.
func ListToFunc ¶
ListToFunc converts a list to a function.
func NewCondition ¶ added in v1.3.1
NewCondition returns a condition.
func NewSeriousCondition ¶ added in v1.3.1
func NewSeriousCondition() Object
NewSeriousCondition creates a serious-condition.
func NewWarning ¶ added in v0.7.0
NewWarning returns a Warning object.
func NoApplicableMethodErrorNew ¶ added in v1.3.1
func NoApplicableMethodErrorNew(s *Scope, depth int, gf Object, fargs List, format string, args ...any) Object
NoApplicableMethodErrorNew raises a no-applicable-method-error describing a no-applicable-method-error error.
func NormalizeNumber ¶ added in v1.0.0
NormalizeNumber normalizes numbers to the highest precedence where precedence is (lowest to highest) fixnum, bignum, ratio, single-float, double-float, long-float, complex. signed-byte and unsigned-byte are converted to bignum.
func PackageErrorNew ¶ added in v1.3.1
PackageErrorNew returns a new PackageError (package-error) describing a package error.
func ParseErrorNew ¶ added in v1.3.1
ParseErrorNew creates a ParsePanic (parse-error) describing a parse error.
func PrintNotReadableNew ¶ added in v1.3.1
PrintNotReadableNew creates a print-not-readable error.
func ProgramErrorNew ¶ added in v1.3.1
ProgramErrorNew creates a ProgramPanic (program-error) describing a program error.
func ReaderErrorNew ¶ added in v1.3.1
ReaderErrorNew creates a ReaderError (reader-error) describing a parse error.
func SimpleObject ¶
SimpleObject creates an Object from simple data.
func StreamErrorNew ¶ added in v1.3.1
StreamErrorNew returns a new StreamError (stream-error) describing a stream error.
func TimeComponents ¶ added in v0.9.7
TimeComponents returns a list of the time components as (year month day hour minute second nanosecond weekday).
func TypeErrorNew ¶ added in v1.3.1
TypeErrorNew returns a new type-error describing an incorrect type being used.
func UnboundSlotNew ¶ added in v1.3.1
func UnboundSlotNew(s *Scope, depth int, instance Object, name Object, format string, args ...any) Object
UnboundSlotNew raises a UnboundSlot (unbound-slot) describing a unbound-slot error.
func UnboundVariableNew ¶ added in v1.3.1
UnboundVariableNew returns a new UnboundVariable (unbound-variable) describing a unbound-variable error.
type Octet ¶ added in v0.9.5
type Octet byte
Octet is a unsigned 8 bit integer.
func (Octet) Equal ¶ added in v0.9.5
Equal returns true if this Object and the other are equal in value.
func (Octet) Hierarchy ¶ added in v0.9.5
Hierarchy returns the class hierarchy as symbols for the instance.
func (Octet) IntegerType ¶ added in v0.9.5
IntegerType returns 'octet.
func (Octet) IsInt64 ¶ added in v1.0.0
IsInt64 returns true if the instance can be represented by an int64.
func (Octet) LoadForm ¶ added in v1.3.1
LoadForm returns a form that can be evaluated to create the object.
func (Octet) NumberType ¶ added in v0.9.5
NumberType returns 'octet.
func (Octet) RationalType ¶ added in v0.9.5
RationalType returns 'octet.
func (Octet) Readably ¶ added in v1.3.1
Readably appends the object to a byte slice. If p.Readbly is true the objects is appended in a readable format otherwise a simple append which may or may not be readable.
type Octets ¶ added in v0.9.5
type Octets []byte
Octets is a octets Object.
func NewOctets ¶ added in v0.9.5
NewOctets creates a new Octets. If fillPtr is not used then it should be -1.
func (Octets) Adjust ¶ added in v1.0.0
func (obj Octets) Adjust(dims []int, eType Symbol, initVal Object, initContent List, fillPtr int) VectorLike
Adjust array with new parameters.
func (Octets) Adjustable ¶ added in v1.0.0
Adjustable returns true if the array is adjustable.
func (Octets) Dimensions ¶ added in v1.0.0
Dimensions of the array.
func (Octets) ElementType ¶ added in v1.0.0
ElementType returns the element-type of the array.
func (Octets) Equal ¶ added in v0.9.5
Equal returns true if this Object and the other are equal in value.
func (Octets) Hierarchy ¶ added in v0.9.5
Hierarchy returns the class hierarchy as symbols for the instance.
func (Octets) LoadForm ¶ added in v1.3.1
LoadForm returns a form that can be evaluated to create the object.
func (Octets) MajorIndex ¶ added in v1.0.0
MajorIndex for the indexes provided.
func (Octets) SequenceType ¶ added in v0.9.5
SequenceType returns 'octets.
func (Octets) SetElementType ¶ added in v1.0.0
SetElementType sets the element-type of the array.
type OutputStream ¶
OutputStream is a *os.Output.
func (*OutputStream) Append ¶
func (obj *OutputStream) Append(b []byte) []byte
Append a buffer with a representation of the Object.
func (*OutputStream) Close ¶ added in v1.0.0
func (obj *OutputStream) Close() (err error)
Close the write if it is a io.Closer
func (*OutputStream) Equal ¶
func (obj *OutputStream) Equal(other Object) bool
Equal returns true if this Object and the other are equal in value.
func (*OutputStream) Eval ¶
func (obj *OutputStream) Eval(s *Scope, depth int) Object
Eval returns self.
func (*OutputStream) Hierarchy ¶
func (obj *OutputStream) Hierarchy() []Symbol
Hierarchy returns the class hierarchy as symbols for the instance.
func (*OutputStream) IsOpen ¶ added in v1.0.0
func (obj *OutputStream) IsOpen() (open bool)
IsOpen return true if the stream is open or false if not.
func (*OutputStream) LastByte ¶ added in v1.0.0
func (obj *OutputStream) LastByte() byte
LastByte returns the last byte written or zero if nothing has been written.
func (*OutputStream) Simplify ¶
func (obj *OutputStream) Simplify() any
Simplify the Object into an int64.
func (*OutputStream) StreamType ¶
func (obj *OutputStream) StreamType() Symbol
StreamType returns 'outputStream.
func (*OutputStream) String ¶
func (obj *OutputStream) String() string
String representation of the Object.
type Package ¶
type Package struct {
Name string
Nicknames []string
Doc string
Imports map[string]*Import
Uses []*Package
Users []*Package
Exports []string
PreSet func(p *Package, name string, value Object) (string, Object)
Locked bool
// contains filtered or unexported fields
}
Package represents a LISP package.
func AllPackages ¶ added in v0.9.5
func AllPackages() []*Package
AllPackages returns a list of all packages.
func DefPackage ¶
DefPackage creates a new package. Calling Import() and Use() after creation is expected.
func FindPackage ¶
FindPackage returns the package matching the provided name.
func PackageFromArg ¶ added in v0.9.5
PackageFromArg returns a package from an argument or panics.
func UnpackName ¶ added in v0.9.5
UnpackName separates the package from the name of a string and returns the package if one was specified, the name, and an indicator that private access is okay which was indicated by the use of a "::" separator.
func (*Package) AllClasses ¶ added in v1.3.1
AllClasses returns list of all classes visible in the package.
func (*Package) DefLambda ¶ added in v0.8.0
func (obj *Package) DefLambda(name string, lam *Lambda, fc func(args List) Object, kind Symbol) (fi *FuncInfo)
DefLambda registers a named lambda function. This is called by defun.
func (*Package) EachClassName ¶ added in v1.3.1
EachClassName call the cb for each class in the package.
func (*Package) EachFuncInfo ¶ added in v0.8.0
EachFuncInfo call the cb for each function in the package.
func (*Package) EachFuncName ¶ added in v0.8.0
EachFuncName call the cb for each function name in the package.
func (*Package) EachVarName ¶ added in v0.8.0
EachVarName call the cb for each function name in the package.
func (*Package) EachVarVal ¶ added in v0.8.0
EachVarVal call the cb for each var in the package.
func (*Package) GetFunc ¶ added in v0.8.0
GetFunc returns the FuncInfo associated with the name which must be lowercase.
func (*Package) Initialize ¶ added in v0.8.0
Initialize the package.
func (*Package) LoadForm ¶ added in v1.3.1
LoadForm returns a form that can be evaluated to create the object.
func (*Package) LoadPath ¶ added in v1.1.0
LoadPath returns then load path if the package was imported by the require function.
func (*Package) Readably ¶ added in v1.3.1
Readably appends the object to a byte slice. If p.Readbly is true the objects is appended in a readable format otherwise a simple append which may or may not be readable.
func (*Package) RegisterClass ¶ added in v1.3.1
RegisterClass registers a class in the package
func (*Package) SetIfHas ¶ added in v0.9.5
SetIfHas sets a variable if the package has that variable.
type Panic ¶
type Panic struct {
Message string
Condition Instance
Value Object // used when the panic function is called
Fatal bool // used in repl to indicate an exit should be made
// contains filtered or unexported fields
}
Panic is used to gather a stack trace when panic occurs.
func WrapError ¶ added in v1.3.1
WrapError creates a Panic that wraps a Instance which is expected to be a clos condition.
func (*Panic) AppendFull ¶ added in v0.7.0
AppendFull appends the message and stack of the error to a byte slice.
func (*Panic) AppendToStack ¶ added in v0.7.0
AppendToStack appends a function name and argument to the stack.
func (*Panic) Equal ¶ added in v0.7.0
Equal returns true if this Object and the other are equal in value.
func (*Panic) Hierarchy ¶ added in v1.3.1
Hierarchy returns the class hierarchy as symbols for the instance.
type PartialPanic ¶ added in v0.7.0
type PartialPanic struct {
// Depth of the read when EOF encountered.
Depth int
// Message for the error.
Message string
}
PartialPanic read panic.
func NewPartial ¶ added in v0.7.0
func NewPartial(depth int, format string, args ...any) *PartialPanic
NewPartial creates a new PartialPanic.
type Placer ¶
type Placer interface {
Funky
// Place the value in the location that the function would normally return
// with an Eval with the same arguments.
Place(s *Scope, args List, value Object)
// SkipArgEval returns true if the argument eval should be skipped.
SkipArgEval(i int) (skip bool)
}
Placer interface for use with functions or macros that expect a placer. (e.g., setf, incf)
type Printer ¶
type Printer struct {
// ANSI backs *print-ansi*.
ANSI bool
// Array backs *print-array*.
Array bool
// Base backs *print-base*.
Base uint
// Case backs *print-case*. A value of nil indicates no transformation.
Case Object
// Circle backs *print-circle*.
Circle bool
// Escape backs *print-escape*.
Escape bool
// Gensym backs *print-gensym*.
Gensym bool
// Lambda should be printed readably *print-lambda* .
Lambda bool
// Length backs *print-length*.
Length uint
// Level backs *print-level*.
Level uint
// Lines backs *print-lines*.
Lines uint
// MiserWidth *print-miser-width*.
MiserWidth uint
// Pretty backs *print-pretty*.
Pretty bool
// Radix backs *print-radix*.
Radix bool
// Readably *print-readably* .
Readably bool
// ReadablyError if true non-readably objects will generate an error.
ReadablyError bool
// RightMargin *print-right-margin*.
RightMargin uint
// Prec backs *print-precision*.
Prec int
}
Printer of Objects. The values of it's members determine how Objects will be encoded for printing.
func (*Printer) ScopedUpdate ¶ added in v1.0.0
ScopedUpdate updates the printer based on values of the values in the provided Scope.
type Ratio ¶
Ratio is a numerator and denominator pair.
func NewBigRatio ¶ added in v1.0.0
NewBigRatio creates a new Ratio.
func (*Ratio) LoadForm ¶ added in v1.3.1
LoadForm returns a form that can be evaluated to create the object.
func (*Ratio) Readably ¶ added in v1.3.1
Readably appends the object to a byte slice. If p.Readbly is true the objects is appended in a readable format otherwise a simple append which may or may not be readable.
type Rational ¶
type Rational interface {
Real
// RationalType returns the rational type of the instance which can be one
// of: fixnum, bignum, or ratio.
RationalType() Symbol
}
Rational exists to allow assertions to determine if an Object is an rational.
type Readble ¶ added in v1.3.1
type Readble interface {
// Readably appends the object to a byte slice. If p.Readbly is true the
// objects is appended in a readable format otherwise a simple append
// which may or may not be readable.
Readably(b []byte, p *Printer) []byte
}
Readble identifies objects that can be written readably.
type Real ¶
type Real interface {
Number
// RealType returns the real type of the instance which can be one of:
// fixnum, bignum, float, or ratio.
RealType() Symbol
// RealValue of the number as a float64.
RealValue() float64
}
Real exists to allow assertions to determine if an Object is an real.
type Receiver ¶ added in v1.3.1
type Receiver interface {
// Receive a method invocation from the send function. Not intended to be
// called by any code other than the send function but is public to allow
// it to be over-ridden.
Receive(s *Scope, message string, args List, depth int) Object
}
Receiver handles methods invoked with the send function. Typically these are Instances or a type that embeds an Instance.
type Ref ¶ added in v1.3.1
Ref refers to an instance slot value.
func (*Ref) Equal ¶ added in v1.3.1
Equal returns true if this Object and the other are equal in value.
func (*Ref) Hierarchy ¶ added in v1.3.1
Hierarchy returns the class hierarchy as symbols for the instance.
type ReturnResult ¶ added in v0.9.5
type ReturnResult struct {
// Tag can be either a Symbol or nil and identifies the block name that
// the results should returned from.
Tag Object
// Result to return.
Result Object
}
ReturnResult is returned by the return-from function.
func (*ReturnResult) Append ¶ added in v0.9.5
func (rr *ReturnResult) Append(b []byte) []byte
Append the object to a byte slice.
func (*ReturnResult) Equal ¶ added in v0.9.5
func (rr *ReturnResult) Equal(other Object) bool
Equal returns true if this Object and the other are equal in value.
func (*ReturnResult) Eval ¶ added in v0.9.5
func (rr *ReturnResult) Eval(s *Scope, depth int) Object
Eval the object.
func (*ReturnResult) Hierarchy ¶ added in v0.9.5
func (rr *ReturnResult) Hierarchy() []Symbol
Hierarchy returns the class hierarchy as symbols for the instance.
func (*ReturnResult) Simplify ¶ added in v0.9.5
func (rr *ReturnResult) Simplify() any
Simplify the Object into simple go types of nil, bool, int64, float64, string, []any, map[string]any, or time.Time.
func (*ReturnResult) String ¶ added in v0.9.5
func (rr *ReturnResult) String() string
String returns a string representation of the object.
type RuneReader ¶ added in v1.3.1
RuneReader is an *os.Reader wrapped to support runes.
func (*RuneReader) Close ¶ added in v1.3.1
func (obj *RuneReader) Close() (err error)
Close the reader if it is a io.Closer
func (*RuneReader) IsOpen ¶ added in v1.3.1
func (obj *RuneReader) IsOpen() bool
IsOpen return true if the stream is open or false if not. Note that EOF also indicates closed.
func (*RuneReader) PushRune ¶ added in v1.3.1
func (obj *RuneReader) PushRune(r rune)
PushRune makes the rune argument the next rune to be read.
func (*RuneReader) Read ¶ added in v1.3.1
func (obj *RuneReader) Read(b []byte) (cnt int, err error)
Read made visible since os.Read functions are not automatically visible.
func (*RuneReader) ReadByte ¶ added in v1.3.1
func (obj *RuneReader) ReadByte() (b byte, err error)
ReadByte reads a byte.
func (*RuneReader) ReadRune ¶ added in v1.3.1
func (obj *RuneReader) ReadRune() (r rune, size int, err error)
ReadRune reads a rune.
func (*RuneReader) UnreadRune ¶ added in v1.3.1
func (obj *RuneReader) UnreadRune() (err error)
UnreadRune unreads a rune.
type RuneStream ¶ added in v1.3.1
type RuneStream interface {
io.Reader
io.Closer
io.RuneScanner
io.ByteReader
// IsOpen return true if the stream is open or false if not. Note that EOF
// also indicates closed.
IsOpen() bool
}
RuneStream defines functions to support reading streams of runes.
type Scope ¶
type Scope struct {
Name Object // can be nil so type can't be Symbol
Vars map[string]Object
Block bool
TagBody bool
Macro bool
Keep bool
// contains filtered or unexported fields
}
Scope encapsulates the scope for a function.
func (*Scope) AllVars ¶ added in v0.7.0
AllVars returns a map of all the variables in the scope and it's parents.
func (*Scope) InBlock ¶ added in v0.9.0
InBlock returns true if the scope is a block and has a matching name or one of the parents IsBlock() returns true.
func (*Scope) Set ¶
Set a variable to the provided value. If sym is bound in this scope the binding is changed to the new value. If not then the parent Set() is called. If no bindings are found before reaching the World then a new world level binding is created.
func (*Scope) SetSynchronized ¶ added in v1.3.1
SetSynchronized set the synchronized mode of the scope.
func (*Scope) Synchronized ¶ added in v1.3.1
Synchronized returns true if the scope is in synchronized mode.
type ScopedAppender ¶ added in v1.3.1
ScopedAppender is an interface for custom appenders that make use of the scope and level.
type Sequence ¶
type Sequence interface {
// SequenceType returns the sequence type of the instance which can be one
// of: string, list, or vector. Breaking with the LISP standard, some
// other types also support the interface.
SequenceType() Symbol
}
Sequence exists to allow assertions to determine if an Object is a sequence.
type SignedByte ¶ added in v1.0.0
type SignedByte struct {
Bytes []byte // low bits at the end, big-endian unsigned
}
SignedByte represents an integer with a specific number of bits. The Bytes are the absolute value of the integer value of the instance.
func SignedByteFromBigInt ¶ added in v1.0.0
func SignedByteFromBigInt(bi *big.Int) *SignedByte
SignedByteFromBigInt creates a new signed-byte from an big.Int.
func SignedByteFromInt64 ¶ added in v1.0.0
func SignedByteFromInt64(i64 int64) *SignedByte
SignedByteFromInt64 creates a new signed-byte from an int64.
func SignedByteFromUint64 ¶ added in v1.0.0
func SignedByteFromUint64(u64 uint64) *SignedByte
SignedByteFromUint64 creates a new signed-byte from an uint64.
func (*SignedByte) Append ¶ added in v1.0.0
func (obj *SignedByte) Append(b []byte) []byte
Append a buffer with a representation of the Object.
func (*SignedByte) AsFixOrBig ¶ added in v1.0.0
func (obj *SignedByte) AsFixOrBig() Object
AsFixOrBig returns the fixnum or bignum equivalent.
func (*SignedByte) Dup ¶ added in v1.0.0
func (obj *SignedByte) Dup() *SignedByte
Dup returns a copy of the instance.
func (*SignedByte) Equal ¶ added in v1.0.0
func (obj *SignedByte) Equal(other Object) (eq bool)
Equal returns true if this Object and the other are equal in value.
func (*SignedByte) Eval ¶ added in v1.0.0
func (obj *SignedByte) Eval(s *Scope, depth int) Object
Eval returns self.
func (*SignedByte) Hierarchy ¶ added in v1.0.0
func (obj *SignedByte) Hierarchy() []Symbol
Hierarchy returns the class hierarchy as symbols for the instance.
func (*SignedByte) Int64 ¶ added in v1.0.0
func (obj *SignedByte) Int64() (i int64)
Int64 of the number.
func (*SignedByte) IntegerType ¶ added in v1.0.0
func (obj *SignedByte) IntegerType() Symbol
IntegerType returns 'signed-byte.
func (*SignedByte) IsInt64 ¶ added in v1.0.0
func (obj *SignedByte) IsInt64() (ii bool)
IsInt64 returns true if the instance can be represented by an int64.
func (*SignedByte) IsNeg ¶ added in v1.0.0
func (obj *SignedByte) IsNeg() bool
IsNeg returns true if the instance is a negative value.
func (*SignedByte) LoadForm ¶ added in v1.3.1
func (obj *SignedByte) LoadForm() Object
LoadForm returns a form that can be evaluated to create the object.
func (*SignedByte) NumberType ¶ added in v1.0.0
func (obj *SignedByte) NumberType() Symbol
NumberType returns 'signed-byte.
func (*SignedByte) RationalType ¶ added in v1.0.0
func (obj *SignedByte) RationalType() Symbol
RationalType returns 'signed-byte.
func (*SignedByte) RealType ¶ added in v1.0.0
func (obj *SignedByte) RealType() Symbol
RealType returns 'signed-byte.
func (*SignedByte) RealValue ¶ added in v1.0.0
func (obj *SignedByte) RealValue() (rv float64)
RealValue of the number as a float64.
func (*SignedByte) SetBit ¶ added in v1.0.0
func (obj *SignedByte) SetBit(index uint, value bool)
SetBit sets the bit at index to the value specified.
func (*SignedByte) Simplify ¶ added in v1.0.0
func (obj *SignedByte) Simplify() any
Simplify the Object into an int64.
func (*SignedByte) Size ¶ added in v1.0.0
func (obj *SignedByte) Size() int
Size of the byte is bits.
func (*SignedByte) String ¶ added in v1.0.0
func (obj *SignedByte) String() string
String representation of the Object.
type Simple ¶
type Simple struct {
Data any
}
Simple is a Simple Object.
type SingleFloat ¶
type SingleFloat float32
SingleFloat is a float32 Object.
func (SingleFloat) Append ¶
func (obj SingleFloat) Append(b []byte) []byte
Append a buffer with a representation of the Object.
func (SingleFloat) Equal ¶
func (obj SingleFloat) Equal(other Object) (eq bool)
Equal returns true if this Object and the other are equal in value.
func (SingleFloat) Eval ¶
func (obj SingleFloat) Eval(s *Scope, depth int) Object
Eval returns self.
func (SingleFloat) FloatType ¶
func (obj SingleFloat) FloatType() Symbol
FloatType returns 'single-float.
func (SingleFloat) Hierarchy ¶
func (obj SingleFloat) Hierarchy() []Symbol
Hierarchy returns the class hierarchy as symbols for the instance.
func (SingleFloat) LoadForm ¶ added in v1.3.1
func (obj SingleFloat) LoadForm() Object
LoadForm returns a form that can be evaluated to create the object.
func (SingleFloat) NumberType ¶
func (obj SingleFloat) NumberType() Symbol
NumberType returns 'single-float.
func (SingleFloat) Readably ¶ added in v1.3.1
func (obj SingleFloat) Readably(b []byte, p *Printer) []byte
Readably appends the object to a byte slice. If p.Readbly is true the objects is appended in a readable format otherwise a simple append which may or may not be readable.
func (SingleFloat) RealType ¶
func (obj SingleFloat) RealType() Symbol
RealType returns 'single-float.
func (SingleFloat) RealValue ¶
func (obj SingleFloat) RealValue() float64
RealValue of the number as a float64.
func (SingleFloat) Simplify ¶
func (obj SingleFloat) Simplify() any
Simplify the Object into a float64.
func (SingleFloat) String ¶
func (obj SingleFloat) String() string
String representation of the Object.
type SpecialSyntax ¶
type SpecialSyntax interface {
// SpecialChar returns the special character for the function.
SpecialPrefix() string
// GetArgs returns the function arguments.
GetArgs() List
}
SpecialSyntax identifies functions with special syntax for writing and reading. This include quote, backquote, and comma.
type Stream ¶
type Stream interface {
Object
// StreamType returns the stream type of the instance which can be one of: file-stream
StreamType() Symbol
// IsOpen return true if the stream is open or false if not or it can not
// be determined.
IsOpen() bool
}
Stream exists to allow assertions to determine if an Object is an stream.
type String ¶
type String string
String is a string Object.
func (String) LoadForm ¶ added in v1.3.1
LoadForm returns a form that can be evaluated to create the object.
type StringStream ¶ added in v1.0.0
type StringStream struct {
// contains filtered or unexported fields
}
StringStream is an input and output stream with seeker support.
func NewStringStream ¶ added in v1.0.0
func NewStringStream(content []byte) *StringStream
NewStringStream initializes a new string-stream with the provided content.
func (*StringStream) Append ¶ added in v1.0.0
func (obj *StringStream) Append(b []byte) []byte
Append a buffer with a representation of the Object.
func (*StringStream) Close ¶ added in v1.0.0
func (obj *StringStream) Close() error
Close the stream but not the input or output streams.
func (*StringStream) Content ¶ added in v1.0.0
func (obj *StringStream) Content() string
Content returns the current buffer as a string.
func (*StringStream) Equal ¶ added in v1.0.0
func (obj *StringStream) Equal(other Object) bool
Equal returns true if this Object and the other are equal in value.
func (*StringStream) Eval ¶ added in v1.0.0
func (obj *StringStream) Eval(s *Scope, depth int) Object
Eval returns self.
func (*StringStream) Hierarchy ¶ added in v1.0.0
func (obj *StringStream) Hierarchy() []Symbol
Hierarchy returns the class hierarchy as symbols for the instance.
func (*StringStream) IsOpen ¶ added in v1.0.0
func (obj *StringStream) IsOpen() bool
IsOpen return true if the stream is open or false if not.
func (*StringStream) LastByte ¶ added in v1.0.0
func (obj *StringStream) LastByte() (b byte)
LastByte returns the last byte written or zero if nothing has been written.
func (*StringStream) Read ¶ added in v1.0.0
func (obj *StringStream) Read(p []byte) (n int, err error)
Read from the current position in the buf. This is part of the io.Reader interface.
func (*StringStream) ReadAt ¶ added in v1.0.0
func (obj *StringStream) ReadAt(p []byte, off int64) (n int, err error)
ReadAt from the off in the buf and does not advance pos. This is part of the io.ReaderAt interface.
func (*StringStream) ReadByte ¶ added in v1.3.1
func (obj *StringStream) ReadByte() (b byte, err error)
ReadByte reads a byte.
func (*StringStream) ReadRune ¶ added in v1.0.0
func (obj *StringStream) ReadRune() (r rune, size int, err error)
ReadRune returns the next rune in buf from the current position. This is part of the io.RuneReader interface.
func (*StringStream) Seek ¶ added in v1.0.0
func (obj *StringStream) Seek(offset int64, whence int) (n int64, err error)
Seek moves the pos in buf. This is part of the io.Seeker interface.
func (*StringStream) Simplify ¶ added in v1.0.0
func (obj *StringStream) Simplify() any
Simplify the Object into string.
func (*StringStream) StreamType ¶ added in v1.0.0
func (obj *StringStream) StreamType() Symbol
StreamType returns 'stringStream.
func (*StringStream) String ¶ added in v1.0.0
func (obj *StringStream) String() string
String representation of the Object.
func (*StringStream) UnreadRune ¶ added in v1.3.1
func (obj *StringStream) UnreadRune() error
ReadByte reads a byte.
type Symbol ¶
type Symbol string
Symbol is a symbol Object.
func (Symbol) LoadForm ¶ added in v1.3.1
LoadForm returns a form that can be evaluated to create the object.
type Tail ¶
type Tail struct {
Value Object // always non-nil
}
Tail is used to indicate the []Object is sons and not a list. The difference between a list and a cons in LISP is that the cdr of the last cons cell in a list is nil while if the last cdr in a list is a value then the list is actually a cons.
type Time ¶
Time is a time.Time Object. It might be better in the pkg/gi package but then it could not be used in the SimpleObject conversion function so instead it is a core (slip) type and the time related functions are in the pkg/gi package.
func (Time) HasMethod ¶ added in v0.9.7
HasMethod returns true if the instance handles the named method.
func (Time) LoadForm ¶ added in v1.3.1
LoadForm returns a form that can be evaluated to create the object.
type Undefined ¶
type Undefined string
Undefined represents an undefined value.
type UnsignedByte ¶ added in v1.0.0
type UnsignedByte struct {
Bytes []byte // low bits at the end, big-endian ununsigned
}
UnsignedByte represents an integer with a specific number of bits. The type is a struct so that growing the bytes does not cause a new instance to be created.
func (*UnsignedByte) Append ¶ added in v1.0.0
func (obj *UnsignedByte) Append(b []byte) []byte
Append a buffer with a representation of the Object.
func (*UnsignedByte) AsFixOrBig ¶ added in v1.0.0
func (obj *UnsignedByte) AsFixOrBig() Object
AsFixOrBig returns the fixnum or bignum equivalent.
func (*UnsignedByte) Dup ¶ added in v1.0.0
func (obj *UnsignedByte) Dup() *UnsignedByte
Dup returns a copy of the instance.
func (*UnsignedByte) Equal ¶ added in v1.0.0
func (obj *UnsignedByte) Equal(other Object) (eq bool)
Equal returns true if this Object and the other are equal in value.
func (*UnsignedByte) Eval ¶ added in v1.0.0
func (obj *UnsignedByte) Eval(s *Scope, depth int) Object
Eval returns self.
func (*UnsignedByte) GetBit ¶ added in v1.0.0
func (obj *UnsignedByte) GetBit(index uint) (value bool)
GetBit gets the bit at index and returns a boolean value.
func (*UnsignedByte) Hierarchy ¶ added in v1.0.0
func (obj *UnsignedByte) Hierarchy() []Symbol
Hierarchy returns the class hierarchy as symbols for the instance.
func (*UnsignedByte) Int64 ¶ added in v1.0.0
func (obj *UnsignedByte) Int64() (i int64)
Int64 of the number.
func (*UnsignedByte) IntegerType ¶ added in v1.0.0
func (obj *UnsignedByte) IntegerType() Symbol
IntegerType returns 'unsigned-byte.
func (*UnsignedByte) Invert ¶ added in v1.0.0
func (obj *UnsignedByte) Invert()
Invert the bits or NOT (complement) of each bit.
func (*UnsignedByte) IsInt64 ¶ added in v1.0.0
func (obj *UnsignedByte) IsInt64() (ii bool)
IsInt64 returns true if the instance can be represented by an int64.
func (*UnsignedByte) LoadForm ¶ added in v1.3.1
func (obj *UnsignedByte) LoadForm() Object
LoadForm returns a form that can be evaluated to create the object.
func (*UnsignedByte) NumberType ¶ added in v1.0.0
func (obj *UnsignedByte) NumberType() Symbol
NumberType returns 'unsigned-byte.
func (*UnsignedByte) RationalType ¶ added in v1.0.0
func (obj *UnsignedByte) RationalType() Symbol
RationalType returns 'unsigned-byte.
func (*UnsignedByte) RealType ¶ added in v1.0.0
func (obj *UnsignedByte) RealType() Symbol
RealType returns 'unsigned-byte.
func (*UnsignedByte) RealValue ¶ added in v1.0.0
func (obj *UnsignedByte) RealValue() (rv float64)
RealValue of the number as a float64.
func (*UnsignedByte) SetBit ¶ added in v1.0.0
func (obj *UnsignedByte) SetBit(index uint, value bool)
SetBit sets the bit at index to the value specified.
func (*UnsignedByte) Simplify ¶ added in v1.0.0
func (obj *UnsignedByte) Simplify() any
Simplify the Object into an int64.
func (*UnsignedByte) Size ¶ added in v1.0.0
func (obj *UnsignedByte) Size() int
Size of the byte is bits.
func (*UnsignedByte) String ¶ added in v1.0.0
func (obj *UnsignedByte) String() string
String representation of the Object.
type Values ¶
type Values []Object
Values of Objects. Only used for multiple return values.
type VarVal ¶
type VarVal struct {
Val Object
Get func() Object
Set func(Object)
Doc string
Pkg *Package // package interned in
Export bool
Const bool
// contains filtered or unexported fields
}
VarVal hold the information about a variable value.
func (*VarVal) Equal ¶ added in v0.9.5
Equal returns true if this Object and the other are equal in value.
func (*VarVal) Hierarchy ¶ added in v0.9.5
Hierarchy returns the class hierarchy as symbols for the instance.
type Vector ¶
Vector is a vector Object.
func NewVector ¶ added in v0.9.5
func NewVector(dim int, elementType Symbol, initElement Object, elements List, adjustable bool) *Vector
NewVector creates a new Vector. If fillPtr is not used then it should be -1.
func (*Vector) Adjust ¶ added in v0.9.5
func (obj *Vector) Adjust( dims []int, elementType Symbol, initElement Object, initContent List, fillPtr int) VectorLike
Adjust array with new parameters.
func (*Vector) FillPointer ¶ added in v1.0.0
FillPointer returns the fill-pointer as an int.
func (*Vector) Pop ¶ added in v0.9.5
Pop a value from the vector. The vector elements are not changed if there is a fill-pointer. If there is no fill pointer then the length of the vector is shortened by one.
func (*Vector) SequenceType ¶
SequenceType returns 'vector.
func (*Vector) SetFillPointer ¶ added in v1.0.0
SetFillPointer sets the fill-pointer.
type VectorLike ¶ added in v1.0.0
type VectorLike interface {
ArrayLike
// Adjust array with new parameters.
Adjust(dims []int, eType Symbol, initVal Object, initContent List, fillPtr int) VectorLike
}
VectorLike is an interface that all vectors implement.
type WhopLoc ¶ added in v1.3.1
func (*WhopLoc) Equal ¶ added in v1.3.1
Equal returns true if this Object and the other are equal in value.
func (*WhopLoc) Hierarchy ¶ added in v1.3.1
Hierarchy returns the class hierarchy as symbols for the whopLoc.
Source Files
¶
- app.go
- apparg.go
- argcounterror.go
- arithmetic-error.go
- array.go
- arraylike.go
- bignum.go
- bit-vector.go
- bit.go
- boundcaller.go
- byte.go
- caller.go
- cell-error.go
- character.go
- class-not-found.go
- class.go
- clpkg.go
- code.go
- coerce.go
- combination.go
- complex.go
- condition.go
- control-error.go
- describer.go
- division-by-zero.go
- doc.go
- doublefloat.go
- dynamic.go
- end-of-file.go
- error.go
- file-error.go
- file-stream.go
- fillptrvector.go
- fixnum.go
- float.go
- funcdoc.go
- funcinfo.go
- function.go
- funky.go
- hash-table.go
- hook.go
- import.go
- input-stream.go
- instance.go
- integer.go
- invalid-method-error.go
- io-stream.go
- keywordpkg.go
- lambda.go
- lastbytepeeker.go
- list.go
- loadformer.go
- locker.go
- longfloat.go
- marker.go
- method.go
- no-applicable-method-error.go
- normalizenumber.go
- novalue.go
- number.go
- object.go
- octet.go
- octets.go
- output-stream.go
- package-error.go
- package.go
- panic.go
- parse-error.go
- partialpanic.go
- placer.go
- print-not-readable.go
- printer.go
- program-error.go
- ratio.go
- rational.go
- readable.go
- reader-error.go
- real.go
- receiver.go
- ref.go
- returnresult.go
- runereader.go
- runestream.go
- scope.go
- scopedappender.go
- sequence.go
- serious-condition.go
- shortfloat.go
- signed-byte.go
- simple.go
- singlefloat.go
- slip.go
- specialsyntax.go
- stream-error.go
- stream.go
- string-stream.go
- string.go
- symbol.go
- tail.go
- time.go
- trace.go
- true.go
- type-error.go
- unbound-slot.go
- unbound-variable.go
- unbound.go
- undefined-function.go
- undefined.go
- unsigned-byte.go
- userpkg.go
- values.go
- var.go
- varval.go
- vector.go
- vectorlike.go
- warning.go
- whoploc.go
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
slip
command
Package main is the main package.
|
Package main is the main package. |
|
Package pkg pulls in all sub-packages.
|
Package pkg pulls in all sub-packages. |
|
bag
Package bag contains the bag functions.
|
Package bag contains the bag functions. |
|
cl
Package cl contains the common-lisp functions.
|
Package cl contains the common-lisp functions. |
|
clos
Package clos contains the functions and types to support CLOS (Common LISP Object System).
|
Package clos contains the functions and types to support CLOS (Common LISP Object System). |
|
csv
Package csv contains the functions for CSV reading and writing.
|
Package csv contains the functions for CSV reading and writing. |
|
flavors
Package flavors contains the flavors functions.
|
Package flavors contains the flavors functions. |
|
generic
Package generic contains the functions and types to support generics.
|
Package generic contains the functions and types to support generics. |
|
gi
Package gi contains the functions that provide better integration with go so a Go Integration (GI) package.
|
Package gi contains the functions that provide better integration with go so a Go Integration (GI) package. |
|
net
Package net includes networking support.
|
Package net includes networking support. |
|
repl
Package repl includes the types and functions for a Read Eval Print Loop.
|
Package repl includes the types and functions for a Read Eval Print Loop. |
|
repl/term
Package term provides support functions for dealing with terminals, as commonly found on UNIX systems.
|
Package term provides support functions for dealing with terminals, as commonly found on UNIX systems. |
|
watch
Package watch contains the watch functions and flavors which provide a means to watch global variables and invoke lisp functions from a remote process.
|
Package watch contains the watch functions and flavors which provide a means to watch global variables and invoke lisp functions from a remote process. |
|
xml
Package xml contains the functions for XML reading and writing.
|
Package xml contains the functions for XML reading and writing. |
|
Package pp implements a LISP pretty printer.
|
Package pp implements a LISP pretty printer. |
|
Package sliptest includes test tools for the slip package.
|
Package sliptest includes test tools for the slip package. |
|
test
|
|
|
appplugin
command
|
|
|
cl/testplugin
command
|