OBJECT FUNCTIONS
Note that the functions provided in classes.lsp are useful but not necessary.
Messages defined for Object and Class are listed starting on page 24.
SEND A MESSAGE
(send <object> <message> [<args>...])
- <object> the object to receive the message
- <message> message sent to object
- <args> arguments to method (if any)
- returns the result of the method
SEND A MESSAGE TO SUPERCLASS
(send-super <message> [<args>])
- valid only in method context
- <message> message sent to method's superclass
- <args> arguments to method (if any)
- returns the result of the method
DEFINE A NEW CLASS
(defclass <sym> <ivars> [<cvars> [<super>]])
defined in class.lsp as a macro
- <sym> symbol whose value is to be bound to the class object (quoted)
- <ivars> list of instance variables (quoted). Instance variables specified either as <ivar> or (<ivar> <init>) to specify non-NIL default initial value.
- <cvars> list of class variables (quoted)
- <super> superclass, or Object if absent.
This function sends :SET-PNAME (defined in classes.lsp) to the new class to set the class' print name instance variable.
Methods defined for classes defined with defclass:
- (send <object> :<ivar>)
Returns the specified instance variable
- (send <object> :SET-IVAR <ivar> <value>)
Used to set an instance variable, typically with setf.
- (send <sym> :NEW {:<ivar> <init>})
Actually definition for :ISNEW. Creates new object initializing instance variables as specified in keyword arguments, or to their default if keyword argument is missing. Returns the object.
DEFINE A NEW METHOD
(defmethod <class> <sym> <fargs> <expr> ...)
defined in class.lsp as a macro
- <class> Class which will respond to message
- <sym> Message name (quoted)
- <fargs> Formal argument list. Leading "self" is implied (quoted)
- <expr> Expressions constituting body of method (quoted)
- returns the class object.
DEFINE A NEW GLOBAL INSTANCE
(definst <class> <sym> [<args>...])
defined in class.lsp as a macro
- <class> Class of new object
- <sym> Symbol whose value will be set to new object
- <args> Arguments passed to :NEW (typically initial values for instance variables)
XLISP-PLUS - Version 2.1g - Tom Almy
tom.almy@tek.com - 18 JUL 94
Generated with WebMaker