@node Symbols, Operating System, Compilation, Top
@chapter Symbols

@defun GENSYM (&optional (x nil))
Package:LISP

Creates and returns a new uninterned symbol whose name is a prefix string
(defaults to "G"), followed by a decimal number.  The number is incremented
by each call to GENSYM.  X, if an integer, resets the counter.  If X is a
string, it becomes the new prefix.


@end defun

@defun KEYWORDP (x)
Package:LISP

Returns T if X is a symbol and it belongs to the KEYWORD package; NIL
otherwise.


@end defun

@defun REMPROP (symbol indicator)
Package:LISP

Look on property list of SYMBOL for property with specified
INDICATOR.  If found, splice this indicator and its value out of
the plist, and return T. If not found, returns NIL with no side effects.

@end defun

@defun SYMBOL-PACKAGE (symbol)
Package:LISP

Returns the contents of the package cell of the symbol SYMBOL.


@end defun

@defvar *PACKAGE* 
Package:LISP
The current package.


@end defvar


@defun SHADOWING-IMPORT (symbols &optional (package *package*))
Package:LISP

Imports SYMBOLS into PACKAGE, disregarding any name conflict.  If a symbol
of the same name is already present, then it is uninterned.  SYMBOLS must
be a list of symbols or a symbol.


@end defun

@deffn {Macro} REMF 
Package:LISP

Syntax:
@example
(remf place indicator)
@end example

PLACE may be any place expression acceptable to SETF, and is expected
to hold a property list or NIL.  This list is destructively altered to
remove the property specified by INDICATOR.  Returns T if such a
property was present; NIL otherwise.


@end deffn

@defun MAKUNBOUND (symbol)
Package:LISP

Makes empty the value slot of SYMBOL.  Returns SYMBOL.


@end defun

@defun USE-PACKAGE (packages-to-use &optional (package *package*))
Package:LISP

Adds all packages in PACKAGE-TO-USE list to the use list for PACKAGE so that
the external symbols of the used packages are available as internal symbols
in PACKAGE.


@end defun

@defun MAKE-SYMBOL (string)
Package:LISP

Creates and returns a new uninterned symbol whose print name is STRING.


@end defun

@deffn {Special Form} PSETQ 
Package:LISP

Syntax:
@example
(psetq @{var form@}*)
@end example

Similar to SETQ, but evaluates all FORMs first, and then assigns each value to
the corresponding VAR.  Returns NIL always.


@end deffn

@defun PACKAGE-USED-BY-LIST (package)
Package:LISP

Returns the list of packages that use PACKAGE.


@end defun

@defun SYMBOLP (x)
Package:LISP

Returns T if X is a symbol; NIL otherwise.


@end defun

@defvr {Constant} NIL 
Package:LISP
Holds NIL.


@end defvr

@defun SET (symbol value)
Package:LISP

Assigns the value of VALUE to the dynamic variable named by SYMBOL, and
returns the value assigned.


@end defun

@deffn {Special Form} SETQ 
Package:LISP

Syntax:
@example
(setq @{var form@}*)
@end example

VARs are not evaluated and must be symbols.  Assigns the value of the first
FORM to the first VAR, then assigns the value of the second FORM to the second
VAR, and so on.  Returns the last value assigned.


@end deffn

@defun UNUSE-PACKAGE (packages-to-unuse &optional (package *package*))
Package:LISP

Removes PACKAGES-TO-UNUSE from the use list for PACKAGE.


@end defun

@defvr {Constant} T 
Package:LISP
Holds T.


@end defvr

@defun PACKAGE-USE-LIST (package)
Package:LISP

Returns the list of packages used by PACKAGE.


@end defun

@defun LIST-ALL-PACKAGES ()
Package:LISP

Returns a list of all existing packages.


@end defun

@defun COPY-SYMBOL (symbol &optional (copy-props nil))
Package:LISP

Returns a new uninterned symbol with the same print name as SYMBOL.
If COPY-PROPS is NIL, the function, the variable, and the property slots
of the new symbol have no value.  Otherwise, these slots are given the
values of the corresponding slots of SYMBOL.


@end defun

@defun SYMBOL-PLIST (symbol)
Package:LISP

Returns the property list of SYMBOL.


@end defun

@defun SYMBOL-NAME  (symbol)
Package:LISP

Returns the print name of the symbol SYMBOL.


@end defun

@defun FIND-SYMBOL  (name &optional (package *package*))
Package:LISP

Returns the symbol named NAME in
PACKAGE.  If such a symbol is found, then the second value is :INTERN,
:EXTERNAL, or :INHERITED to indicate how the symbol is accessible.  If
no symbol is found then both values are NIL.


@end defun

@defun SHADOW (symbols &optional (package *package*))
Package:LISP

Creates an internal symbol in PACKAGE with the same name as each of the
specified SYMBOLS.  SYMBOLS must be a list of symbols or a symbol.


@end defun


@defun FBOUNDP (symbol)
Package:LISP

Returns T if SYMBOL has a global function definition or if SYMBOL names a
special form or a macro; NIL otherwise.


@end defun

@defun MACRO-FUNCTION (symbol)
Package:LISP

If SYMBOL globally names a macro, then returns the expansion function.
Returns NIL otherwise.


@end defun

@defun IN-PACKAGE (package-name &key (nicknames nil) (use '(lisp)))
Package:LISP

Sets *PACKAGE* to the package with PACKAGE-NAME, creating the package if
it does not exist.  If the package already exists then it is modified
to agree with USE and NICKNAMES arguments.  Any new nicknames are added
without removing any old ones not specified.  If any package in the USE list
is not currently used, then it is added to the use list.


@end defun

@defun MAKE-PACKAGE (package-name &key (nicknames nil) (use '(lisp)))
Package:LISP

Makes a new package having the specified PACKAGE-NAME and NICKNAMES.  The
package will inherit all external symbols from each package in the USE list.


@end defun

@defun PACKAGE-SHADOWING-SYMBOLS (package)
Package:LISP

Returns the list of symbols that have been declared as shadowing symbols
in PACKAGE.


@end defun

@defun INTERN (name &optional (package *package*))
Package:LISP

Returns a symbol having the specified name, creating it if necessary.
Returns as the second value one of the symbols :INTERNAL, :EXTERNAL,
:INHERITED, and NIL.


@end defun

@defun EXPORT (symbols &optional (package *package*))
Package:LISP

Makes SYMBOLS external symbols of PACKAGE.  SYMBOLS must be a list of symbols
or a symbol.


@end defun

@defun PACKAGEP (x)
Package:LISP

Returns T if X is a package; NIL otherwise.


@end defun

@defun SYMBOL-FUNCTION (symbol)
Package:LISP

Returns the current global function definition named by SYMBOL.


@end defun

@defun SYMBOL-VALUE (symbol)
Package:LISP

Returns the current value of the dynamic (special) variable named by SYMBOL.


@end defun

@defun BOUNDP (symbol)
Package:LISP

Returns T if the global variable named by SYMBOL has a value; NIL otherwise.


@end defun

@defun DOCUMENTATION (symbol doc-type)
Package:LISP

Returns the doc-string of DOC-TYPE for SYMBOL; NIL if none exists.
Possible doc-types are:
	FUNCTION  (special forms, macros, and functions)
	VARIABLE  (dynamic variables, including constants)
	TYPE      (types defined by DEFTYPE)
	STRUCTURE (structures defined by DEFSTRUCT)
	SETF      (SETF methods defined by DEFSETF, DEFINE-SETF-METHOD, and
	           DEFINE-MODIFY-MACRO)
All built-in special forms, macros, functions, and variables have their
doc-strings.


@end defun

@defun GENTEMP (&optional (prefix "t") (package *package*))
Package:LISP

Creates a new symbol interned in the package PACKAGE with the given PREFIX.


@end defun

@defun RENAME-PACKAGE (package new-name &optional (new-nicknames nil))
Package:LISP

Replaces the old name and nicknames of PACKAGE with NEW-NAME and
NEW-NICKNAMES.


@end defun

@defun UNINTERN (symbol &optional (package *package*))
Package:LISP

Makes SYMBOL no longer present in PACKAGE.  Returns T if SYMBOL was present;
NIL otherwise.  If PACKAGE is the home package of SYMBOL, then makes SYMBOL
uninterned.


@end defun

@defun UNEXPORT (symbols &optional (package *package*))
Package:LISP

Makes SYMBOLS no longer accessible as external symbols in PACKAGE.  SYMBOLS
must be a list of symbols or a symbol.


@end defun

@defun PACKAGE-NICKNAMES (package)
Package:LISP

Returns as a list the nickname strings for the specified PACKAGE.


@end defun

@defun IMPORT (symbols &optional (package *package*))
Package:LISP

Makes SYMBOLS internal symbols of PACKAGE.  SYMBOLS must be a list of symbols
or a symbol.


@end defun

@defun GET (symbol indicator &optional (default nil))
Package:LISP

Looks on the property list of SYMBOL for the specified INDICATOR.  If this
is found, returns the associated value.  Otherwise, returns DEFAULT.


@end defun

@defun FIND-ALL-SYMBOLS (string-or-symbol)
Package:LISP

Returns a list of all symbols that have the specified name.


@end defun

@defun FMAKUNBOUND (symbol)
Package:LISP

Discards the global function definition named by SYMBOL.  Returns SYMBOL.


@end defun

@defun PACKAGE-NAME (package)
Package:LISP

Returns the string that names the specified PACKAGE.


@end defun

@defun FIND-PACKAGE (name)
Package:LISP

Returns the specified package if it already exists; NIL otherwise.  NAME may
be a string that is the name or nickname of the package.  NAME may also be
a symbol, in which case the symbol's print name is used.


@end defun


@defun APROPOS-LIST (string &optional (package nil))
Package:LISP

Returns, as a list, all symbols whose print-names contain STRING as substring.
If PACKAGE is non-NIL, then only the specified package is searched.


@end defun
