PACKAGE FUNCTIONS
These functions are defined when the packages option is compiled. The <package> argument can be either a string, symbol, or package object. The default when no package is given is the current package (as bound to *package*), unless otherwise specified in the definition. The <symbols> argument may be either a single symbol or a list of symbols. In case of name conflicts, a correctable error occurs.
SEARCH SYMBOLS FOR NAME MATCH
(apropos <string> [<package>])
(apropos-list <string> [<package>])
Functions in common.lsp.
- <string> find symbols which contain this string as substring of print name
- <package> package to search, if absent, or NIL, search all packages
- returns apropos-list returns list of symbols, apropos prints them, along with some information, and returns nothing.
(RE)DEFINE A PACKAGE
(defpackage <package> [<option>...])
Macro in common.lsp. Use to define a package, or redefine a package.
- <package> the name of the package to (re)define
- <option> any one or more of the following, none evaluated, applied in this order:
- (:shadow <symbol>...) one or more symbols to shadow, as in function SHADOW
- (:shadowing-import-from <symbol>...)
one or more symbols to shadow, as in function SHADOWING-IMPORT
- (:use <package>...) one or more packages to "use", as in function USE-PACKAGE
- (:import-from <package> <symbol>...)
one or more symbols to import from the package, as in function IMPORT
- (:intern <symbol>...) one or more symbols to be located or created in this package, as in function INTERN
- (:export <symbol>...) one or more symbols to be exported from this package, as in function EXPOR
- returns the new or redefined package
DELETE A PACKAGE
(delete-package <package>)
Deletes a package by uninterning all its symbols and removing the package.
- <package> package to delete
- returns T if successful
ITERATE OVER SYMBOLS
(do-symbols (<var> [<package> [<result>]]) <expr>...))
(do-external-symbols (<var> [<package> [<result>]]) <expr>...)
(do-all-symbols (<var> [<result>]) <expr>...)
Implemented as macros in common.lsp. DO-SYMBOLS iterates over all symbols in a single package, DO-EXTERNAL-SYMBOLS iterates only over the external symbols, and DO-ALL-SYMBOLS iterates over all symbols in all packages.
- <var> variable to bind to symbol
- <package> the package to search
- <result> a single result form
- <expr> expressions to evaluate (implicit tag-body)
- returns result of result form, or NIL if not specified
DECLARE EXTERNAL SYMBOLS
(export <symbols> [<package>])
- <symbols> symbols to declare as external
- <package> package symbol is in
- returns T
FIND SYMBOLS WITH SPECIFIED NAME
(find-all-symbols <string>)
- <string> string or symbol (if latter, print name string is used)
- returns list of all symbols having that print-name
FIND PACKAGE WITH SPECIFIED NAME
(find-package <package>)
- <package> package to find
- returns package with name or nickname <package>, or NIL if not found
LOOK UP A SYMBOL
(find-symbol <string> [<package>])
IMPORT SYMBOLS INTO A PACKAGE
(import <symbols> [<package>])
- <symbols> symbols to import (fully qualified names)
- <package> package to import symbols into
- returns T
SET CURRENT PACKAGE
(in-package <package>)
FSUBR which sets the current package until next call or end of current LOAD.
- <package> the package to enter
- returns the package
GET ALL PACKAGE NAMES
(list-all-packages)
- returns list of all currently existing packages
MAKE A NEW PACKAGE
(make-package <package> &key :nicknames :use)
- <package> name of new package to create
- :nicknames list of package nicknames
- :use list of packages to use (as in USE-PACKAGE)
- returns the new package
GET PACKAGE NAME STRING
(package-name <package>)
- <package> package name
- returns package name string
GET PACKAGE NICKNAME STRINGS
(package-nicknames <package>)
- <package> package name
- returns list of package nickname strings
GET AN OBARRAY
(package-obarray <package> [<external>])
- <package> package to use
- <external> non-nil for external obarray, else internal obarray (default)
- returns the obarray (array of lists of symbols in package)
GET LIST OF SHADOWING SYMBOLS
(package-shadowing-symbols <package>)
- <package> the package
- returns list of shadowing symbols in package
GET PACKAGES USED BY A PACKAGE
(package-use-list <package>)
- <package> the package
- returns list of packages used by this package (as in USE-PACKAGE)
GET PACKAGES THAT USE THIS PACKAGE
(package-used-by-list <package>)
- <package> the package
- returns list of packages that use this package (as in USE-PACKAGE)
IS THIS A GOOD PACKAGE?
(package-valid-p <package>)
- <package> object to check
- returns T if a valid package, else NIL
RENAME A PACKAGE
(rename-package <package> <new> [<nick>])
- <package> original package
- <new> new package name (may be same as original name)
- <nick> list of new package nicknames
- returns the new package
MAKE SHADOWING SYMBOLS
(shadow <symbols> [<package>])
If a symbol is not already in the package, it is interned. The symbol is placed in the shadowing symbols list for the package.
- <symbols> the symbol or symbols to shadow
- <package> package to put symbols in
- returns T
IMPORT SYMBOLS AND SHADOW
(shadowing-import <symbols> [<package>])
If a symbol exists in the package, it is first uninterned. The symbol is imported, and then made shadowing.
- <symbols> the symbol or symbols to import and shadow
- <package> package to put symbols in
- returns T
FIND THE PACKAGE OF A SYMBOL
(symbol-package <symbol>)
- <symbol> the symbol
- returns the home package of the symbol, or NIL if none
MAKE SYMBOLS INTERNAL TO PACKAGE
(unexport <symbols> [<package>])
- <symbols> symbol or symbols to make internal
- <package> package for symbols
- returns T
REMOVE PACKAGES FROM USE LIST
(unuse-package <pkgs> [<package>])
- <pkgs> A single package or list of packages
- <package> Package in which to un-use packages (default is current package)
- returns T
ADD PACKAGES TO USE LIST
(use-package <pkgs> [<package>])
- <pkgs> A single package or list of packages
- <package> Package in which to use packages in (default is current package)
- returns T
XLISP-PLUS - Version 2.1g - Tom Almy
tom.almy@tek.com - 18 JUL 94
Generated with WebMaker