SYMBOL FUNCTIONS
SET THE GLOBAL VALUE OF A SYMBOL
(set <sym> <expr>)
- <sym> the symbol being set
- <expr> the new value
- returns the new value
SET THE VALUE OF A SYMBOL
(setq [<sym> <expr>]...)
fsubr
- <sym> the symbol being set (quoted)
- <expr> the new value
- returns the last new value or NIL if no arguments
PARALLEL VERSION OF SETQ
(psetq [<sym> <expr>]...)
fsubr. All expressions are evaluated before any assignments are made.
- <sym> the symbol being set (quoted)
- <expr> the new value
- returns NIL
SET THE VALUE OF A FIELD
(setf [<place> <expr>]...)
fsubr
- <place> the field specifier (if a macro it is expanded, then the form arguments are evaluated):
- <sym> set value of a symbol
- (car <expr>) set car of a cons node
- (cdr <expr>) set cdr of a cons node
- (nth <n> <expr>) set nth car of a list
- (aref <expr> <n>) set nth element of an array or string
- (elt <expr> <n>) set nth element of a sequence
- (get <sym> <prop> [<dflt>]) set value of a symbol's property
- (getf <pl> <prop> [<dflt>]) set value of a property. <pl> must be a valid field specifier.
- (symbol-value <sym>) set global value of a symbol
- (symbol-function <sym>) set functional value of a symbol
- (symbol-plist <sym>) set property list of a symbol
- (gethash <key> <tbl> <def>) add or replace hash table entry. <def> is ignored
- (send <obj> :<ivar>) (When classes.lsp used), set instance variable of object.
- (<sym>-<element> <struct>) set the element of structure struct, type sym.
- (<fieldsym> <args>) the function stored in property *setf* in symbol <fieldsym> is applied to (<args> <expr>). As an alternative, the function stored in property *setf-lambda* is applied, then the result is evaled in the current context.
- <expr> the new value
- returns the last new value, or NIL if no arguments
PARALLEL VERSION OF SETF
(psetf [<place> <expr>]...)
fsubr. All expressions are evaluated and macro place forms expanded before any assignments are made.
- <place> the field specifier (see SETF, above)
- <expr> the new value
- returns NIL
DEFINE A SETF FIELD SPECIFIER
(defsetf <sym> <fcn>)
(defsetf <sym> <fargs> (<value>) <expr>...)
Defined as macro in common.lsp. Convenient, Common Lisp compatible alternative to setting *setf* or *setf-lambda* property directly.
- <sym> field specifier symbol (quoted)
- <fcn> function to use (quoted symbol) which takes the same arguments as the field specifier plus an additional argument for the value. The value must be returned.
- <fargs> formal argument list of unevaluated arguments (lambda list) (quoted)
- <value> symbol bound to value to store (quoted).
- <expr> The last expression must an expression to evaluate in the setf context.In this respect, defsetf works like a macro definition.
- returns the field specifier symbol
CONS TO A FIELD
(push <expr> <place>)
Defined as macro in common.lsp. Only evaluates place form arguments one time. It is recommended that *displace-macros* be non-NIL for best performance.
- <place> field specifier being modified (see setf)
- <expr> value to cons to field
- returns the new value which is (CONS <expr> <place>)
CONS NEW TO A FIELD
(pushnew <expr> <place> &key :test :test-not :key)
Defined as macro in common.lsp. Only evaluates place form arguments one time. It is recommended that *displace-macros* be non-NIL for best performance.
- <place> field specifier being modified (see setf)
- <expr> value to cons to field, if not already MEMBER of field
- :test the test function (defaults to eql)
- :test-not the test function (sense inverted)
- :key function to apply to test function list argument (defaults to identity)
- returns the new value which is (CONS <expr> <place>) or <place>
REMOVE FIRST ELEMENT OF A FIELD
(pop <place>)
Defined as macro in common.lsp. Only evaluates place form arguments one time. It is recommended that *displace-macros* be non-NIL for best performance.
- <place> the field being modified (see setf)
- returns (CAR <place>), field changed to (CDR <place>)
INCREMENT A FIELD
(incf <place> [<value>])
DECREMENT A FIELD
(decf <place> [<value>])
Defined as macro in common.lsp. Only evaluates place form arguments one time. It is recommended that *displace-macros* be non-NIL for best performance.
- <place> field specifier being modified (see setf)
- <value> Numeric value (default 1)
- returns the new value which is (+ <place> <value>) or (- <place> <value>)
DEFINE A FUNCTION
(defun <sym> <fargs> <expr>...)
DEFINE A MACRO
(defmacro <sym> <fargs> <expr>...)
fsubr
- <sym> symbol being defined (quoted)
- <fargs> formal argument list (lambda list) (quoted)
- <expr> expressions constituting the body of the function (quoted)
- returns the function symbol
GENERATE A SYMBOL
(gensym [<tag>])
- <tag> string or number
- returns the new symbol, uninterned
MAKE AN INTERNED SYMBOL
(intern <pname> [<package>])
MAKE AN UNINTERNED SYMBOL
(make-symbol <pname>)
- <pname> the symbol's print name string
- returns the new symbol
GET THE PRINT NAME OF A SYMBOL
(symbol-name <sym>)
- <sym> the symbol
- returns the symbol's print name
GET THE VALUE OF A SYMBOL
(symbol-value <sym>)
- <sym> the symbol
- returns the symbol's value
GET THE FUNCTIONAL VALUE OF A SYMBOL
(symbol-function <sym>)
- <sym> the symbol
- returns the symbol's functional value
GET THE PROPERTY LIST OF A SYMBOL
(symbol-plist <sym>)
- <sym> the symbol
- returns the symbol's property list
COMPUTE THE HASH INDEX
(hash <expr> <n>)
- <expr> the object to hash
- <n> the table size (positive integer)
- returns the hash index (integer 0 to n-1)
MAKE A SYMBOL VALUE BE UNBOUND
(makunbound <sym>)
You cannot unbind constants.
- <sym> the symbol
- returnsthe symbol
MAKE A SYMBOL FUNCTION BE UNBOUND
(fmakunbound <sym>)
- <sym> the symbol
- returns the symbol
UNINTERN A SYMBOL
(unintern <sym> [<package>])
Defined in common.lsp if package feature not compiled.
- <sym> the symbol
- <package> the package to look in for the symbol
- returns t if successful, NIL if symbol not interned
DEFINE A CONSTANT
(defconstant <sym> <val> [<comment>])
fsubr.
- <sym> the symbol
- <val> the value
- <comment> optional comment string (ignored)
- returns the value
DEFINE A PARAMETER
(defparameter <sym> <val> [<comment>])
fsubr.
- <sym> the symbol
- <val> the value
- <comment> optional comment string (ignored)
- returns the value
DEFINE A VARIABLE
(defvar <sym> [<val> [<comment>]])
fsubr. Variable only initialized if not previously defined.
- <sym> the symbol
- <val> the initial value, or NIL if absent.
- <comment> optional comment string (ignored)
- returns the current value
SET SPECIAL ATTRIBUTE
(mark-as-special <sym> [<flag>])
Also see definition of PROCLAIM and DECLARE.
- <sym> symbol to mark
- <flag> non-nil to make into a constant
- returns nil, with symbol marked as special and possibly as a constant.
DECLARE ARGUMENT ATTRIBUTES
(declare [<declaration> ...])
Macro in common.lsp provided to assist in porting Common Lisp applications to XLISP-PLUS.
- <declaration> list of local variable and attributes
- returns nil, produces an error message if attribute SPECIAL is used.
PROCLAIM GLOBAL SYMBOL ATTRIBUTES
(proclaim <proc>)
Function in common.lsp provided to assist in porting Common Lisp applications to XLISP-PLUS.
- <proc> a list of symbols. If the CAR of the list is SPECIAL, then the remaining symbols are marked as special variables.
XLISP-PLUS - Version 2.1g - Tom Almy
tom.almy@tek.com - 18 JUL 94
Generated with WebMaker