Documentation
¶
Overview ¶
Package clos contains the functions and types to support CLOS (Common LISP Object System).
Index ¶
- Constants
- Variables
- type AllocateInstance
- type BuiltInClass
- func (c *BuiltInClass) Append(b []byte) []byte
- func (c *BuiltInClass) Describe(b []byte, indent, right int, ansi bool) []byte
- func (c *BuiltInClass) Documentation() string
- func (c *BuiltInClass) Equal(other slip.Object) (eq bool)
- func (c *BuiltInClass) Eval(s *slip.Scope, depth int) slip.Object
- func (c *BuiltInClass) Hierarchy() []slip.Symbol
- func (c *BuiltInClass) Inherits(sc slip.Class) bool
- func (c *BuiltInClass) InheritsList() (ca []slip.Class)
- func (c *BuiltInClass) LoadForm() slip.Object
- func (c *BuiltInClass) MakeInstance() slip.Instance
- func (c *BuiltInClass) Metaclass() slip.Symbol
- func (c *BuiltInClass) Name() string
- func (c *BuiltInClass) Pkg() *slip.Package
- func (c *BuiltInClass) SetDocumentation(doc string)
- func (c *BuiltInClass) Simplify() any
- func (c *BuiltInClass) String() string
- func (c *BuiltInClass) VarNames() []string
- type ChangeClass
- type ClassMetaclass
- type ClassName
- type ClassOf
- type ClassPrecedence
- type ClassSupers
- type ConditionClass
- func (c *ConditionClass) Append(b []byte) []byte
- func (c *ConditionClass) Equal(other slip.Object) (eq bool)
- func (c *ConditionClass) Eval(s *slip.Scope, depth int) slip.Object
- func (c *ConditionClass) Hierarchy() []slip.Symbol
- func (c *ConditionClass) LoadForm() slip.Object
- func (c *ConditionClass) MakeInstance() slip.Instance
- func (c *ConditionClass) Metaclass() slip.Symbol
- func (c *ConditionClass) String() string
- type Defclass
- type DefineCondition
- type FindClass
- type HasSlots
- func (obj *HasSlots) AddSlot(sym slip.Symbol, value slip.Object)
- func (obj *HasSlots) Init(synchronize bool)
- func (obj *HasSlots) Lock()
- func (obj *HasSlots) RemoveSlot(sym slip.Symbol)
- func (obj *HasSlots) SetSlotValue(sym slip.Symbol, value slip.Object) (has bool)
- func (obj *HasSlots) SetSynchronized(on bool)
- func (obj *HasSlots) Simplify() any
- func (obj *HasSlots) SlotNames() []string
- func (obj *HasSlots) SlotValue(sym slip.Symbol) (value slip.Object, has bool)
- func (obj *HasSlots) Synchronized() bool
- func (obj *HasSlots) Unlock()
- func (obj *HasSlots) Vars() map[string]slip.Object
- type InitializeInstance
- type ListAllClasses
- type MakeInstance
- type SharedInitialize
- type SlotBoundp
- type SlotDef
- type SlotExistsp
- type SlotMakunbound
- type SlotValue
- type StandardClass
- func (c *StandardClass) Append(b []byte) []byte
- func (c *StandardClass) Describe(b []byte, indent, right int, ansi bool) []byte
- func (c *StandardClass) Documentation() string
- func (c *StandardClass) Equal(other slip.Object) (eq bool)
- func (c *StandardClass) Eval(s *slip.Scope, depth int) slip.Object
- func (c *StandardClass) GetMethod(name string) *slip.Method
- func (c *StandardClass) Hierarchy() []slip.Symbol
- func (c *StandardClass) Inherits(sc slip.Class) bool
- func (c *StandardClass) InheritsList() []slip.Class
- func (c *StandardClass) LoadForm() slip.Object
- func (c *StandardClass) MakeInstance() slip.Instance
- func (c *StandardClass) Metaclass() slip.Symbol
- func (obj *StandardClass) MethodNames() slip.List
- func (obj *StandardClass) Methods() map[string]*slip.Method
- func (c *StandardClass) Name() string
- func (c *StandardClass) Pkg() *slip.Package
- func (c *StandardClass) Ready() bool
- func (c *StandardClass) SetDocumentation(doc string)
- func (c *StandardClass) Simplify() any
- func (c *StandardClass) String() string
- func (c *StandardClass) VarNames() []string
- type StandardObject
- func (obj *StandardObject) Append(b []byte) []byte
- func (obj *StandardObject) Class() slip.Class
- func (obj *StandardObject) Describe(b []byte, indent, right int, ansi bool) []byte
- func (obj *StandardObject) Dup() slip.Instance
- func (obj *StandardObject) Equal(other slip.Object) bool
- func (obj *StandardObject) Eval(s *slip.Scope, depth int) slip.Object
- func (obj *StandardObject) GetMethod(name string) *slip.Method
- func (obj *StandardObject) Hierarchy() []slip.Symbol
- func (obj *StandardObject) ID() uint64
- func (obj *StandardObject) Init(scope *slip.Scope, args slip.List, depth int)
- func (obj *StandardObject) IsA(class string) bool
- func (obj *StandardObject) LoadForm() slip.Object
- func (obj *StandardObject) MethodNames() slip.List
- func (obj *StandardObject) Receive(s *slip.Scope, message string, args slip.List, depth int) slip.Object
- func (obj *StandardObject) SetSlotValue(sym slip.Symbol, value slip.Object) (has bool)
- func (obj *StandardObject) Simplify() interface{}
- func (obj *StandardObject) SlotNames() []string
- func (obj *StandardObject) SlotValue(sym slip.Symbol) (value slip.Object, has bool)
- func (obj *StandardObject) String() string
- type WithSlots
Constants ¶
const ( // ConditionSymbol is the symbol with a value of "condition". ConditionSymbol = slip.Symbol("condition") // SeriousConditionSymbol is the symbol with a value of "serious-condition". SeriousConditionSymbol = slip.Symbol("serious-condition") // WarningSymbol is the symbol with a value of "warning". WarningSymbol = slip.Symbol("warning") // ErrorSymbol is the symbol with a value of "error". ErrorSymbol = slip.Symbol("error") // ArithmeticErrorSymbol is the symbol with a value of "arithmetic-error". ArithmeticErrorSymbol = slip.Symbol("arithmetic-error") // DivisionByZeroSymbol is the symbol with a value of "division-by-zero". DivisionByZeroSymbol = slip.Symbol("division-by-zero") // ControlErrorSymbol is the symbol with a value of "control-error". ControlErrorSymbol = slip.Symbol("control-error") // FileErrorSymbol is the symbol with a value of "file-error". FileErrorSymbol = slip.Symbol("file-error") // PackageErrorSymbol is the symbol with a value of "package-error". PackageErrorSymbol = slip.Symbol("package-error") // ProgramErrorSymbol is the symbol with a value of "program-error". ProgramErrorSymbol = slip.Symbol("program-error") // TypeErrorSymbol is the symbol with a value of "type-error". TypeErrorSymbol = slip.Symbol("type-error") // ParseErrorSymbol is the symbol with a value of "parse-error". ParseErrorSymbol = slip.Symbol("parse-error") // StreamErrorSymbol is the symbol with a value of "stream-error". StreamErrorSymbol = slip.Symbol("stream-error") // ReaderErrorSymbol is the symbol with a value of "reader-error". ReaderErrorSymbol = slip.Symbol("reader-error") // EndOfFileSymbol is the symbol with a value of "end-of-file". EndOfFileSymbol = slip.Symbol("end-of-file") // CellErrorSymbol is the symbol with a value of "cell-error". CellErrorSymbol = slip.Symbol("cell-error") // UnboundSlotSymbol is the symbol with a value of "unbound-slot". UnboundSlotSymbol = slip.Symbol("unbound-slot") // UnboundVariableSymbol is the symbol with a value of "unbound-variable". UnboundVariableSymbol = slip.Symbol("unbound-variable") // UndefinedFunctionSymbol is the symbol with a value of "undefined-function". UndefinedFunctionSymbol = slip.Symbol("undefined-function") // SimpleConditionSymbol is the symbol with a value of "simple-condition". SimpleConditionSymbol = slip.Symbol("simple-condition") // SimpleErrorSymbol is the symbol with a value of "simple-error". SimpleErrorSymbol = slip.Symbol("simple-error") // SimpleTypeErrorSymbol is the symbol with a value of "simple-type-error". SimpleTypeErrorSymbol = slip.Symbol("simple-type-error") // SimpleWarningSymbol is the symbol with a value of "simple-warning". SimpleWarningSymbol = slip.Symbol("simple-warning") // ClassNotFoundSymbol is the symbol with a value of "class-not-found". ClassNotFoundSymbol = slip.Symbol("class-not-found") // InvalidMethodErrorSymbol is the symbol with a value of "invalid-method-error". InvalidMethodErrorSymbol = slip.Symbol("invalid-method-error") // PrintNotReadableSymbol is the symbol with a value of "print-not-readable". PrintNotReadableSymbol = slip.Symbol("print-not-readable") // NoApplicableMethodErrorSymbol is the symbol with a value of "no-applicable-method-error". NoApplicableMethodErrorSymbol = slip.Symbol("no-applicable-method-error") )
const ( // StandardClassSymbol is the symbol with a value of "standard-class". StandardClassSymbol = slip.Symbol("standard-class") // ClassSymbol is the symbol with a value of "class". ClassSymbol = slip.Symbol("class") )
const ( // BuiltInClassSymbol is the symbol with a value of "built-in-class". BuiltInClassSymbol = slip.Symbol("built-in-class") )
const ConditionClassSymbol = slip.Symbol("condition-class")
ConditionClassSymbol is the symbol with a value of "condition-class".
const StandardObjectSymbol = slip.Symbol("standard-object")
StandardObjectSymbol is the symbol with a value of "standard-object".
Variables ¶
var ( // Pkg is the Class package. Pkg = slip.Package{ Name: "clos", Nicknames: []string{"clos"}, Doc: "Home of symbols defined for the CLOS functions, variables, and constants.", PreSet: slip.DefaultPreSet, } )
Functions ¶
This section is empty.
Types ¶
type AllocateInstance ¶
AllocateInstance represents the makeInstance function.
type BuiltInClass ¶ added in v1.3.1
type BuiltInClass struct {
// contains filtered or unexported fields
}
BuiltInClass is the built-in-class.
func (*BuiltInClass) Append ¶ added in v1.3.1
func (c *BuiltInClass) Append(b []byte) []byte
Append a buffer with a representation of the Object.
func (*BuiltInClass) Describe ¶ added in v1.3.1
func (c *BuiltInClass) Describe(b []byte, indent, right int, ansi bool) []byte
Describe the class in detail.
func (*BuiltInClass) Documentation ¶ added in v1.3.1
func (c *BuiltInClass) Documentation() string
Documentation of the class.
func (*BuiltInClass) Equal ¶ added in v1.3.1
func (c *BuiltInClass) Equal(other slip.Object) (eq bool)
Equal returns true if this Object and the other are equal in value.
func (*BuiltInClass) Hierarchy ¶ added in v1.3.1
func (c *BuiltInClass) Hierarchy() []slip.Symbol
Hierarchy returns the class hierarchy as symbols for the instance.
func (*BuiltInClass) Inherits ¶ added in v1.3.1
func (c *BuiltInClass) Inherits(sc slip.Class) bool
Inherits returns true if this Class inherits from a specified Class.
func (*BuiltInClass) InheritsList ¶ added in v1.3.1
func (c *BuiltInClass) InheritsList() (ca []slip.Class)
InheritsList returns a list of all inherited classes.
func (*BuiltInClass) LoadForm ¶ added in v1.3.1
func (c *BuiltInClass) LoadForm() slip.Object
LoadForm returns a list that can be evaluated to create the class or nil if the class is a built in class.
func (*BuiltInClass) MakeInstance ¶ added in v1.3.1
func (c *BuiltInClass) MakeInstance() slip.Instance
MakeInstance creates a new instance but does not call the :init method.
func (*BuiltInClass) Metaclass ¶ added in v1.3.1
func (c *BuiltInClass) Metaclass() slip.Symbol
Metaclass returns the symbol built-in-class.
func (*BuiltInClass) Pkg ¶ added in v1.3.1
func (c *BuiltInClass) Pkg() *slip.Package
Pkg returns the package the class was defined in.
func (*BuiltInClass) SetDocumentation ¶ added in v1.3.1
func (c *BuiltInClass) SetDocumentation(doc string)
SetDocumentation of the class.
func (*BuiltInClass) Simplify ¶ added in v1.3.1
func (c *BuiltInClass) Simplify() any
Simplify by returning the string representation of the class.
func (*BuiltInClass) String ¶ added in v1.3.1
func (c *BuiltInClass) String() string
String representation of the Object.
func (*BuiltInClass) VarNames ¶ added in v1.3.1
func (c *BuiltInClass) VarNames() []string
VarNames for DefMethod, requiredVars and defaultVars combined.
type ChangeClass ¶ added in v1.0.0
ChangeClass represents the change-class function.
type ClassMetaclass ¶ added in v1.3.1
ClassMetaclass represents the class-metaclass function.
type ClassPrecedence ¶ added in v1.3.1
ClassPrecedence represents the class-precedence function.
type ClassSupers ¶ added in v1.3.1
ClassSupers represents the class-supers function.
type ConditionClass ¶ added in v1.3.1
type ConditionClass struct {
StandardClass
}
ConditionClass is a CLOS condition-class.
func DefConditionClass ¶ added in v1.3.1
func DefConditionClass( s *slip.Scope, name string, supers, slotSpecs, classOptions slip.List, depth int) *ConditionClass
DefConditionClass defines a standard-class.
func (*ConditionClass) Append ¶ added in v1.3.1
func (c *ConditionClass) Append(b []byte) []byte
Append a buffer with a representation of the Object.
func (*ConditionClass) Equal ¶ added in v1.3.1
func (c *ConditionClass) Equal(other slip.Object) (eq bool)
Equal returns true if this Object and the other are equal in value.
func (*ConditionClass) Hierarchy ¶ added in v1.3.1
func (c *ConditionClass) Hierarchy() []slip.Symbol
Hierarchy returns the class hierarchy as symbols for the instance.
func (*ConditionClass) LoadForm ¶ added in v1.3.1
func (c *ConditionClass) LoadForm() slip.Object
LoadForm returns a list that can be evaluated to create the class or nil if the class is a built in class.
func (*ConditionClass) MakeInstance ¶ added in v1.3.1
func (c *ConditionClass) MakeInstance() slip.Instance
MakeInstance creates a new instance but does not call the :init method.
func (*ConditionClass) Metaclass ¶ added in v1.3.1
func (c *ConditionClass) Metaclass() slip.Symbol
Metaclass returns the symbol condition-class.
func (*ConditionClass) String ¶ added in v1.3.1
func (c *ConditionClass) String() string
String representation of the Object.
type DefineCondition ¶ added in v1.3.1
DefineCondition represents the define-condition function.
type HasSlots ¶ added in v1.3.1
type HasSlots struct {
// contains filtered or unexported fields
}
HasSlots is an instance of a Flavor.
func (*HasSlots) Lock ¶ added in v1.3.1
func (obj *HasSlots) Lock()
Lock the scope to synchronize changes.
func (*HasSlots) RemoveSlot ¶ added in v1.3.1
RemoveSlot remove a slot.
func (*HasSlots) SetSlotValue ¶ added in v1.3.1
SetSlotValue sets the value of an instance variable.
func (*HasSlots) SetSynchronized ¶ added in v1.3.1
SetSynchronized set the synchronized mode of the scope.
func (*HasSlots) Simplify ¶ added in v1.3.1
Simplify by returning the string representation of the flavor.
func (*HasSlots) SlotNames ¶ added in v1.3.1
SlotNames returns a list of the slots names for the instance.
func (*HasSlots) Synchronized ¶ added in v1.3.1
Synchronized returns true if the scope is in synchronized mode.
type InitializeInstance ¶ added in v1.3.1
InitializeInstance represents the initialize-instance function.
type ListAllClasses ¶ added in v1.3.1
ListAllClasses represents the list-all-classes function.
type MakeInstance ¶
MakeInstance represents the make-instance function.
type SharedInitialize ¶ added in v1.3.1
type SharedInitialize struct {
// contains filtered or unexported fields
}
SharedInitialize represents the shared-initialize function.
type SlotBoundp ¶ added in v0.9.6
SlotBoundp represents the slot-boundp function.
type SlotDef ¶ added in v1.3.1
type SlotDef struct {
// contains filtered or unexported fields
}
SlotDef encapsulates the definition of a slot on a class.
func NewSlotDef ¶ added in v1.3.1
NewSlotDef creates a new SlotDef from a slot-specification provided to defclass.
type SlotExistsp ¶ added in v0.9.6
SlotExistsp represents the slot-exists-p function.
type SlotMakunbound ¶ added in v0.9.6
SlotMakunbound represents the slot-makunbound function.
type SlotValue ¶ added in v0.9.6
SlotValue represents the slot-value function.
type StandardClass ¶ added in v1.3.1
StandardClass is a CLOS standard-class.
func DefStandardClass ¶ added in v1.3.1
func DefStandardClass(s *slip.Scope, name string, supers, slotSpecs, classOptions slip.List, depth int) *StandardClass
DefStandardClass defines a standard-class.
func (*StandardClass) Append ¶ added in v1.3.1
func (c *StandardClass) Append(b []byte) []byte
Append a buffer with a representation of the Object.
func (*StandardClass) Describe ¶ added in v1.3.1
func (c *StandardClass) Describe(b []byte, indent, right int, ansi bool) []byte
Describe the class in detail.
func (*StandardClass) Documentation ¶ added in v1.3.1
func (c *StandardClass) Documentation() string
Documentation of the class.
func (*StandardClass) Equal ¶ added in v1.3.1
func (c *StandardClass) Equal(other slip.Object) (eq bool)
Equal returns true if this Object and the other are equal in value.
func (*StandardClass) GetMethod ¶ added in v1.3.1
func (c *StandardClass) GetMethod(name string) *slip.Method
GetMethod returns the method if it exists.
func (*StandardClass) Hierarchy ¶ added in v1.3.1
func (c *StandardClass) Hierarchy() []slip.Symbol
Hierarchy returns the class hierarchy as symbols for the instance.
func (*StandardClass) Inherits ¶ added in v1.3.1
func (c *StandardClass) Inherits(sc slip.Class) bool
Inherits returns true if this Class inherits from a specified Class.
func (*StandardClass) InheritsList ¶ added in v1.3.1
func (c *StandardClass) InheritsList() []slip.Class
InheritsList returns a list of all inherited classes.
func (*StandardClass) LoadForm ¶ added in v1.3.1
func (c *StandardClass) LoadForm() slip.Object
LoadForm returns a list that can be evaluated to create the class or nil if the class is a built in class.
func (*StandardClass) MakeInstance ¶ added in v1.3.1
func (c *StandardClass) MakeInstance() slip.Instance
MakeInstance creates a new instance but does not call the :init method.
func (*StandardClass) Metaclass ¶ added in v1.3.1
func (c *StandardClass) Metaclass() slip.Symbol
Metaclass returns the symbol standard-class.
func (*StandardClass) MethodNames ¶ added in v1.3.1
func (obj *StandardClass) MethodNames() slip.List
MethodNames returns a sorted list of the methods of the class.
func (*StandardClass) Methods ¶ added in v1.3.1
func (obj *StandardClass) Methods() map[string]*slip.Method
Methods returns a map of the methods.
func (*StandardClass) Name ¶ added in v1.3.1
func (c *StandardClass) Name() string
Name of the class.
func (*StandardClass) Pkg ¶ added in v1.3.1
func (c *StandardClass) Pkg() *slip.Package
Pkg returns the package the class was defined in.
func (*StandardClass) Ready ¶ added in v1.3.1
func (c *StandardClass) Ready() bool
Ready returns true when the class is ready for use or that all superclasses have been defined and merged.
func (*StandardClass) SetDocumentation ¶ added in v1.3.1
func (c *StandardClass) SetDocumentation(doc string)
SetDocumentation of the class.
func (*StandardClass) Simplify ¶ added in v1.3.1
func (c *StandardClass) Simplify() any
Simplify by returning the string representation of the class.
func (*StandardClass) String ¶ added in v1.3.1
func (c *StandardClass) String() string
String representation of the Object.
func (*StandardClass) VarNames ¶ added in v1.3.1
func (c *StandardClass) VarNames() []string
VarNames for DefMethod, requiredVars and defaultVars combined.
type StandardObject ¶ added in v1.3.1
type StandardObject struct {
HasSlots
Type isStandardClass
}
StandardObject is an instance of a standard-class.
func (*StandardObject) Append ¶ added in v1.3.1
func (obj *StandardObject) Append(b []byte) []byte
Append a buffer with a representation of the Object.
func (*StandardObject) Class ¶ added in v1.3.1
func (obj *StandardObject) Class() slip.Class
Class returns the flavor of the instance.
func (*StandardObject) Describe ¶ added in v1.3.1
func (obj *StandardObject) Describe(b []byte, indent, right int, ansi bool) []byte
Describe the instance in detail.
func (*StandardObject) Dup ¶ added in v1.3.1
func (obj *StandardObject) Dup() slip.Instance
Dup returns a duplicate of the instance.
func (*StandardObject) Equal ¶ added in v1.3.1
func (obj *StandardObject) Equal(other slip.Object) bool
Equal returns true if this Object and the other are equal in value.
func (*StandardObject) GetMethod ¶ added in v1.3.1
func (obj *StandardObject) GetMethod(name string) *slip.Method
GetMethod returns the method if it exists.
func (*StandardObject) Hierarchy ¶ added in v1.3.1
func (obj *StandardObject) Hierarchy() []slip.Symbol
Hierarchy returns the class hierarchy as symbols for the instance.
func (*StandardObject) ID ¶ added in v1.3.1
func (obj *StandardObject) ID() uint64
ID returns unique ID for the instance.
func (*StandardObject) Init ¶ added in v1.3.1
Init the instance slots from the provided args list. If the scope is not nil then send :init is called.
func (*StandardObject) IsA ¶ added in v1.3.1
func (obj *StandardObject) IsA(class string) bool
IsA return true if the instance is of a class that inherits from the provided class.
func (*StandardObject) LoadForm ¶ added in v1.3.1
func (obj *StandardObject) LoadForm() slip.Object
LoadForm returns a form that can be evaluated to create the object.
func (*StandardObject) MethodNames ¶ added in v1.3.1
func (obj *StandardObject) MethodNames() slip.List
MethodNames returns a sorted list of the methods of the instance.
func (*StandardObject) Receive ¶ added in v1.3.1
func (obj *StandardObject) Receive(s *slip.Scope, message string, args slip.List, depth int) slip.Object
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.
func (*StandardObject) SetSlotValue ¶ added in v1.3.1
SetSlotValue sets the value of an instance variable.
func (*StandardObject) Simplify ¶ added in v1.3.1
func (obj *StandardObject) Simplify() interface{}
Simplify by returning the string representation of the flavor.
func (*StandardObject) SlotNames ¶ added in v1.3.1
func (obj *StandardObject) SlotNames() []string
SlotNames returns a list of the slots names for the instance.
func (*StandardObject) SlotValue ¶ added in v1.3.1
SlotValue return the value of an instance variable.
func (*StandardObject) String ¶ added in v1.3.1
func (obj *StandardObject) String() string
String representation of the Object.
Source Files
¶
- allocate-instance.go
- built-in-class.go
- built-in.go
- change-class.go
- class-metaclass.go
- class-name.go
- class-of.go
- class-precedence.go
- class-supers.go
- condition-class.go
- conditions.go
- defclass.go
- define-condition.go
- doc.go
- find-class.go
- hasslots.go
- initialize-instance.go
- isstandardclass.go
- list-all-classes.go
- make-instance.go
- pkg.go
- shared-initialize.go
- slot-boundp.go
- slot-exists-p.go
- slot-makunbound.go
- slot-value.go
- slotdef.go
- standard-class.go
- standard-object.go
- with-slots.go