This is the nsymbols Reference Manual, version 0.3.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Wed Mar 15 07:07:22 2023 GMT+0.
The main system appears first, followed by any subsystem dependency.
nsymbols
A set of convenience functions to list class, variable, function, and other symbols.
Atlas Engineer LLC
BSD-3 Clause
0.3.0
package.lisp
(file).
nsymbols.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
nsymbols/nsymbols.lisp
package.lisp
(file).
nsymbols
(system).
%symbol%
(special variable).
*default-packages*
(special variable).
class-symbol
(type).
class-symbol-p
(function).
define-symbol-type
(macro).
filter-symbols
(function).
function-symbol
(type).
function-symbol-p
(function).
generic-function-symbol
(type).
generic-function-symbol-p
(function).
macro-symbol
(type).
macro-symbol-p
(function).
multiple-resolved-symbols-error
(condition).
package-classes
(function).
package-functions
(function).
package-generic-functions
(function).
package-macros
(function).
package-structures
(function).
package-symbols
(function).
package-variables
(function).
resolve-symbol
(function).
structure-symbol
(type).
structure-symbol-p
(function).
symbol-visibility
(function).
symbol-visibility
(type).
variable-symbol
(type).
variable-symbol-p
(function).
*symbol-types*
(special variable).
designator
(reader method).
(setf designator)
(writer method).
package-designator
(type).
results
(reader method).
(setf results)
(writer method).
string-designator
(type).
symbol-type
(type).
Packages are listed by definition order.
nsymbols
‘nsymbols’ exports functions and variables to filter symbols in packages.
There are functions directly listing symbols:
- ‘package-symbols’ (the one all the other functions build upon).
- ‘package-variables’.
- ‘package-functions’.
- ‘package-generic-functions’.
- ‘package-macros’.
- ‘package-classes’.
- ‘package-structures’.
And there are respective CL types for those symbols to check symbol validity:
- ‘variable-symbol’.
- ‘function-symbol’.
- ‘generic-function-symbol’.
- ‘macro-symbol’.
- ‘class-symbol’.
- ‘structure-symbol’.
These types use the predicates to check symbol type:
- ‘variable-symbol-p’.
- ‘function-symbol-p’.
- ‘generic-function-symbol-p’.
- ‘macro-symbol-p’.
- ‘class-symbol-p’.
- ‘structure-symbol-p’.
Adding to the regular package-* listings, there is a "nsymbols/star"
ASDF system with:
- ‘package-functions*’.
- ‘package-generic-functions*’.
- ‘package-methods*’.
- ‘package-classes*’.
- ‘package-structures*’
- ‘package-slots*’
which return the respective function, class, method etc. objects
instead of symbols for those.
As you can see, those are pretty regular. That’s due to using
‘define-symbol-type’ that saves a lot of work in defining new types of
symbols. More so: it allows assigning a name to a symbol type, so that
you can, for example, refer to this type in ‘package-symbols’ or
‘resolve-symbol’.
;; Define an absurd type of symbols starting with A.
(nsymbols:define-symbol-type starts-with-a ()
(char-equal #a (elt (symbol-name nsymbols:%symbol%) 0)))
;; Use it
(nsymbols:package-starts-with-as :nsymbols)
;; => (NSYMBOLS::ALL-PACKAGES)
Now, ‘resolve-symbol’ is a convenient symbol search function that
searches for a symbol by name in given packages, based on its type and
visibility. Which allows you to fine-tune the search to whatever set
of symbols you want:
;; Search any type of HELLO symbol in ‘*default-packages*’:
(nsymbols:resolve-symbol :hello :any)
;; Search any type of * in CL:
(nsymbols:resolve-symbol :* :any :cl)
;; Search function named * in CL:
(nsymbols:resolve-symbol :* :function :cl)
;; Search a custom type defined earlier:
(nsymbols:resolve-symbol "ALL-PACKAGES" :starts-with-a :nsymbols)
common-lisp
.
%symbol%
(special variable).
*default-packages*
(special variable).
class-symbol
(type).
class-symbol-p
(function).
define-symbol-type
(macro).
filter-symbols
(function).
function-symbol
(type).
function-symbol-p
(function).
generic-function-symbol
(type).
generic-function-symbol-p
(function).
macro-symbol
(type).
macro-symbol-p
(function).
multiple-resolved-symbols-error
(condition).
package-classes
(function).
package-functions
(function).
package-generic-functions
(function).
package-macros
(function).
package-structures
(function).
package-symbols
(function).
package-variables
(function).
resolve-symbol
(function).
structure-symbol
(type).
structure-symbol-p
(function).
symbol-visibility
(function).
symbol-visibility
(type).
variable-symbol
(type).
variable-symbol-p
(function).
*symbol-types*
(special variable).
designator
(generic reader).
(setf designator)
(generic writer).
package-designator
(type).
results
(generic reader).
(setf results)
(generic writer).
string-designator
(type).
symbol-type
(type).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Special variable to bind symbols during type-checking to.
Package designator or a list of package designators for ‘resolve-symbol’ to use by default.
Define a new symbol type.
Generates several functions and exports them out of :nsymbols package
for convenience (%NAME% is substituted with NAME):
- %NAME%-SYMBOL-P – a predicate checking the symbol for being of this type.
- %NAME%-SYMBOL – a type to check the symbol.
- PACKAGE-%NAME%S – a configurable package symbol listing.
In other words, it generates VARIABLE-SYMBOL-P, VARIABLE-SYMBOL, and
PACKAGE-VARIABLES for VARIABLE symbol type.
NAME is a symbol designator to reference this symbol type in
‘resolve-symbol’, or a list of two symbol designators:
- First symbol designator is the symbol type name.
- Second designator is its plural version, if atypical.
PREDICATE-BODY is the body of the boolean-returning function to find
the required symbols among the list of other symbols. You can refer to
the symbol being checked with a special variable %SYMBOL%.
Return the list of all symbols from PACKAGES.
If VISIBILITY is specified, only include symbols with that visibility.
If TYPE is specified, only include symbols of that type.
PACKAGES can be a single package designator or a list of package designators. VISIBILITY can be one of :ANY, :INTERNAL, :EXTERNAL, or :INHERITED.
Find the symbol (of symbol type TYPE) designated by DESIGNATOR in PACKAGES (and subpackages).
PACKAGES should be a package designator or a list thereof.
ERROR-P, when present and true, raises a continuable error of type
‘multiple-resolved-symbols-error’ if there is more than one symbol
found matching the DESIGNATOR.
The table from the name of the symbol type (as a symbol name string) to the predicate of this type as a function symbol.
multiple-resolved-symbols-error
)) ¶multiple-resolved-symbols-error
)) ¶multiple-resolved-symbols-error
)) ¶multiple-resolved-symbols-error
)) ¶Jump to: | (
C D F G M P R S V |
---|
Jump to: | (
C D F G M P R S V |
---|
Jump to: | %
*
D R S |
---|
Jump to: | %
*
D R S |
---|
Jump to: | C F G M N P S T V |
---|
Jump to: | C F G M N P S T V |
---|