Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the in-nomine Reference Manual, version 1.0, generated automatically by Declt version 3.0 "Montgomery Scott" on Sun May 15 05:02:46 2022 GMT+0.
• Introduction | What in-nomine is all about | |
• Systems | The systems documentation | |
• Modules | The modules documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
The beginning of wisdom is to call things by their proper name.
-- Confucius
This is a utility for creating, accessing, and managing custom namespaces in Common Lisp. Originally started as a fork of LISP-NAMESPACE
, it became its own piece of software that is somewhat backwards compatible with it.
LISP-NAMESPACE
NAMESPACE-LET
and NSLET
,DEFINE-NAMESPACE
option to automatically generate NAMESPACE-LET
-based binding macros,DEFINE-NAMESPACE
to customize behavior of generated namespaces,A namespace is a second-class concept in Common Lisp and refers to concept that allows to associate names of some sort with objects of some sort.
Common Lisp has a lot of namespaces whose keys can come in various shapes:
This system is a utility to bring a first-class implementation of the concept of namespaces along with utilities to customize and manage them.
The heart of the facility is the DEFINE-NAMESPACE
macro, which comes in two forms: short (syntax-compatible with LISP-NAMESPACE:DEFINE-NAMESPACE
and with mostly compatible effects) and long form (allowing for greater behavior customization).
DEFINE-NAMESPACE
, by default, generates functions for accessing the namespace, a condition signaled whenever an access to an unbound name is attempted, a type which denotes the values permissible in a namespace, and documentation types.
By default, names are symbols and compared via EQ
. This behavior is consistent with the way Common Lisp names variables and classes.
IN-NOMINE> (define-namespace thing)
#<NAMESPACE THING (0 bindings)>
IN-NOMINE> (setf (symbol-thing 'foo) 42
(symbol-thing 'bar) :keyword
(symbol-thing 'baz) *readtable*)
#<READTABLE {1000022CA3}>
IN-NOMINE> (mapcar #'symbol-thing '(foo bar baz))
(42 :KEYWORD #<READTABLE {1000022CA3}>)
It is possible to customize this behavior, though, and get e.g. a namespace in which names are non-negative numbers.
IN-NOMINE> (define-namespace player
;; Use numbers as hash table keys
:name-type unsigned-byte
;; Numbers are EQL-comparable
:hash-table-test eql
:accessor player-no)
#<NAMESPACE PLAYER (0 bindings)>
IN-NOMINE> (setf (player-no 8) :jerry
(player-no 0) :thomas
(player-no 2) :michael)
:MICHAEL
IN-NOMINE> (player-no 8)
:JERRY
IN-NOMINE> (player-no 1)
;; Error: Name 1 is unbound in namespace PLAYER.
;; [Condition of type UNBOUND-PLAYER]
It is possible to utilize different name types along with all four standard hash table keys and produce namespaces with different possible name values. Examples:
EQ
for symbols,EQL
for numbers and characters,EQUAL
for strings or lists,EQUALP
for strings without case sensitivity.In Nomine by default provides documentation types with the same names as namespace names.
IN-NOMINE> (setf (documentation 8 'player) "The best player ever.")
"The best player ever."
IN-NOMINE> (documentation 8 'player)
"The best player ever."
In addition, In Nomine hooks into implementation-defined CL:DESCRIBE
in order to provide information about namespace bindings.
IN-NOMINE> (describe 'foo)
IN-NOMINE::FOO
[symbol]
Symbol FOO is bound in namespace THING:
Value: 42
(undocumented)
; No value
IN-NOMINE> (describe 8)
8
[fixnum]
8 is bound in namespace PLAYER:
Value: :JERRY
Documentation:
The best player ever.
; No value
IN-NOMINE
Loaded via (asdf:load-system :in-nomine)
.
Utilities for defining additional namespaces in Common Lisp.
Common Lisp is a Lisp-N, which means that it has a different namespaces for variables, functions, types, and so on. Users can also define their own namespaces, and In Nomine is a toolkit for making that process easier.
DEFINE-NAMESPACE
Defines a new namespace object in the global namespace namespace along with a series of functions, types, conditions, and type proclamations for accessing this namespace.
Two forms of this macro are provided:
(DEFINE-NAMESPACE NAME &OPTIONAL VALUE-TYPE BINDING DOCUMENTATION)
NAME
- a symbol naming the namespace,VALUE-TYPE
- a type specifier for values bound in this namespace,BINDING
- deprecated, only present for syntax compatibility with LISP-NAMESPACE
; must be NIL
when provided,DOCUMENTATION
- documentation string for the namespace object.FOO
, the following are generated:
SYMBOL-FOO
and (SETF SYMBOL-FOO)
,FOO-MAKUNBOUND
,FOO-BOUNDP
,UNBOUND-FOO
,FOO-TYPE
denoting the specified VALUE-TYPE
,(EQL 'FOO)
.(DEFINE-NAMESPACE NAME &KEY NAME-TYPE VALUE-TYPE ACCESSOR CONDITION-NAME TYPE-NAME MAKUNBOUND-SYMBOL BOUNDP-SYMBOL DOCUMENTATION-TYPE ERROR-WHEN-NOT-FOUND-P ERRORP-ARG-IN-ACCESSOR-P DEFAULT-ARG-IN-ACCESSOR-P HASH-TABLE-TEST BINDING-TABLE-VAR DOCUMENTATION-TABLE-VAR DOCUMENTATION)
NAME
- a symbol naming the namespace,NAME-TYPE
- a type specifiers for keys bound in this namespace,VALUE-TYPE
- a type specifier for values bound in this namespace,ACCESSOR
- a symbol naming the accessor functions, or NIL
if no such accessor should be defined,CONDITION-NAME
- a symbol naming the condition type signaled when an attempt is made to access an unbound name, or NIL
if no such accessor should be defined,TYPE-NAME
- a symbol naming the type for the namespace values, or NIL
if no such type should be defined,MAKUNBOUND-SYMBOL
- symbol naming the namespace makunbound function, or NIL
if no such function should be defined,BOUNDP-SYMBOL
- a symbol naming the namespace boundp function, or NIL
if no such function should be defined,DOCUMENTATION-TYPE
- a symbol naming the documentation type for the namespace values, or NIL
if no such documentation should be defined,ERROR-WHEN-NOT-FOUND-P
- a boolean stating whether a reader function should signal an error if it attempts to access an unbound name,ERRORP-ARG-IN-ACCESSOR-P
- a boolean stating whether accessor functions should have an optional ERRORP
argument for stating whether an unbound condition should be signaled when an attempt is made to access an unbound name,DEFAULT-ARG-IN-ACCESSOR-P
- a boolean stating whether accessor functions should have an optional DEFAULT
argument for automatic setting of unbound values,HASH-TABLE-TEST
- a symbol naming the hash table test of the binding and documentation hash tables of the namespace,BINDING-TABLE-VAR
- a symbol naming the variable whose value shall be the binding table of the namespace, or NIL
if no such variable should be defined,DOCUMENTATION-TABLE-VAR
- a symbol naming the variable whose value shall be the documentation table of the namespace, or NIL
if no such variable should be defined,DOCUMENTATION
- documentation string for the namespace object.The consequences are undefined if a namespace is redefined in an incompatible way with the previous one.
SYMBOL-NAMESPACE
Returns a namespace object with the given global name. Signals UNBOUND-NAMESPACE
unless ERRORP
is set.
CLEAR-NAMESPACE
Removes all bindings in the namespace with the given name.
NAMESPACE-MAKUNBOUND
Makes the name globally unbound as a namespace regardless of whether the name was previously bound.
NAMESPACE-BOUNDP
Returns true if a namespace object with the provided name is globally bound, false otherwise.
UNBOUND-NAMESPACE
A subtype of CELL-ERROR
signaled when there is an attempt to access a namespace object that does not exist.
NAMESPACE
A class of namespace objects which represent a Common Lisp namespace.
NAMESPACE-NAME
Returns the symbol naming a namespace.
NAMESPACE-NAME-TYPE
Returns the type of names that are possible to bind in a namespace.
NAMESPACE-VALUE-TYPE
Returns the type of values that are possible to bind in a namespace.
NAMESPACE-ACCESSOR
Returns the symbol naming the namespace accessor, or NIL
if no such accessor is defined.
NAMESPACE-CONDITION-NAME
Returns the symbol naming the condition type signaled when an attempt is made to access an unbound name, or NIL
if no such condition type is defined
NAMESPACE-TYPE-NAME
Returns the symbol naming the type for the namespace values, or NIL
if no such type is defined.
NAMESPACE-MAKUNBOUND-SYMBOL
Returns the symbol naming the namespace makunbound function, or NIL
if no such function exists.
NAMESPACE-BOUNDP-SYMBOL
Returns the symbol naming the namespace boundp function, or NIL
if no such function exists.
NAMESPACE-DOCUMENTATION-TYPE
Returns the symbol naming the documentation type for the namespace values, or NIL
if no such documentation type exists.
NAMESPACE-ERROR-WHEN-NOT-FOUND-P
Returns a boolean stating whether a reader function should signal an error if it attempts to access an unbound name.
NAMESPACE-ERRORP-ARG-IN-ACCESSOR-P
Returns a boolean stating whether accessor functions should have an optional ERRORP
argument for stating whether an unbound condition should be signaled when an attempt is made to access an unbound name.
NAMESPACE-DEFAULT-ARG-IN-ACCESSOR-P
Returns a boolean stating whether accessor functions should have an optional DEFAULT
argument for automatic setting of unbound values.
NAMESPACE-HASH-TABLE-TEST
Returns the symbol naming the hash table test of the binding and documentation hash tables of the namespace.
NAMESPACE-BINDING-TABLE
Returns the binding hash table, or NIL
if no binding mechanism is defined.
NAMESPACE-DOCUMENTATION-TABLE
Returns the documentation hash table, or NIL
if no documentation type is defined.
NAMESPACE-BINDING-TABLE-VAR
Returns the symbol naming the variable whose value is the binding table of the namespace, or NIL
if no such variable is defined.
NAMESPACE-DOCUMENTATION-TABLE-VAR
Returns the symbol naming the variable whose value is the documentation table of the namespace, or NIL
if no such variable is defined.
NAMESPACE
A namespace for managing namespaces.
Licensed under the LLGPL License.
A man that should call everything by its right name, would hardly pass the streets without being knocked down as a common enemy.
-- Lord Halifax
Next: Modules, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The in-nomine system |
Masataro Asai <guicho2.71828@gmail.com>
Michał "phoe" Herda <phoe@disroot.org>
LLGPL
Utilities for extensible namespaces in Common Lisp.
1.0
alexandria
in-nomine.asd (file)
Modules are listed depth-first from the system components tree.
• The in-nomine/define-namespace module |
definers.lisp (file)
in-nomine (system)
define-namespace/
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
Next: The in-nomine/package․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
/home/quickref/quicklisp/dists/quicklisp/software/in-nomine-20220220-git/in-nomine.asd
in-nomine (system)
Next: The in-nomine/namespace․lisp file, Previous: The in-nomine․asd file, Up: Lisp files [Contents][Index]
Next: The in-nomine/definers․lisp file, Previous: The in-nomine/package․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
in-nomine (system)
namespace.lisp
Next: The in-nomine/define-namespace/common․lisp file, Previous: The in-nomine/namespace․lisp file, Up: Lisp files [Contents][Index]
namespace.lisp (file)
in-nomine (system)
definers.lisp
Next: The in-nomine/define-namespace/short․lisp file, Previous: The in-nomine/definers․lisp file, Up: Lisp files [Contents][Index]
define-namespace (module)
define-namespace/common.lisp
Next: The in-nomine/define-namespace/long․lisp file, Previous: The in-nomine/define-namespace/common․lisp file, Up: Lisp files [Contents][Index]
define-namespace (module)
define-namespace/short.lisp
%define-namespace-short-form (function)
Next: The in-nomine/define-namespace/macro․lisp file, Previous: The in-nomine/define-namespace/short․lisp file, Up: Lisp files [Contents][Index]
define-namespace (module)
define-namespace/long.lisp
Next: The in-nomine/methods․lisp file, Previous: The in-nomine/define-namespace/long․lisp file, Up: Lisp files [Contents][Index]
define-namespace (module)
define-namespace/macro.lisp
Next: The in-nomine/describe-object․lisp file, Previous: The in-nomine/define-namespace/macro․lisp file, Up: Lisp files [Contents][Index]
define-namespace (module)
in-nomine (system)
methods.lisp
Next: The in-nomine/documentation․lisp file, Previous: The in-nomine/methods․lisp file, Up: Lisp files [Contents][Index]
methods.lisp (file)
in-nomine (system)
describe-object.lisp
Previous: The in-nomine/describe-object․lisp file, Up: Lisp files [Contents][Index]
describe-object.lisp (file)
in-nomine (system)
documentation.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The in-nomine package |
Utilities for defining additional namespaces in Common Lisp.
Common Lisp is a Lisp-N, which means that it has a different namespaces for variables, functions, types, and so on. Users can also define their own namespaces, and In Nomine is a toolkit for making that process easier.
package.lisp (file)
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported macros | ||
• Exported functions | ||
• Exported conditions | ||
• Exported structures |
Next: Exported functions, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
Defines a new namespace object in the global namespace namespace along with
a series of functions, types, conditions, and type proclamations for accessing
this namespace.
Two forms of this macro are provided:
* short form:
* (DEFINE-NAMESPACE NAME &OPTIONAL VALUE-TYPE BINDING DOCUMENTATION)
* NAME - a symbol naming the namespace,
* VALUE-TYPE - a type specifier for values bound in this namespace,
* BINDING - deprecated, only present for syntax compatibility with
LISP-NAMESPACE; must be NIL when provided,
* DOCUMENTATION - documentation string for the namespace object.
* For name FOO, the following are generated:
* Accessor functions SYMBOL-FOO and (SETF SYMBOL-FOO),
* Makunbound function FOO-MAKUNBOUND,
* Boundp function FOO-BOUNDP,
* Type proclamations for the four functions above,
* Condition type UNBOUND-FOO,
* Type FOO-TYPE denoting the specified VALUE-TYPE,
* Documentation methods with documentation type specialized on (EQL ’FOO).
* long form:
* (DEFINE-NAMESPACE NAME
&KEY NAME-TYPE VALUE-TYPE ACCESSOR CONDITION-NAME TYPE-NAME
MAKUNBOUND-SYMBOL BOUNDP-SYMBOL DOCUMENTATION-TYPE
ERROR-WHEN-NOT-FOUND-P ERRORP-ARG-IN-ACCESSOR-P
DEFAULT-ARG-IN-ACCESSOR-P HASH-TABLE-TEST
BINDING-TABLE-VAR DOCUMENTATION-TABLE-VAR DOCUMENTATION)
* NAME - a symbol naming the namespace,
* NAME-TYPE - a type specifiers for keys bound in this namespace,
* VALUE-TYPE - a type specifier for values bound in this namespace,
* ACCESSOR - a symbol naming the accessor functions, or NIL if no such
accessor should be defined,
* CONDITION-NAME - a symbol naming the condition type signaled when an
attempt is made to access an unbound name, or NIL if no
such accessor should be defined,
* TYPE-NAME - a symbol naming the type for the namespace values, or NIL if
no such type should be defined,
* MAKUNBOUND-SYMBOL - symbol naming the namespace makunbound function, or
NIL if no such function should be defined,
* BOUNDP-SYMBOL - a symbol naming the namespace boundp function, or NIL if
no such function should be defined,
* DOCUMENTATION-TYPE - a symbol naming the documentation type for the
namespace values, or NIL if no such documentation
should be defined,
* ERROR-WHEN-NOT-FOUND-P - a boolean stating whether a reader function
should signal an error if it attempts to access
an unbound name,
* ERRORP-ARG-IN-ACCESSOR-P - a boolean stating whether accessor functions
should have an optional ERRORP argument for
stating whether an unbound condition should be
signaled when an attempt is made to access an
unbound name,
* DEFAULT-ARG-IN-ACCESSOR-P - a boolean stating whether accessor functions
should have an optional DEFAULT argument for
automatic setting of unbound values,
* HASH-TABLE-TEST - a symbol naming the hash table test of the binding and
documentation hash tables of the namespace,
* BINDING-TABLE-VAR - a symbol naming the variable whose value shall be the
binding table of the namespace, or NIL if no such
variable should be defined,
* DOCUMENTATION-TABLE-VAR - a symbol naming the variable whose value shall
be the documentation table of the namespace, or
NIL if no such variable should be defined,
* DOCUMENTATION - documentation string for the namespace object.
The consequences are undefined if a namespace is redefined in an incompatible way with the previous one.
macro.lisp (file)
Next: Exported conditions, Previous: Exported macros, Up: Exported definitions [Contents][Index]
Removes all bindings in the namespace with the given name.
macro.lisp (file)
Returns the symbol naming the namespace accessor, or NIL if no such accessor is defined.
namespace.lisp (file)
Returns the binding hash table, or NIL if no binding mechanism is defined.
namespace.lisp (file)
(setf namespace-binding-table) (function)
namespace.lisp (file)
namespace-binding-table (function)
Returns the symbol naming the variable whose value is the binding table of the namespace, or NIL if no such variable is defined.
namespace.lisp (file)
Returns true if a namespace object with the provided name is globally bound, false otherwise.
macro.lisp (file)
Returns the symbol naming the namespace boundp function, or NIL if no such function exists.
namespace.lisp (file)
Returns the symbol naming the condition type signaled when an attempt is made to access an unbound name, or NIL if no such condition type is defined
namespace.lisp (file)
Returns a boolean stating whether accessor functions should have an optional DEFAULT argument for automatic setting of unbound values.
namespace.lisp (file)
Returns the documentation hash table, or NIL if no documentation type is defined.
namespace.lisp (file)
(setf namespace-documentation-table) (function)
namespace.lisp (file)
namespace-documentation-table (function)
Returns the symbol naming the variable whose value is the documentation table of the namespace, or NIL if no such variable is defined.
namespace.lisp (file)
Returns the symbol naming the documentation type for the namespace values, or NIL if no such documentation type exists.
namespace.lisp (file)
Returns a boolean stating whether a reader function should signal an error if it attempts to access an unbound name.
namespace.lisp (file)
Returns a boolean stating whether accessor functions should have an optional ERRORP argument for stating whether an unbound condition should be signaled when an attempt is made to access an unbound name.
namespace.lisp (file)
Returns the symbol naming the hash table test of the binding and documentation hash tables of the namespace.
namespace.lisp (file)
Makes the name globally unbound as a namespace regardless of whether the name was previously bound.
macro.lisp (file)
Returns the symbol naming the namespace makunbound function, or NIL if no such function exists.
namespace.lisp (file)
Returns the symbol naming a namespace.
namespace.lisp (file)
Returns the type of names that are possible to bind in a namespace.
namespace.lisp (file)
Returns the symbol naming the type for the namespace values, or NIL if no such type is defined.
namespace.lisp (file)
Returns the type of values that are possible to bind in a namespace.
namespace.lisp (file)
Returns a namespace object with the given global name. Signals UNBOUND-NAMESPACE unless ERRORP is set.
macro.lisp (file)
Next: Exported structures, Previous: Exported functions, Up: Exported definitions [Contents][Index]
A subtype of CELL-ERROR signaled when there is an attempt to access a namespace object that does not exist.
macro.lisp (file)
cell-error (condition)
Previous: Exported conditions, Up: Exported definitions [Contents][Index]
A class of namespace objects which represent a Common Lisp namespace.
namespace.lisp (file)
structure-object (structure)
symbol
(in-nomine::e)
namespace-name (function)
(setf namespace-name) (function)
(in-nomine::e)
namespace-name-type (function)
(setf namespace-name-type) (function)
(in-nomine::e)
namespace-value-type (function)
(setf namespace-value-type) (function)
symbol
(in-nomine::e)
namespace-accessor (function)
(setf namespace-accessor) (function)
symbol
(in-nomine::e)
namespace-condition-name (function)
(setf namespace-condition-name) (function)
symbol
(in-nomine::e)
namespace-type-name (function)
(setf namespace-type-name) (function)
symbol
(in-nomine::e)
namespace-makunbound-symbol (function)
(setf namespace-makunbound-symbol) (function)
symbol
(in-nomine::e)
namespace-boundp-symbol (function)
(setf namespace-boundp-symbol) (function)
symbol
(in-nomine::e)
namespace-documentation-type (function)
(setf namespace-documentation-type) (function)
symbol
(in-nomine::e)
namespace-hash-table-test (function)
(setf namespace-hash-table-test) (function)
boolean
(in-nomine::e)
namespace-error-when-not-found-p (function)
(setf namespace-error-when-not-found-p) (function)
boolean
(in-nomine::e)
namespace-errorp-arg-in-accessor-p (function)
(setf namespace-errorp-arg-in-accessor-p) (function)
boolean
(in-nomine::e)
namespace-default-arg-in-accessor-p (function)
(setf namespace-default-arg-in-accessor-p) (function)
(or null string)
(in-nomine::e)
namespace-documentation (function)
(setf namespace-documentation) (function)
(or null hash-table)
(in-nomine::e)
namespace-binding-table (function)
(setf namespace-binding-table) (function)
(or null hash-table)
(in-nomine::e)
namespace-documentation-table (function)
(setf namespace-documentation-table) (function)
symbol
(in-nomine::e)
namespace-binding-table-var (function)
(setf namespace-binding-table-var) (function)
symbol
(in-nomine::e)
namespace-documentation-table-var (function)
(setf namespace-documentation-table-var) (function)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal special variables | ||
• Internal macros | ||
• Internal functions |
Next: Internal macros, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
describe-object.lisp (file)
namespace.lisp (file)
namespace.lisp (file)
Next: Internal functions, Previous: Internal special variables, Up: Internal definitions [Contents][Index]
describe-object.lisp (file)
Previous: Internal macros, Up: Internal definitions [Contents][Index]
short.lisp (file)
namespace.lisp (file)
common.lisp (file)
namespace.lisp (file)
common.lisp (file)
namespace.lisp (file)
namespace.lisp (file)
definers.lisp (file)
definers.lisp (file)
definers.lisp (file)
definers.lisp (file)
definers.lisp (file)
namespace.lisp (file)
describe-object.lisp (file)
definers.lisp (file)
definers.lisp (file)
definers.lisp (file)
definers.lisp (file)
definers.lisp (file)
namespace.lisp (file)
namespace.lisp (file)
definers.lisp (file)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | F I L M |
---|
Jump to: | F I L M |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | %
(
C D E F M N P R S W |
---|
Jump to: | %
(
C D E F M N P R S W |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
A B C D E H M N S T V |
---|
Jump to: | *
A B C D E H M N S T V |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | C I N P S U |
---|
Jump to: | C I N P S U |
---|