Article-I.D.: cwruecmp.1380
Posted: Sat Jan 18 14:58:57 1986
Date-Received: Mon, 20-Jan-86 05:18:07 EST
Organization: CWRU Dept. Computer Eng., Cleveland, OH
Lines: 1432
#!/bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #!/bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
# xlisp.doc
# read.me
# This archive created: Sat Jan 18 14:32:17 1986
# By: Jwahar R. Bammi ()
export PATH; PATH=/bin:$PATH
echo shar: extracting "'xlisp.doc'" '(53933 characters)'
if test -f 'xlisp.doc'
then
echo shar: over-writing existing file "'xlisp.doc'"
fi
sed 's/^X//' << \SHAR_EOF > 'xlisp.doc'
X
X
X
X
X
X XLISP: An Experimental Object Oriented Language
X
X Version 1.5
X
X May 27, 1985
X
X
X by
X David Michael Betz
X 114 Davenport Ave.
X Manchester, NH 03103
X
X (603) 625-4691 (home)
X
X Copyright (c) 1985, by David Michael Betz
X All Rights Reserved
X Permission is granted for unrestricted non-commercial use
X
X
X XLISP: An Experimental Object Oriented Language Page 2
X TABLE OF CONTENTS
X
X
X CONTENTS
X
X 1 INTRODUCTION . . . . . . . . . . . . . . . . . . . . 3
X 2 A NOTE FROM THE AUTHOR . . . . . . . . . . . . . . . 4
X 3 XLISP COMMAND LOOP . . . . . . . . . . . . . . . . 5
X 4 BREAK COMMAND LOOP . . . . . . . . . . . . . . . . 6
X 5 DATA TYPES . . . . . . . . . . . . . . . . . . . . . 7
X 6 THE EVALUATOR . . . . . . . . . . . . . . . . . . . 8
X 7 LEXICAL CONVENTIONS . . . . . . . . . . . . . . . . 9
X 8 OBJECTS . . . . . . . . . . . . . . . . . . . . . 10
X 8.1 THE 'Object' CLASS . . . . . . . . . . . . . . . 11
X 8.2 THE 'Class' CLASS . . . . . . . . . . . . . . . 12
X 9 SYMBOLS . . . . . . . . . . . . . . . . . . . . . 13
X 10 FUNCTION DEFINITIONS . . . . . . . . . . . . . . . 14
X 10.1 EVALUATION FUNCTIONS . . . . . . . . . . . . . . 14
X 10.2 SYMBOL FUNCTIONS . . . . . . . . . . . . . . . . 15
X 10.3 PROPERTY LIST FUNCTIONS . . . . . . . . . . . . 17
X 10.4 LIST FUNCTIONS . . . . . . . . . . . . . . . . . 18
X 10.5 DESTRUCTIVE LIST FUNCTIONS . . . . . . . . . . . 21
X 10.6 PREDICATE FUNCTIONS . . . . . . . . . . . . . . 22
X 10.7 CONTROL FUNCTIONS . . . . . . . . . . . . . . . 24
X 10.8 LOOPING FUNCTIONS . . . . . . . . . . . . . . . 25
X 10.9 THE PROGRAM FEATURE . . . . . . . . . . . . . . 26
X 10.10 DEBUGGING AND ERROR HANDLING . . . . . . . . . . 27
X 10.11 ARITHMETIC FUNCTIONS . . . . . . . . . . . . . . 28
X 10.12 BITWISE LOGICAL FUNCTIONS . . . . . . . . . . . 30
X 10.13 RELATIONAL FUNCTIONS . . . . . . . . . . . . . . 31
X 10.14 STRING FUNCTIONS . . . . . . . . . . . . . . . . 32
X 10.15 INPUT/OUTPUT FUNCTIONS . . . . . . . . . . . . . 33
X 10.16 FILE I/O FUNCTIONS . . . . . . . . . . . . . . . 34
X 10.17 SYSTEM FUNCTIONS . . . . . . . . . . . . . . . . 35
X
X
X XLISP: An Experimental Object Oriented Language Page 3
X INTRODUCTION
X
X
X 1 INTRODUCTION
X
X XLISP is an experimental programming language combining some of the
X features of LISP with an object oriented extension capability. It was
X implemented to allow experimentation with object oriented programming
X on small computers. There are currently implementations running on
X the the VAX under VAX/VMS and Berkeley VAX/UNIX, on the 8088/8086
X under CP/M-86 and MS-DOS, on the 68000 under CP/M-68K and on the
X Macintosh. It is completely written in the programming language 'C'
X and is easily extended with user written built-in functions and
X classes. It is available in source form free of charge to
X non-commercial users.
X
X Many traditional LISP functions are built into XLISP. In addition,
X XLISP defines the objects 'Object' and 'Class' as primitives.
X 'Object' is the only class that has no superclass and hence is the
X root of the class heirarchy tree. 'Class' is the class of which all
X classes are instances (it is the only object that is an instance of
X itself).
X
X This document is a brief description of XLISP. It assumes some
X knowledge of LISP and some understanding of the concepts of
X object-oriented programming.
X
X A recommended text for learning LISP programming is the book "LISP" by
X Winston and Horn and published by Addison Wesley. The first edition
X of this book is based on MacLisp and the second edition is based on
X Common Lisp. Future versions of XLISP will continue to migrate
X towards compatibility with Common Lisp.
X
X
X XLISP: An Experimental Object Oriented Language Page 4
X A NOTE FROM THE AUTHOR
X
X
X 2 A NOTE FROM THE AUTHOR
X
X If you have any problems with XLISP, feel free to contact me for help
X or advice. Please remember that since XLISP is available in source
X form in a high level language, many users have been making versions
X available on a variety of machines. If you call to report a problem
X with a specific version, I may not be able to help you if that version
X runs on a machine to which I don't have access. Please have the
X version number of the version that you are running readily accessible
X before calling me.
X
X If you find a bug in XLISP, first try to fix the bug yourself using
X the source code provided. If you are successful in fixing the bug,
X send the bug report along with the fix to me. If you don't have
X access to a C compiler or are unable to fix a bug, please send the bug
X report to me and I'll try to fix it.
X
X Any suggestions for improvements will be welcomed. Feel free to
X extend the language in whatever way suits your needs. However, PLEASE
X DO NOT RELEASE ENHANCED VERSIONS WITHOUT CHECKING WITH ME FIRST!! I
X would like to be the clearing house for new features added to XLISP.
X If you want to add features for your own personal use, go ahead. But,
X if you want to distribute your enhanced version, contact me first.
X Please remember that the goal of XLISP is to provide a language to
X learn and experiment with LISP and object-oriented programming on
X small computers. I don't want it to get so big that it requires
X megabytes of memory to run.
X
X
X XLISP: An Experimental Object Oriented Language Page 5
X XLISP COMMAND LOOP
X
X
X 3 XLISP COMMAND LOOP
X
X When XLISP is started, it first tries to load "init.lsp" from the
X default directory. It then loads any files named as parameters on the
X command line (after appending ".lsp" to their names). It then issues
X the following prompt:
X
X >
X
X This indicates that XLISP is waiting for an expression to be typed.
X When an incomplete expression has been typed (one where the left and
X right parens don't match) XLISP changes its prompt to:
X
X n>
X
X where n is an integer indicating how many levels of left parens remain
X unclosed.
X
X When a complete expression has been entered, XLISP attempts to
X evaluate that expression. If the expression evaluates successfully,
X XLISP prints the result of the evaluation and then returns to the
X initial prompt waiting for another expression to be typed.
X
X Input can be aborted at any time by typing the CONTROL-G key (it may
X be necessary to follow CONTROL-G by RETURN).
X
X
X XLISP: An Experimental Object Oriented Language Page 6
X BREAK COMMAND LOOP
X
X
X 4 BREAK COMMAND LOOP
X
X When XLISP encounters an error while evaluating an expression, it
X attempts to handle the error in the following way:
X
X If the symbol '*breakenable*' is true, the message corresponding to
X the error is printed. If the error is correctable, the correction
X message is printed. If the symbol '*tracenable*' is true, a trace
X back is printed. The number of entries printed depends on the value
X of the symbol '*tracelimit*'. If this symbol is set to something
X other than a number, the entire trace back stack is printed. XLISP
X then enters a read/eval/print loop to allow the user to examine the
X state of the interpreter in the context of the error. This loop
X differs from the normal top-leval read/eval/print loop in that if the
X user invokes the function 'continue' XLISP will continue from a
X correctable error. If the user invokes the function 'quit' XLISP will
X abort the break loop and return to the top level or the next lower
X numbered break loop. When in a break loop, XLISP prefixes the break
X level to the normal prompt.
X
X If the symbol '*breakenable*' is nil, XLISP looks for a surrounding
X errset function. If one is found, XLISP examines the value of the
X print flag. If this flag is true, the error message is printed. In
X any case, XLISP causes the errset function call to return nil.
X
X If there is no surrounding errset function, XLISP prints the error
X message and returns to the top level.
X
X
X XLISP: An Experimental Object Oriented Language Page 7
X DATA TYPES
X
X
X 5 DATA TYPES
X
X There are several different data types available to XLISP programmers.
X
X
X o lists
X
X o symbols
X
X o strings
X
X o integers
X
X o floats
X
X o objects
X
X o file pointers
X
X o subrs (built-in functions)
X
X o fsubrs (special forms)
X
X Another data type is the stream. A stream is a list node whose car
X points to the head of a list of integers and whose cdr points to the
X last list node of the list. An empty stream is a list node whose car
X and cdr are nil. Each of the integers in the list represents a
X character in the stream. When a character is read from a stream, the
X first integer from the head of the list is removed and returned. When
X a character is written to a stream, the integer representing the
X character code of the character is appended to the end of the list.
X When a function indicates that it takes an input source as a
X parameter, this parameter can either be an input file pointer or a
X stream. Similarly, when a function indicates that it takes an output
X sink as a parameter, this parameter can either be an output file
X pointer or a stream.
X
X
X XLISP: An Experimental Object Oriented Language Page 8
X THE EVALUATOR
X
X
X 6 THE EVALUATOR
X
X The process of evaluation in XLISP:
X
X o Integers, floats, strings, file pointers, subrs, fsubrs and
X objects evaluate to themselves
X
X o Symbols evaluate to the value associated with their current
X binding
X
X o Lists are evaluated by evaluating the first element of the
X list and then taking one of the following actions:
X
X o If it is a subr, the remaining list elements are
X evaluated and the subr is called with these evaluated
X expressions as arguments.
X
X o If it is an fsubr, the fsubr is called using the
X remaining list elements as arguments (unevaluated)
X
X o If it is a list:
X
X 1. If the list is a function closure (a list whose car
X is a lambda expression and whose cdr is an
X environment list), the car of the list is used as the
X function to be applied and the cdr is used as the
X environment to be extended with the parameter
X bindings.
X
X 2. If the list is a lambda expression, the current
X environment is used for the function application.
X
X 3. In either of the above two cases, the remaining list
X elements are evaluated and the resulting expressions
X are bound to the formal arguments of the lambda
X expression. The body of the function is executed
X within this new binding environment.
X
X
X o If it is a list and the car of the list is 'macro', the
X remaining list elements are bound to the formal arguments
X of the macro expression. The body of the function is
X executed within this new binding environment. The result
X of this evaluation is considered the macro expansion.
X This result is then evaluated in place of the original
X expression.
X
X o If it is an object, the second list element is evaluated
X and used as a message selector. The message formed by
X combining the selector with the values of the remaining
X list elements is sent to the object.
X
X
X
X
X XLISP: An Experimental Object Oriented Language Page 9
X LEXICAL CONVENTIONS
X
X
X 7 LEXICAL CONVENTIONS
X
X The following conventions are followed when entering XLISP programs:
X
X Comments in XLISP code begin with a semi-colon character and continue
X to the end of the line.
X
X Symbol names in XLISP can consist of any sequence of non-blank
X printable characters except the following:
X
X ( ) ' ` , " ;
X
X Uppercase and lowercase characters are not distinguished within symbol
X names. All lowercase characters are mapped to uppercase on input.
X
X Integer literals consist of a sequence of digits optionally beginning
X with a '+' or '-'. The range of values an integer can represent is
X limited by the size of a C 'long' on the machine on which XLISP is
X running.
X
X Floating point literals consist of a sequence of digits optionally
X beginning with a '+' or '-' and including an embedded decimal point.
X The range of values a floating point number can represent is limited
X by the size of a C 'float' ('double' on machines with 32 bit
X addresses) on the machine on which XLISP is running.
X
X Literal strings are sequences of characters surrounded by double
X quotes. Within quoted strings the '\' character is used to allow
X non-printable characters to be included. The codes recognized are:
X
X \\ means the character '\'
X \n means newline
X \t means tab
X \r means return
X \e means escape
X \nnn means the character whose octal code is nnn
X
X XLISP defines several useful read macros:
X
X ' == (quote )
X #' == (function )
X ` == (backquote )
X , == (comma )
X ,@ == (comma-at )
X
X
X XLISP: An Experimental Object Oriented Language Page 10
X OBJECTS
X
X
X 8 OBJECTS
X
X Definitions:
X
X o selector - a symbol used to select an appropriate method
X
X o message - a selector and a list of actual arguments
X
X o method - the code that implements a message
X
X Since XLISP was created to provide a simple basis for experimenting
X with object oriented programming, one of the primitive data types
X included is 'object'. In XLISP, an object consists of a data
X structure containing a pointer to the object's class as well as a list
X containing the values of the object's instance variables.
X
X Officially, there is no way to see inside an object (look at the
X values of its instance variables). The only way to communicate with
X an object is by sending it a message. When the XLISP evaluator
X evaluates a list the value of whose first element is an object, it
X interprets the value of the second element of the list (which must be
X a symbol) as the message selector. The evaluator determines the class
X of the receiving object and attempts to find a method corresponding to
X the message selector in the set of messages defined for that class.
X If the message is not found in the object's class and the class has a
X super-class, the search continues by looking at the messages defined
X for the super-class. This process continues from one super-class to
X the next until a method for the message is found. If no method is
X found, an error occurs.
X
X When a method is found, the evaluator binds the receiving object to
X the symbol 'self', binds the class in which the method was found to
X the symbol 'msgclass', and evaluates the method using the remaining
X elements of the original list as arguments to the method. These
X arguments are always evaluated prior to being bound to their
X corresponding formal arguments. The result of evaluating the method
X becomes the result of the expression.
X
X
X XLISP: An Experimental Object Oriented Language Page 11
X OBJECTS
X
X
X 8.1 THE 'Object' CLASS
X
X Classes:
X
X Object THE TOP OF THE CLASS HEIRARCHY
X
X Messages:
X
X :show SHOW AN OBJECT'S INSTANCE VARIABLES
X returns the object
X
X :class RETURN THE CLASS OF AN OBJECT
X returns the class of the object
X
X :isnew THE DEFAULT OBJECT INITIALIZATION ROUTINE
X returns the object
X
X :sendsuper []... SEND SUPERCLASS A MESSAGE
X the message selector
X the message arguments
X returns the result of sending the message
X
X
X XLISP: An Experimental Object Oriented Language Page 12
X OBJECTS
X
X
X 8.2 THE 'Class' CLASS
X
X Class THE CLASS OF ALL OBJECT CLASSES (including itself)
X
X Messages:
X
X :new CREATE A NEW INSTANCE OF A CLASS
X returns the new class object
X
X :isnew [[]] INITIALIZE A NEW CLASS
X the list of instance variables
X the list of class variables (default is nil)
X the superclass (default is Object)
X returns the new class object
X
X :answer ADD A MESSAGE TO A CLASS
X the message symbol
X the formal argument list
X this list is of the form:
X ([]...
X [&optional []...]
X [&rest ]
X [&aux []...])
X where
X a formal argument
X an optional argument (default is nil)
X bound to the rest of the arguments
X a auxiliary variable (set to nil)
X a list of executable expressions
X returns the object
X
X
X When a new instance of a class is created by sending the message
X ':new' to an existing class, the message ':isnew' followed by whatever
X parameters were passed to the ':new' message is sent to the newly
X created object.
X
X When a new class is created by sending the ':new' message to the
X object 'Class', an optional parameter may be specified indicating the
X superclass of the new class. If this parameter is omitted, the new
X class will be a subclass of 'Object'. A class inherits all instance
X variables, class variables, and methods from its super-class.
X
X
X XLISP: An Experimental Object Oriented Language Page 13
X SYMBOLS
X
X
X 9 SYMBOLS
X
X
X o self - the current object (within a message context)
X
X o msgclass - the class in which the current method was found
X
X o *oblist* - the object list
X
X o *keylist* - the keyword list
X
X o *standard-input* - the standard input file
X
X o *standard-output* - the standard output file
X
X o *breakenable* - flag controlling entering the break loop on
X errors
X
X o *tracenable* - flag controlling trace back printout on errors
X and breaks
X
X o *tracelimit* - maximum number of levels of trace back
X information printed on errors and breaks
X
X o *evalhook* - user substitute for the evaluator function
X
X o *applyhook* - (not yet implemented)
X
X o *unbound* - indicator for unbound symbols
X
X
X
X XLISP: An Experimental Object Oriented Language Page 14
X FUNCTION DEFINITIONS
X
X
X 10 FUNCTION DEFINITIONS
X
X 10.1 EVALUATION FUNCTIONS
X
X (eval ) EVALUATE AN XLISP EXPRESSION
X the expression to be evaluated
X returns the result of evaluating the expression
X
X (apply ) APPLY A FUNCTION TO A LIST OF ARGUMENTS
X the function to apply (or function symbol)
X the argument list
X returns the result of applying the function to the argument list
X
X (funcall []...) CALL A FUNCTION WITH ARGUMENTS
X the function to call (or function symbol)
X arguments to pass to the function
X returns the result of calling the function with the arguments
X
X (quote ) RETURN AN EXPRESSION UNEVALUATED
X the expression to be quoted (quoted)
X returns unevaluated
X
X (function ) QUOTE A FUNCTION
X the function to be quoted (quoted)
X returns a function closure
X
X (backquote ) FILL IN A TEMPLATE
X the template
X returns a copy of the template with comma and comma-at expressions
X expanded (see the Common Lisp reference manual)
X
X
X XLISP: An Experimental Object Oriented Language Page 15
X SYMBOL FUNCTIONS
X
X
X 10.2 SYMBOL FUNCTIONS
X
X (set ) SET THE VALUE OF A SYMBOL
X the symbol being set
X the new value
X returns the new value
X
X (setq [ ]...) SET THE VALUE OF A SYMBOL
X the symbol being set (quoted)
X the new value
X returns the new value
X
X (setf [ ]...) SET THE VALUE OF A FIELD
X the field specifier (quoted):
X set the value of a symbol
X (car ) set the car of a list node
X (cdr ) set the cdr of a list node
X (get ) set the value of a property
X (symbol-value ) set the value of a symbol
X (symbol-plist ) set the property list of a symbol
X the new value
X returns the new value
X
X (defun []...) DEFINE A FUNCTION
X (defmacro []...) DEFINE A MACRO
X symbol being defined (quoted)
X list of formal arguments (quoted)
X this list is of the form:
X ([]...
X [&optional []...]
X [&rest ]
X [&aux []...])
X where
X is a formal argument
X is an optional argument (default is nil)
X bound to the rest of the arguments
X is an auxiliary variable (set to nil)
X expressions constituting the body of the
X function (quoted)
X returns the function symbol
X
X (gensym []) GENERATE A SYMBOL
X string or number
X returns the new symbol
X
X (intern ) MAKE AN INTERNED SYMBOL
X the symbol's print name string
X returns the new symbol
X
X (make-symbol ) MAKE AN UNINTERNED SYMBOL
X the symbol's print name string
X returns the new symbol
X
X
X XLISP: An Experimental Object Oriented Language Page 16
X SYMBOL FUNCTIONS
X
X
X (symbol-name ) GET THE PRINT NAME OF A SYMBOL
X the symbol
X returns the symbol's print name
X
X (symbol-value ) GET THE VALUE OF A SYMBOL
X the symbol
X returns the symbol's value
X
X (symbol-plist ) GET THE PROPERTY LIST OF A SYMBOL
X the symbol
X returns the symbol's property list
X
X
X XLISP: An Experimental Object Oriented Language Page 17
X PROPERTY LIST FUNCTIONS
X
X
X 10.3 PROPERTY LIST FUNCTIONS
X
X (get ) GET THE VALUE OF A PROPERTY
X the symbol
X the property symbol
X returns the property value or nil
X
X (putprop ) PUT A PROPERTY ONTO THE PROPERTY LIST
X the symbol
X the property value
X the property symbol
X returns nil
X
X (remprop ) REMOVE A PROPERTY
X the symbol
X the property symbol
X
X
X XLISP: An Experimental Object Oriented Language Page 18
X LIST FUNCTIONS
X
X
X 10.4 LIST FUNCTIONS
X
X (car ) RETURN THE CAR OF A LIST NODE
X the list node
X returns the car of the list node
X
X (cdr ) RETURN THE CDR OF A LIST NODE
X the list node
X returns the cdr of the list node
X
X (caar ) == (car (car ))
X (cadr ) == (car (cdr ))
X (cdar ) == (cdr (car ))
X (cddr ) == (cdr (cdr ))
X
X (cons ) CONSTRUCT A NEW LIST NODE
X the car of the new list node
X the cdr of the new list node
X returns the new list node
X
X (list []...) CREATE A LIST OF VALUES
X expressions to be combined into a list
X returns the new list
X
X (append []...) APPEND LISTS
X lists whose elements are to be appended
X returns the new list
X
X (reverse ) REVERSE A LIST
X the list to reverse
X returns a new list in the reverse order
X
X (last ) RETURN THE LAST LIST NODE OF A LIST
X the list
X returns the last list node in the list
X
X (member [ ]) FIND AN EXPRESSION IN A LIST
X the expression to find
X the list to search
X the keyword :test or :test-not
X the test function (defaults to eql)
X returns the remainder of the list starting with the expression
X
X (assoc [ ]) FIND AN EXPRESSION IN AN A-LIST
X the expression to find
X the association list
X the keyword :test or :test-not
X the test function (defaults to eql)
X returns the alist entry or nil
X
X
X XLISP: An Experimental Object Oriented Language Page 19
X LIST FUNCTIONS
X
X
X (remove [ ]) REMOVE AN EXPRESSION FROM A LIST
X the expression to delete
X the list
X the keyword :test or :test-not
X the test function (defaults to eql)
X returns the list with the matching expressions deleted
X
X (length ) FIND THE LENGTH OF A LIST OR STRING
X the list or string
X returns the length of the list or string
X
X (nth ) RETURN THE NTH ELEMENT OF A LIST
X the number of the element to return (zero origin)
X the list
X returns the nth element or nil if the list isn't that long
X
X (nthcdr ) RETURN THE NTH CDR OF A LIST
X the number of the element to return (zero origin)
X the list
X returns the nth cdr or nil if the list isn't that long
X
X (mapc []...) APPLY FUNCTION TO SUCCESSIVE CARS
X the function or function name
X a list for each argument of the function
X returns the first list of arguments
X
X (mapcar []...) APPLY FUNCTION TO SUCCESSIVE CARS
X the function or function name
X a list for each argument of the function
X returns the list of values returned by each function invocation
X
X (mapl []...) APPLY FUNCTION TO SUCCESSIVE CDRS
X the function or function name
X a list for each argument of the function
X returns the first list of arguments
X
X (maplist []...) APPLY FUNCTION TO SUCCESSIVE CDRS
X the function or function name
X a list for each argument of the function
X returns the list of values returned by each function invocation
X
X
X XLISP: An Experimental Object Oriented Language Page 20
X LIST FUNCTIONS
X
X
X (subst [ ]) SUBSTITUTE EXPRESSIONS
X the new expression
X the old expression
X the expression in which to do the substitutions
X the keyword :test or :test-not
X the test function (defaults to eql)
X returns the expression with substitutions
X
X (sublis [ ]) SUBSTITUTE USING AN A-LIST
X the association list
X the expression in which to do the substitutions
X the keyword :test or :test-not
X the test function (defaults to eql)
X returns the expression with substitutions
X
X
X XLISP: An Experimental Object Oriented Language Page 21
X DESTRUCTIVE LIST FUNCTIONS
X
X
X 10.5 DESTRUCTIVE LIST FUNCTIONS
X
X (rplaca ) REPLACE THE CAR OF A LIST NODE
X the list node
X the new value for the car of the list node
X returns the list node after updating the car
X
X (rplacd ) REPLACE THE CDR OF A LIST NODE
X the list node
X the new value for the cdr of the list node
X returns the list node after updating the cdr
X
X (nconc []...) DESTRUCTIVELY CONCATENATE LISTS
X lists to concatenate
X returns the result of concatenating the lists
X
X (delete [ ]) DELETE AN EXPRESSION FROM A LIST
X the expression to delete
X the list
X the keyword :test or :test-not
X the test function (defaults to eql)
X returns the list with the matching expressions deleted
X
X
X XLISP: An Experimental Object Oriented Language Page 22
X PREDICATE FUNCTIONS
X
X
X 10.6 PREDICATE FUNCTIONS
X
X (atom ) IS THIS AN ATOM?
X the expression to check
X returns t if the value is an atom, nil otherwise
X
X (symbolp ) IS THIS A SYMBOL?
X the expression to check
X returns t if the expression is a symbol, nil otherwise
X
X (numberp ) IS THIS A NUMBER?
X the expression to check
X returns t if the expression is a number, nil otherwise
X
X (null ) IS THIS AN EMPTY LIST?
X the list to check
X returns t if the list is empty, nil otherwise
X
X (not ) IS THIS FALSE?
X the expression to check
X return t if the expression is nil, nil otherwise
X
X (listp ) IS THIS A LIST?
X the expression to check
X returns t if the value is a list node or nil, nil otherwise
X
X (consp ) IS THIS A NON-EMPTY LIST?
X the expression to check
X returns t if the value is a list node, nil otherwise
X
X (boundp ) IS THIS A BOUND SYMBOL?
X the symbol
X returns t if a value is bound to the symbol, nil otherwise
X
X
X XLISP: An Experimental Object Oriented Language Page 23
X PREDICATE FUNCTIONS
X
X
X (minusp ) IS THIS NUMBER NEGATIVE?
X the number to test
X returns t if the number is negative, nil otherwise
X
X (zerop ) IS THIS NUMBER ZERO?
X