home *** CD-ROM | disk | FTP | other *** search
/ Carousel Volume 2 #1 / carousel.iso / mactosh / lang / xlispold.doc < prev    next >
Text File  |  1984-09-26  |  24KB  |  745 lines

  1.  
  2.           XLISP: An Experimental Object Oriented Language
  3.  
  4.  
  5.                      by
  6.                  David Betz
  7.                  114 Davenport Ave.
  8.                Manchester, NH  03103
  9.  
  10.                    (603) 625-4691
  11.  
  12.  
  13.     XLISP is an experimental programming language combining some
  14.     of  the  features  of LISP with an object oriented extension
  15.     capability.  It was  implemented  to  allow  experimentation
  16.     with  object oriented programming on small computers.  There
  17.     are currently implementations running on  the  PDP-11  under
  18.     RSX-11,  RT-11, and UNIX V7, on the VAX-11 under VAX/VMS and
  19.     Berkeley VAX/UNIX and on the Z-80 running  CP/M-80.   It  is
  20.     completely  written  in  the programming language 'C' and is
  21.     believed to be easily extended  with  user  written  builtin
  22.     functions  and  classes.  It is available free of charge and
  23.     is in the public domain.
  24.  
  25.     Many traditional LISP functions are built  into  XLISP.   In
  26.     addition,   XLISP   defines  the  object  classes  'Object',
  27.     'Class', and 'Keymap' as primitives.  'Object' is  the  only
  28.     class  that  has  no superclass and hence is the root of the
  29.     class heirarchy tree.  'Class' is the  class  of  which  all
  30.     classes  are  instances  (it  is  the only object that is an
  31.     instance of itself).  'Keymap' is a  class  whose  instances
  32.     are mappings from input key sequences to messages.
  33.  
  34.     This document is intended  to  be  a  brief  description  of
  35.     XLISP.    It   assumes  some  knowledge  of  LISP  and  some
  36.     understanding   of   the   concepts   of   object   oriented
  37.     programming.
  38.  
  39.     XLISP: An Experimental Object Oriented Language       Page 2
  40.     XLISP Command Loop
  41.  
  42.  
  43.     When XLISP is started, it issues the following prompt:
  44.  
  45.     >
  46.  
  47.     This indicates that XLISP is waiting for an expression to be
  48.     typed.   When  an  incomplete expression has been typed (one
  49.     where the left and right parens don't match)  XLISP  changes
  50.     its prompt to:
  51.  
  52.     n>
  53.  
  54.     where n is an integer indicating how many levels  of  parens
  55.     remain unclosed.
  56.  
  57.     When a complete expression has been entered, XLISP  attempts
  58.     to  evaluate  that  expression.  If the expression evaluates
  59.     successfully, XLISP prints the result of the evaluation  and
  60.     then  returns  to  the  initial  prompt  waiting for another
  61.     expression to be typed.
  62.  
  63.     Input can be aborted at any time  by  typing  the  EOF  key.
  64.     Another EOF will exit from XLISP.
  65.  
  66.     XLISP: An Experimental Object Oriented Language       Page 3
  67.     DATA TYPES AND THE EVALUATOR
  68.  
  69.  
  70.     XLISP data types
  71.  
  72.     There are several different data types  available  to  XLISP
  73.     programmers.
  74.  
  75.  
  76.           o  symbols
  77.  
  78.           o  strings
  79.  
  80.           o  integers
  81.  
  82.           o  objects
  83.  
  84.           o  file pointers
  85.  
  86.           o  lists
  87.  
  88.           o  subrs (builtin functions)
  89.  
  90.  
  91.     The XLISP evaluator
  92.  
  93.     The process of evaluation in XLISP:
  94.  
  95.           o  Integers,  strings,  objects,  file  pointers,  and
  96.          subrs evaluate to themselves
  97.  
  98.           o  Symbols evaluate to the value associated with their
  99.          current binding
  100.  
  101.           o  Lists are evaluated by evaluating the first element
  102.          of the list
  103.  
  104.           o  If it evaluates to a subr, the builtin function
  105.              is  executed  using the remaining list elements
  106.              as arguments (they are evaluated  by  the  subr
  107.              itself)
  108.  
  109.           o  If it evaluates to a list, the list is  assumed
  110.              to be a function definition and the function is
  111.              evaluated using the  values  of  the  remaining
  112.              list elements as arguments
  113.  
  114.           o  If it evaluates to an object, the  second  list
  115.              element  is  evaluated  and  used  as a message
  116.              selector.  The message formed by combining  the
  117.              selector  with the values of the remaining list
  118.              elements is sent to the object.
  119.  
  120.  
  121.  
  122.     XLISP: An Experimental Object Oriented Language       Page 4
  123.     LEXICAL CONVENTIONS
  124.  
  125.  
  126.     XLISP lexical conventions:
  127.  
  128.     The following conventions are followed when  entering  XLISP
  129.     programs:
  130.  
  131.     Comments in XLISP code begin with a semi-colon character and
  132.     continue to the end of the line.
  133.  
  134.     Symbol names  in  XLISP  can  consist  of  any  sequence  of
  135.     non-blank printable characters except the following:
  136.  
  137.         ( ) . ' " ;
  138.  
  139.     Symbol names must not begin with a digit.
  140.  
  141.     Integer literals consist of a sequence of digits  optionally
  142.     beginning with a '+' or '-'.  The range of values an integer
  143.     can represent is limited by the size of a  C  'int'  on  the
  144.     machine that XLISP is running on.
  145.  
  146.     Literal strings are sequences of  characters  surrounded  by
  147.     double  quotes.   Within quoted strings the '\' character is
  148.     used to allow non-printable characters to be included.   The
  149.     codes recognized are:
  150.  
  151.         \\      means the character '\'
  152.         \n      means newline
  153.         \t      means tab
  154.         \r      means return
  155.         \e      means escape
  156.         \nnn    means the character whose octal code is nnn
  157.  
  158.     The single quote character can be used as a shorthand for  a
  159.     call on the function 'quote':
  160.  
  161.                 'foo
  162.     is equivalent to:
  163.                 (quote foo)
  164.  
  165.     XLISP: An Experimental Object Oriented Language       Page 5
  166.     OBJECTS
  167.  
  168.  
  169.     Objects:
  170.  
  171.     Definitions:
  172.  
  173.           o  selector - a symbol used to select  an  appropriate
  174.          method
  175.  
  176.           o  message - a selector and a list of actual arguments
  177.  
  178.           o  method - the code that implements a message
  179.  
  180.     Since XLISP was  created  to  provide  a  simple  basis  for
  181.     experimenting  with  object oriented programming, one of the
  182.     primitive data types included was 'object'.   In  XLISP,  an
  183.     object  consists of a data structure containing a pointer to
  184.     the object's class as well as a list containing  the  values
  185.     of the object's instance variables.
  186.  
  187.     Officially, there is no way to see inside an object (look at
  188.     the  values  of  its  instance  variables).  The only way to
  189.     communicate with an object is by sending it a message.  When
  190.     the  XLISP  evaluator  evaluates  a  list the value of whose
  191.     first element is an object, it interprets the value  of  the
  192.     second  element  of the list (which must be a symbol) as the
  193.     message selector.  The evaluator determines the class of the
  194.     receiving object and attempts to find a method corresponding
  195.     to the message selector in the set of messages  defined  for
  196.     that  class.   If  the  message is not found in the object's
  197.     class and the class has a super-class, the search  continues
  198.     by  looking  at  the  messages  defined for the super-class.
  199.     This process continues from  one  super-class  to  the  next
  200.     until  a  method  for the message is found.  If no method is
  201.     found, an error occurs.
  202.  
  203.     When a method is found, the evaluator  binds  the  receiving
  204.     object  to  the  symbol 'self', binds the class in which the
  205.     method was found to the symbol 'msgclass', and evaluates the
  206.     method  using the remaining elements of the original list as
  207.     arguments  to  the  method.   These  arguments  are   always
  208.     evaluated prior to being bound to their corresponding formal
  209.     arguments.  The result of evaluating the method becomes  the
  210.     result of the expression.
  211.  
  212.     XLISP: An Experimental Object Oriented Language       Page 6
  213.     OBJECTS
  214.  
  215.  
  216.     Classes:
  217.  
  218.     Object  THE TOP OF THE CLASS HEIRARCHY
  219.  
  220.         Messages:
  221.  
  222.         print   THE DEFAULT OBJECT PRINT ROUTINE
  223.             returns     the object
  224.  
  225.         show    SHOW AN OBJECT'S INSTANCE VARIABLES
  226.             returns     the object
  227.  
  228.         class   RETURN THE CLASS OF AN OBJECT
  229.             returns     the class of the object
  230.  
  231.         isnew   THE DEFAULT OBJECT INITIALIZATION ROUTINE
  232.             returns     the object
  233.  
  234.         sendsuper <sel> [<args>...] SEND SUPERCLASS A MESSAGE
  235.             <sel>       the message selector
  236.             <args>      the message arguments
  237.             returns     the result of sending the message
  238.  
  239.  
  240.     Class   THE CLASS OF ALL OBJECT CLASSES (including itself)
  241.  
  242.         Messages:
  243.  
  244.         new     CREATE A NEW INSTANCE OF A CLASS
  245.             returns     the new class object
  246.  
  247.         isnew [<scls>]  INITIALIZE A NEW CLASS
  248.             <scls>      the superclass
  249.             returns     the new class object
  250.  
  251.         answer <msg> <fargs> <code>     ADD A MESSAGE TO A CLASS
  252.             <msg>       the message symbol
  253.             <fargs>     the formal argument list
  254.                   this list is of the form:
  255.                     (<farg>... [/ <local>...])
  256.                   where
  257.                     <farg>      a formal argument
  258.                     <local>     a local variable
  259.             <code>      a list of executable expressions
  260.             returns     the object
  261.  
  262.         ivars <vars>    DEFINE THE LIST OF INSTANCE VARIABLES
  263.             <vars>      the list of instance variable symbols
  264.             returns     the object
  265.  
  266.         cvars <vars>    DEFINE THE LIST OF CLASS VARIABLES
  267.             <vars>      the list of class variable symbols
  268.             returns     the object
  269.  
  270.     XLISP: An Experimental Object Oriented Language       Page 7
  271.     OBJECTS
  272.  
  273.  
  274.     When a new instance of a class is  created  by  sending  the
  275.     message  'new'  to  an  existing  class, the message 'isnew'
  276.     followed by whatever parameters were  passed  to  the  'new'
  277.     message is sent to the newly created object.
  278.  
  279.     When a new class is created by sending the 'new' message  to
  280.     the  object  'Class', an optional parameter may be specified
  281.     indicating of which class the newly generated class is to be
  282.     a  subclass.   If  this  parameter is omitted, the new class
  283.     will be a subclass of 'Object'.
  284.  
  285.      Example:
  286.  
  287.         ; create 'Foo' as a subclass of 'Object'
  288.         (setq Foo (Class 'new))
  289.  
  290.         ; create 'Bar' as a subclass of 'Foo'
  291.         (setq Bar (Class 'new Foo))
  292.  
  293.     A class inherits all instance  variables,  class  variables,
  294.     and methods from its super-class.
  295.  
  296.     XLISP: An Experimental Object Oriented Language       Page 8
  297.     OBJECTS
  298.  
  299.  
  300.     The 'Keymap' Class:
  301.  
  302.     A keymap is data structure that  translates  a  sequence  of
  303.     keystrokes into a message.
  304.  
  305.     In order to create a keymap:
  306.  
  307.         (setq km (Keymap 'new))
  308.  
  309.     In order to add a key definition to a keymap (km):
  310.  
  311.         (km 'key "\eA" 'up)
  312.         (km 'key "\eB" 'down)
  313.         (km 'key "\eC" 'right)
  314.         (km 'key "\eD" 'left)
  315.  
  316.     Executing a keymap:
  317.  
  318.         (setq env (list ob1 ob2 ob3 ob4))
  319.         (km 'process env)
  320.  
  321.     When the process  message  is  sent,  its  method  enters  a
  322.     character  input  loop  calling  kbin to get single unechoed
  323.     characters from the keyboard.  When a sequence of characters
  324.     is  found that matches one of the sequences defined in a key
  325.     function call,  the  corresponding  message  is  sent.   The
  326.     method  tries  to send the message to each of the objects in
  327.     the environment list.  It stops when it finds an object that
  328.     knows  how  to  answer  the message.  Along with the message
  329.     selector given  in  the  key  definition,  the  sequence  of
  330.     matched characters is passed as a single string parameter.
  331.  
  332.         Keymap
  333.  
  334.         new     CREATE A NEW KEYMAP
  335.             returns     a new keymap
  336.  
  337.         isnew   INITIALIZE THE NEW KEYMAP
  338.             returns     the keymap
  339.  
  340.         key <kstr> <ksym>       ADD A KEY DEFINITION TO A KEYMAP
  341.             <kstr>      the string defining the key
  342.             <ksym>      the symbol for the message
  343.             returns     the keymap
  344.  
  345.         process <envlist>       PROCESS INPUT USING A KEYMAP
  346.             <envlist>   list of active objects
  347.             returns     the keymap when a message evaluates to nil
  348.  
  349.     XLISP: An Experimental Object Oriented Language       Page 9
  350.     SYMBOLS
  351.  
  352.  
  353.     Symbols:
  354.  
  355.  
  356.           o  self  -  the  current  object  (within  a   message
  357.          context)
  358.  
  359.           o  msgclass - the class in which  the  current  method
  360.          was found
  361.  
  362.           o  currentenv - the environment list for  the  current
  363.          invocation of kmprocess
  364.  
  365.           o  oblist - the object list
  366.  
  367.  
  368.     XLISP: An Experimental Object Oriented Language      Page 10
  369.     FUNCTIONS
  370.  
  371.  
  372.     Utility functions:
  373.  
  374.     (load <fname>)  LOAD AN XLISP SOURCE FILE
  375.         <fname>     the filename string
  376.         returns     the filename
  377.  
  378.     (mem)   SHOW MEMORY ALLOCATION STATISTICS
  379.         returns     nil
  380.  
  381.     (gc)    FORCE GARBAGE COLLECTION
  382.         returns     nil
  383.  
  384.     (alloc <num>)   CHANGE NUMBER OF NODES TO ALLOCATE IN EACH SEGMENT
  385.         <num>       the number of nodes to allocate
  386.         returns     the old number of nodes to allocate
  387.  
  388.     (expand <num>)  EXPAND MEMORY BY ADDING SEGMENTS
  389.         <num>       the number of segments to add
  390.         returns     the number of segments added
  391.  
  392.     XLISP: An Experimental Object Oriented Language      Page 11
  393.     FUNCTIONS
  394.  
  395.  
  396.     Functions:
  397.  
  398.     (eval <expr>)   EVALUATE AN XLISP EXPRESSION
  399.         <expr>      the expression to be evaluated
  400.         returns     the result of evaluating the expression
  401.  
  402.     (set <sym> <expr>)      SET THE VALUE OF A SYMBOL
  403.         <sym>       the symbol being set
  404.         <expr>      the new value
  405.         returns     the new value
  406.  
  407.     (setq <qsym> <expr>)    SET THE VALUE OF A SYMBOL
  408.         <qsym>      the symbol being set (quoted)
  409.         <expr>      the new value
  410.         returns     the new value
  411.  
  412.     (print <expr>...)       PRINT A LIST OF VALUES
  413.         <expr>      the expressions to be printed
  414.         returns     nil
  415.  
  416.     (princ <expr>...)       PRINT A LIST OF VALUES WITHOUT QUOTING
  417.         <expr>      the expressions to be printed
  418.         returns     nil
  419.  
  420.     (quote <expr>)  RETURN AN EXPRESSION UNEVALUATED
  421.     or
  422.     '<expr>
  423.         <expr>      the expression to be quoted (quoted)
  424.         returns     <expr> unevaluated
  425.  
  426.     (if <texpr> <expr1> [ <expr2> ])        EXECUTE EXPRESSIONS CONDITIONALLY
  427.         <texpr>     test expression
  428.         <expr1>     expression evaluated if texpr is non-nil or non-zero
  429.         <expr2>     expression evaluated if texpr is nil or zero
  430.         returns     the value of the expression evaluated
  431.  
  432.     (while <texpr> <expr>...)       ITERATE WHILE AN EXPRESSION IS TRUE
  433.         <texpr>     test expression evaluated at start of each iteration
  434.         <expr>      expressions evaluated as long as <texpr> evaluates to
  435.             non-nil or non-zero
  436.         returns     the result of the last expression evaluated
  437.  
  438.     (repeat <iexpr> <expr>...)      ITERATE USING A REPEAT COUNT
  439.         <iexpr>     integer expression indicating the repeat count
  440.         <expr>      expressions evaluated <iexpr> times
  441.         returns     the result of the last expression evaluated
  442.  
  443.     (foreach <qsym> <list> <expr>...) ITERATE FOR EACH ELEMENT IN A LIST
  444.         <qsym>      symbol to assign each list element to (quoted)
  445.         <list>      list to iterate through
  446.         <expr>      expressions evaluated for each element in the list
  447.         returns     the result of the last expression evaluated
  448.  
  449.     XLISP: An Experimental Object Oriented Language      Page 12
  450.     FUNCTIONS
  451.  
  452.  
  453.     (defun <qsym> <qfargs> <expr>...)       DEFINE A NEW FUNCTION
  454.         <qsym>      symbol to be defined (quoted)
  455.         <qfargs>    list of formal arguments (quoted)
  456.               this list is of the form:
  457.                 (<farg>... [/ <local>...])
  458.               where
  459.                 <farg>      is a formal argument
  460.                 <local>     is a local variable
  461.         <expr>      expressions constituting the body of the
  462.             function (quoted)
  463.         returns     the function symbol
  464.  
  465.     (cond <pair>...)        EVALUATE CONDITIONALLY
  466.         <pair>      pair consisting of:
  467.                 (<pred> <expr>)
  468.               where
  469.                 <pred>      is a predicate expression
  470.                 <expr>      is evaluated if the predicate
  471.                     is not nil
  472.         returns     the value of the first expression whose predicate
  473.             is not nil
  474.  
  475.     (exit)  EXIT XLISP
  476.         returns     never returns
  477.  
  478.     XLISP: An Experimental Object Oriented Language      Page 13
  479.     FUNCTIONS
  480.  
  481.  
  482.     I/O Functions:
  483.  
  484.     (fopen <fname> <mode>)  OPEN A FILE
  485.         <fname>     the file name string
  486.         <mode>      the open mode string
  487.         returns     a file pointer
  488.  
  489.     (fclose <fp>)   CLOSE A FILE
  490.         <fp>        the file pointer
  491.         returns     nil
  492.  
  493.     (getc [<fp>])   GET A CHARACTER FROM A FILE
  494.         <fp>        the file pointer (default is stdin)
  495.         returns     the character (integer)
  496.  
  497.     (putc <ch> [<fp>])      PUT A CHARACTER TO A FILE
  498.         <ch>        the character to put (integer)
  499.         <fp>        the file pointer (default is stdout)
  500.         returns     the character (integer)
  501.  
  502.     (fgets [<fp>])  GET A STRING FROM A FILE
  503.         <fp>        the file pointer (default is stdin)
  504.         returns     the input string
  505.  
  506.     (fputs <str> [<fp>]) PUT A STRING TO A FILE
  507.         <str>       the string to output
  508.         <fp>        the file pointer (default is stdout)
  509.         returns     the string
  510.  
  511.     XLISP: An Experimental Object Oriented Language      Page 14
  512.     FUNCTIONS
  513.  
  514.  
  515.     String Functions:
  516.  
  517.     (strcat <expr>...) CONCATENATE STRINGS
  518.         <expr>      string expressions
  519.         returns     result of concatenating the strings
  520.  
  521.     (strlen <expr>) COMPUTE THE LENGTH OF A STRING
  522.         <expr>      the string expression
  523.         returns     the length of the string
  524.  
  525.     (substr <expr> <sexpr> [<lexpr>]) RETURN SUBSTRING
  526.         <expr>      string expression
  527.         <sexpr>     starting position
  528.         <lexpr>     optional length (default is rest of string)
  529.         returns     substring starting at <sexpr> for <lexpr>
  530.  
  531.     (ascii <expr>)  NUMERIC VALUE OF CHARACTER
  532.         <expr>      string expression
  533.         returns     numeric value of first character (according to ASCII)
  534.  
  535.     (chr <expr>)    CHARACTER EQUIVALENT OF ASCII VALUE
  536.         <expr>      numeric expression
  537.         returns     one character string with ASCII equivalent of <expr>
  538.  
  539.     (atoi <expr>)   CONVERT AN ASCII STRING TO AN INTEGER
  540.         <expr>      string expression
  541.         returns     the integer value of the string expression
  542.  
  543.     (itoa <expr>)   CONVERT AN INTEGER TO AN ASCII STRING
  544.         <expr>      integer expression
  545.         returns     the string representation of the integer value
  546.  
  547.     XLISP: An Experimental Object Oriented Language      Page 15
  548.     FUNCTIONS
  549.  
  550.  
  551.     List Functions:
  552.  
  553.     (head <expr>)   RETURN THE HEAD ELEMENT OF A LIST
  554.     or
  555.     (car <expr)
  556.         <expr>      the list
  557.         returns     the first element of the list
  558.  
  559.     (tail <expr>)   RETURN THE TAIL ELEMENTS OF A LIST
  560.     or
  561.     (cdr <expr>)
  562.         <expr>      the list
  563.         returns     the list minus the first element
  564.  
  565.     (list <expr>...)        CREATE A LIST OF VALUES
  566.         <expr>      evaluated expressions to be combined into a list
  567.         returns     the new list
  568.  
  569.     (nth <n> <list>)        RETURN THE NTH ELEMENT OF A LIST
  570.         <n>         the number of the element to return
  571.         <list>      the list to return the nth element of
  572.         returns     the nth element or nil if the list isn't that long
  573.  
  574.     (append <expr>...)      APPEND LISTS
  575.         <expr>      lists whose elements are to be appended
  576.         returns     the new list
  577.  
  578.     (cons <e1> <e2>)        CONSTRUCT A NEW LIST ELEMENT
  579.         <e1>        becomes the head (car) of the new list
  580.         <e2>        becomes the tail (cdr) of the new list
  581.         returns     the new list
  582.  
  583.     (null <expr>)   CHECKS FOR AN EMPTY LIST
  584.         <expr>      the list to check
  585.         returns     t if the list is empty, nil otherwise
  586.  
  587.     (atom <expr>)   CHECKS FOR AN ATOM (ANYTHING THAT ISN'T A LIST)
  588.         <expr>      the expression to check
  589.         returns     t if the value is an atom, nil otherwise
  590.  
  591.     (listp <expr>)  CHECKS FOR A LIST
  592.         <expr>      the expression to check
  593.         returns     t if the value is a list, nil otherwise
  594.  
  595.     XLISP: An Experimental Object Oriented Language      Page 16
  596.     FUNCTIONS
  597.  
  598.  
  599.     (type <expr>)   RETURNS THE TYPE OF THE EXPRESSION
  600.         <expr>      the expression to return the type of
  601.         returns     nil if the value is nil otherwise one of the symbols:
  602.                 SYM  for symbols
  603.                 OBJ  for objects
  604.                 LIST for list nodes
  605.                 KMAP for keymap nodes
  606.                 SUBR for internal subroutine nodes
  607.                 STR  for string nodes
  608.                 INT  for integer nodes
  609.                 FPTR for file pointer nodes
  610.  
  611.     (eq <expr1> <expr2>)    CHECKS FOR THE EXPRESSIONS BEING THE SAME
  612.         <expr1>     the first expression
  613.         <expr2>     the second expression
  614.         returns     t if they are equal, nil otherwise
  615.  
  616.     (equal <expr1> <expr2>) CHECKS FOR THE EXPRESSIONS BEING EQUAL
  617.         <expr1>     the first expression
  618.         <expr2>     the second expression
  619.         returns     t if they are equal, nil otherwise
  620.  
  621.     (read [ <str> ])        READ AN XLISP EXPRESSION
  622.         <str>       the string to use as input (optional)
  623.         returns     the expression read
  624.  
  625.     (reverse <expr>)        REVERSE A LIST
  626.         <expr>      the list to reverse
  627.         returns     a new list in the reverse order
  628.  
  629.     (length <expr>) FIND THE LENGTH OF A LIST
  630.         <expr>      the list to find the length of
  631.         returns     the length
  632.  
  633.     XLISP: An Experimental Object Oriented Language      Page 17
  634.     FUNCTIONS
  635.  
  636.  
  637.     Arithmetic Functions:
  638.  
  639.     (+ <expr>...)   ADD A LIST OF VALUES
  640.         <expr>      expressions to be added
  641.         returns     the result of the addition
  642.  
  643.     (- <expr>...)   SUBTRACT A LIST OF VALUES
  644.         <expr>      expressions to be subtracted
  645.         returns     the result of the subtraction
  646.  
  647.     (* <expr>...)   MULTIPLY A LIST OF VALUES
  648.         <expr>      expressions to be multiplied
  649.         returns     the result of the multiplication
  650.  
  651.     (/ <expr>...)   DIVIDE A LIST OF VALUES
  652.         <expr>      expressions to be divided
  653.         returns     the result of the division
  654.  
  655.     (% <expr>...)   MODulus A LIST OF VALUES
  656.         <expr>      expressions to be MODulused
  657.         returns     the result of mod
  658.  
  659.     (& <expr>...)   THE BITWISE AND OF A LIST OF VALUES
  660.         <expr>      expressions to be ANDed
  661.         returns     the bit by bit ANDing of expressions
  662.  
  663.     (| <expr...)    THE BITWISE OR OF A LIST OF VALUES
  664.         <expr>      expressions to be ORed
  665.         returns     the bit by bit ORing of expressions
  666.  
  667.     (~ <expr>)      THE BITWISE NOT OF A VALUE
  668.         <expr>      expression to be NOTed
  669.         returns     the bit by bit inversion of expression
  670.  
  671.     (min <expr>...) THE SMALLEST OF A LIST OF VALUES
  672.         <expr>      expressions to be checked
  673.         returns     the smallest value of the list
  674.  
  675.     (max <expr>...) THE LARGEST OF A LIST OF VALUES
  676.         <expr>      expressions to be checked
  677.         returns     the largest value of the list
  678.  
  679.     (abs <expr>)    THE ABSOLUTE VALUE OF AN EXPRESSION
  680.         <expr>      integer expression
  681.         returns     the absolute value of the expression
  682.  
  683.     XLISP: An Experimental Object Oriented Language      Page 18
  684.     FUNCTIONS
  685.  
  686.  
  687.     Boolean Functions:
  688.  
  689.     (&& <expr>...)  THE LOGICAL AND OF A LIST OF VALUES
  690.         <expr>      expressions to be ANDed
  691.         returns     the result of anding the expressions
  692.             (evaluation of expressions stops after the first
  693.              expression that evaluates to false)
  694.  
  695.     (|| <expr>...)  THE LOGICAL OR OF A LIST OF VALUES
  696.         <expr>      expressions to be ORed
  697.         returns     the result of oring the expressions
  698.             (evaluation of expressions stops after the first
  699.              expression that evaluates to true)
  700.  
  701.     (! <expr>)      THE LOGICAL NOT OF A VALUE
  702.         <expr>      expression to be NOTed
  703.         return      logical not of <expr>
  704.  
  705.     XLISP: An Experimental Object Oriented Language      Page 19
  706.     FUNCTIONS
  707.  
  708.  
  709.     Relational Functions:
  710.  
  711.     The relational functions can be used to compare integers and
  712.     strings.   The  functions  '==' and '!=' can also be used to
  713.     compare other types.  The result  of  these  comparisons  is
  714.     computed the same way as for 'eq'.
  715.  
  716.     (< <e1> <e2>)   TEST FOR LESS THAN
  717.         <e1>        the left operand of the comparison
  718.         <e2>        the right operand of the comparison
  719.         returns     the result of comparing <e1> with <e2>
  720.  
  721.     (<= <e1> <e2>)  TEST FOR LESS THAN OR EQUAL TO
  722.         <e1>        the left operand of the comparison
  723.         <e2>        the right operand of the comparison
  724.         returns     the result of comparing <e1> with <e2>
  725.  
  726.     (== <e1> <e2>)  TEST FOR EQUAL TO
  727.         <e1>        the left operand of the comparison
  728.         <e2>        the right operand of the comparison
  729.         returns     the result of comparing <e1> with <e2>
  730.  
  731.     (!= <e1> <e2>)  TEST FOR NOT EQUAL TO
  732.         <e1>        the left operand of the comparison
  733.         <e2>        the right operand of the comparison
  734.         returns     the result of comparing <e1> with <e2>
  735.  
  736.     (>= <e1> <e2>)  TEST FOR GREATER THAN OR EQUAL TO
  737.         <e1>        the left operand of the comparison
  738.         <e2>        the right operand of the comparison
  739.         returns     the result of comparing <e1> with <e2>
  740.  
  741.     (> <e1> <e2>)   TEST FOR GREATER THAN
  742.         <e1>        the left operand of the comparison
  743.         <e2>        the right operand of the comparison
  744.         returns     the result of comparing <e1> with <e2>
  745.