Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site
Go to the first, previous, next, last section, table of contents.

send

send

type: function (subr)
location: built-in
source file: xlobj.c
Common LISP compatible: no
supported on: all machines

SYNTAX

(send <object> <message> [<args>] )
        <object>        -       an object 
        <message>       -       message selector for object
        <arg>           -       parameter sent to object method

DESCRIPTION

The SEND function is the mechanism used to send a <message> to an <object>. The <message> is the message selector symbol that is used to select a particular action (method) from the object.

EXAMPLES

(setq myclass (send class :new '(var))) ; create MYCLASS with VAR
(send myclass :answer :isnew '()        ; set up initialization
        '((setq var nil) self))
(send myclass :answer :set-it '(value)  ; create :SET-IT message
        '((setq var value)))    
(setq my-obj (send myclass :new))       ; create MY-OBJ of MYCLASS
(send my-obj :set-it 5)                 ; VAR is set to 5

BUILT-IN METHODS: The built in methods in XLISP include:

<message>       operation
-------------------------------------------------------
:ANSWER         Add a method to an object.
:CLASS          Return the object's class.
:ISNEW          Run initialization code on object.
:NEW            Create a new object (instance or class).
:SHOW           Show the internal state of the object.

MESSAGE STRUCTURE: The normal XLISP convention for a <message> is to have a valid symbol preceeded by a colon like :ISNEW or :MY-MESSAGE. However, it is possible to define a <message> that is a symbol without a colon, but this makes the code less readable.


Go to the first, previous, next, last section, table of contents.