The modularize Reference Manual

This is the modularize Reference Manual, version 1.0.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 06:09:30 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 modularize

A modularization framework

Maintainer

Yukari Hafner <>

Author

Yukari Hafner <>

Home Page

https://Shinmera.github.io/modularize/

Source Control

(GIT https://github.com/Shinmera/modularize.git)

Bug Tracker

https://github.com/Shinmera/modularize/issues

License

zlib

Version

1.0.0

Dependencies
  • documentation-utils (system).
  • trivial-package-local-nicknames (system).
Source

modularize.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 modularize/modularize.asd

Source

modularize.asd.

Parent Component

modularize (system).

ASDF Systems

modularize.


3.1.2 modularize/package.lisp

Source

modularize.asd.

Parent Component

modularize (system).

Packages

3.1.3 modularize/package-toolkit.lisp

Dependency

package.lisp (file).

Source

modularize.asd.

Parent Component

modularize (system).

Internals

3.1.4 modularize/hooks.lisp

Dependency

package-toolkit.lisp (file).

Source

modularize.asd.

Parent Component

modularize (system).

Public Interface
Internals

3.1.5 modularize/module.lisp

Dependency

hooks.lisp (file).

Source

modularize.asd.

Parent Component

modularize (system).

Public Interface
Internals

3.1.6 modularize/options.lisp

Dependency

module.lisp (file).

Source

modularize.asd.

Parent Component

modularize (system).

Public Interface

3.1.7 modularize/asdf.lisp

Dependency

options.lisp (file).

Source

modularize.asd.

Parent Component

modularize (system).

Public Interface
Internals

3.1.8 modularize/documentation.lisp

Dependency

asdf.lisp (file).

Source

modularize.asd.

Parent Component

modularize (system).


4 Packages

Packages are listed by definition order.


4.1 org.shirakumo.radiance.lib.modularize.user

Source

package.lisp.

Nickname

modularize-user

Use List

4.2 modularize

Source

package.lisp.

Nicknames
  • org.shirakumo.radiance.lib.modularize
  • radiance-modularize
Use List

common-lisp.

Used By List

org.shirakumo.radiance.lib.modularize.user.

Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Macros

Macro: current-module ()

Macro that expands to the module in the current package. Useful to establish a module context.

Package

modularize.

Source

module.lisp.

Macro: define-delete-hook ((modulevar &optional identifier) &body body)

Defines a new deletion hook.

The identifier is defaulted to a keyword representation of the current package name.

Package

modularize.

Source

hooks.lisp.

Macro: define-modularize-hook ((modulevar &optional identifier) &body body)

Defines a new modularization hook.

The identifier is defaulted to a keyword representation of the current package name.

Package

modularize.

Source

hooks.lisp.

Macro: define-module (name &body options)

Defines a new module.

This essentially defines a new package with the given name, calls MODULARIZE on it and then expands all options to extend the package/module.

Package

modularize.

Source

module.lisp.

Macro: define-module-extension ((module-identifier name) &body options)

Defines a module extension.

This gives the existing module new nicknames and expands the given options on it to add functionality.

Package

modularize.

Source

module.lisp.

Macro: define-option-expander (name (package &rest arguments) &body body)

Defines a new option expander that is called whenever the option is used in the module definition.

This should run whatever is necessary to accomplish the
desired option effect. The expanders are run AFTER the
modularize call, so you can use the module storage in
your expansions.

Package

modularize.

Source

module.lisp.

Macro: with-module ((var &optional module) &body body)

Binds the resolved MODULE to VAR.

Package

modularize.

Source

module.lisp.


5.1.2 Ordinary functions

Function: call-delete-hooks (package)

Calls all deletion hooks on the package.

Package

modularize.

Source

hooks.lisp.

Function: call-modularize-hooks (package)

Calls all modularization hooks on the package.

Package

modularize.

Source

hooks.lisp.

Function: delete-hook (identifier)

Accesses the deletion hook function associated with the identifier.

Package

modularize.

Source

hooks.lisp.

Function: (setf delete-hook) (identifier)
Package

modularize.

Source

hooks.lisp.

Function: delete-module (module)

Attempts to completely delete the given module.

This first calls the delete hooks, then demodularizes the package, unbinds all symbols in the package from values and functions, and finally deletes the package.

Package

modularize.

Source

module.lisp.

Function: demodularize (module)

Removes the module from the module storage table.

This essentially returning it back to a normal package. Any additional effects by module options or modularization hooks can of course not be undone by this.

Package

modularize.

Source

module.lisp.

Function: list-modules ()

Returns a list of all modules in no particular order.

Package

modularize.

Source

module.lisp.

Function: load-module (identifier)

Attempts to find the module named by identifier and load its ASDF system.

Package

modularize.

Source

asdf.lisp.

Function: map-modules (function)

Calls the function once with each module in no particular order.

Package

modularize.

Source

module.lisp.

Function: modularize (&key package name)

Turns the given package into one that is identified as a module.

What this does is register the package on the module
storage table, add the name and identifiers to it,
and then call the modularize hooks.

Package

modularize.

Source

module.lisp.

Function: modularize-hook (identifier)

Accessor to the modularization hook function associated with the identifier.

Package

modularize.

Source

hooks.lisp.

Function: (setf modularize-hook) (identifier)
Package

modularize.

Source

hooks.lisp.

Function: module (&optional identifier)

Attempts to return the matching module package.

If not possible, a condition of type MODULE-NOT-FOUND is signalled.

You may pass a STRING, SYMBOL or PACKAGE as the identifier.
If NIL is passed, the current *PACKAGE* is used instead.

Package

modularize.

Source

module.lisp.

Function: module-identifier (module)

Returns the identifier of the module.

Package

modularize.

Source

module.lisp.

Function: module-name (module)

Returns the name of the module.

Package

modularize.

Source

module.lisp.

Function: module-p (object)

Returns non-NIL if the passed object is or resolves to a module package, otherwise NIL.

Package

modularize.

Source

module.lisp.

Function: module-packages (module)

Accesses the packages that are sub-packages under the module.

The list may contain package objects or package-names.

You can only add packages that are not already registered as sub-packages to a module, and are not themselves a module.

Package

modularize.

Source

module.lisp.

Function: (setf module-packages) (module)
Package

modularize.

Source

module.lisp.

Function: module-storage (module &optional key)

Accesses the module storage table of the module or a field from it if a key is passed.

Package

modularize.

Source

module.lisp.

Function: (setf module-storage) (module &optional key)
Package

modularize.

Source

module.lisp.

Function: module-storage-remove (module key)

Removes a key from the module storage table.

Package

modularize.

Source

module.lisp.

Function: register-virtual-module (module)

Registers the given module in the virtual module map.

Package

modularize.

Source

asdf.lisp.

Function: remove-delete-hook (identifier)

Removes the deletion hook named by the identifier.

Package

modularize.

Source

hooks.lisp.

Function: remove-modularize-hook (identifier)

Removes the modularization hook named by the identifier.

Package

modularize.

Source

hooks.lisp.


5.1.3 Generic functions

Generic Function: expand-option (type package args)

Called to expand module options into forms.

Package

modularize.

Source

module.lisp.

Methods
Method: expand-option ((type1 (eql :packages)) module args0)
Source

options.lisp.

Method: expand-option ((type1 (eql :local-nicknames)) package args0)
Source

options.lisp.

Method: expand-option ((type1 (eql :size)) package args0)
Source

options.lisp.

Method: expand-option ((type1 (eql :intern)) package args0)
Source

options.lisp.

Method: expand-option ((type1 (eql :export)) package args0)
Source

options.lisp.

Method: expand-option ((type1 (eql :import-from)) package args0)
Source

options.lisp.

Method: expand-option ((type1 (eql :shadowing-import-from)) package args0)
Source

options.lisp.

Method: expand-option ((type1 (eql :shadow)) package args0)
Source

options.lisp.

Method: expand-option ((type1 (eql :use)) package args0)
Source

options.lisp.

Method: expand-option ((type1 (eql :documentation)) package args0)
Source

options.lisp.

Method: expand-option ((type1 (eql :nicknames)) package args0)
Source

options.lisp.

Generic Function: remove-virtual-module (identifier)

Removes the association of the name with a virtual module.

Package

modularize.

Methods
Method: remove-virtual-module ((identifier package))
Source

asdf.lisp.

Method: remove-virtual-module (identifier)
Source

asdf.lisp.

Generic Function: virtual-module (identifier)

Accesses the virtual module instance associated with the identifier if one was found, otherwise NIL.

Package

modularize.

Methods
Method: virtual-module ((identifier package))
Source

asdf.lisp.

Method: virtual-module (identifier)
Source

asdf.lisp.

Generic Function: (setf virtual-module) (identifier)
Package

modularize.

Methods
Method: (setf virtual-module) ((identifier package))
Source

asdf.lisp.

Method: (setf virtual-module) (identifier)
Source

asdf.lisp.

Generic Reader: virtual-module-name (object)

Returns the module name associated with this virtual module.

Package

modularize.

Methods
Reader Method: virtual-module-name ((virtual-module virtual-module))
Source

asdf.lisp.

Target Slot

module-name.

Generic Writer: (setf virtual-module-name) (object)
Package

modularize.

Methods
Writer Method: (setf virtual-module-name) ((virtual-module virtual-module))

automatically generated writer method

Source

asdf.lisp.

Target Slot

module-name.


5.1.4 Standalone methods

Method: initialize-instance :after ((virtual-module virtual-module) &key)
Source

asdf.lisp.

Method: reinitialize-instance :after ((virtual-module virtual-module) &key)
Source

asdf.lisp.

Method: resolve-dependency-combination ((virtual-module virtual-module) (combinator (eql :module)) args)
Package

asdf/find-component.

Source

asdf.lisp.


5.1.5 Conditions

Condition: module-not-found

Condition signalled when a module is requested but not found.

Package

modularize.

Source

module.lisp.

Direct superclasses

error.

Direct methods

requested.

Direct slots
Slot: %requested
Initform

(quote (error "requested required."))

Initargs

:requested

Readers

requested.

Writers

This slot is read-only.

Condition: not-a-module

Condition signalled when a module is requested but only a package of the requested name exists.

Package

modularize.

Source

module.lisp.

Direct superclasses

error.

Direct methods

requested.

Direct slots
Slot: %requested
Initform

(quote (error "requested required."))

Initargs

:requested

Readers

requested.

Writers

This slot is read-only.

Condition: virtual-module-not-found

Condition signalled when a virtual module was requested but could not be found.

Package

modularize.

Source

asdf.lisp.

Direct superclasses

error.

Direct methods

requested.

Direct slots
Slot: %requested
Initform

(quote (error "requested required."))

Initargs

:requested

Readers

requested.

Writers

This slot is read-only.


5.1.6 Classes

Class: module

ASDF System subclass that serves as the class for virtual modules.

Deprecated– use VIRTUAL-MODULE instead.

Package

modularize.

Source

asdf.lisp.

Direct superclasses

virtual-module.

Class: virtual-module

ASDF System subclass that serves as the class for virtual modules.

Package

modularize.

Source

asdf.lisp.

Direct superclasses

system.

Direct subclasses

module.

Direct methods
Direct slots
Slot: module-name
Initargs

:module-name

Readers

virtual-module-name.

Writers

(setf virtual-module-name).


5.2 Internals


5.2.1 Special variables

Special Variable: *delete-hooks*

Table mapping the deletion hook names to their functions.

Package

modularize.

Source

hooks.lisp.

Special Variable: *modularize-hooks*

Table mapping the modularization hook names to their functions.

Package

modularize.

Source

hooks.lisp.

Special Variable: *module-deferrals*

Table mapping packages to their modules.

Package

modularize.

Source

module.lisp.

Special Variable: *module-storages*

Table mapping module packages to their storage tables.

Package

modularize.

Source

module.lisp.

Special Variable: *virtual-module-map*

Map of virtual module names to the asdf system instances of the virtual modules.

Package

modularize.

Source

asdf.lisp.


5.2.2 Macros

Macro: with-package ((var &optional package) &body body)

Shortcut macro to bind the ENSURE-PACKAGE value of PACKAGE to VAR.

Package

modularize.

Source

package-toolkit.lisp.


5.2.3 Ordinary functions

Function: add-package-nickname (package nickname)

Adds the nickname onto the package’s nicknames list.

Package

modularize.

Source

package-toolkit.lisp.

Function: collect-symbols-from (package symbols)

Collects all given symbols from the package.

Package

modularize.

Source

package-toolkit.lisp.

Function: ensure-package (thing)

Ensures that THING is a package-object, or errors if it cannot resolve it to a package.

Package

modularize.

Source

package-toolkit.lisp.

Function: expand-module (package options)

Expands the module options into their proper forms using EXPAND-OPTION for each.

Package

modularize.

Source

module.lisp.

Function: extend-package (package definition-options)

Extends the package with the package definition options.

Any option except for the SIZE option is allowed. Note that this only ADDS onto the package and does not remove any options defined prior. As in, nicknames are only added on, but not removed.

Package

modularize.

Source

package-toolkit.lisp.

Function: extract-name (identifier)

Extracts the name from an identifier, which is to say the string after the last dot.

Package

modularize.

Source

module.lisp.

Function: make-identifier (name)

Turns a name into an identifier by prepending MODULARIZE.MOD. to it.

Package

modularize.

Source

module.lisp.

Function: resolve-module (object)

Resolves the object to the proper module package, if any.

Package

modularize.

Source

module.lisp.

Function: unbind-and-delete-package (package)

Unbinds all symbols in the package from their functions and values and finally deletes the package.

Package

modularize.

Source

package-toolkit.lisp.


5.2.4 Generic functions

Generic Reader: requested (condition)
Package

modularize.

Methods
Reader Method: requested ((condition virtual-module-not-found))
Source

asdf.lisp.

Target Slot

%requested.

Reader Method: requested ((condition not-a-module))
Source

module.lisp.

Target Slot

%requested.

Reader Method: requested ((condition module-not-found))
Source

module.lisp.

Target Slot

%requested.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
A   C   D   E   F   G   I   L   M   R   U   V   W  
Index Entry  Section

(
(setf delete-hook): Public ordinary functions
(setf modularize-hook): Public ordinary functions
(setf module-packages): Public ordinary functions
(setf module-storage): Public ordinary functions
(setf virtual-module): Public generic functions
(setf virtual-module): Public generic functions
(setf virtual-module): Public generic functions
(setf virtual-module-name): Public generic functions
(setf virtual-module-name): Public generic functions

A
add-package-nickname: Private ordinary functions

C
call-delete-hooks: Public ordinary functions
call-modularize-hooks: Public ordinary functions
collect-symbols-from: Private ordinary functions
current-module: Public macros

D
define-delete-hook: Public macros
define-modularize-hook: Public macros
define-module: Public macros
define-module-extension: Public macros
define-option-expander: Public macros
delete-hook: Public ordinary functions
delete-module: Public ordinary functions
demodularize: Public ordinary functions

E
ensure-package: Private ordinary functions
expand-module: Private ordinary functions
expand-option: Public generic functions
expand-option: Public generic functions
expand-option: Public generic functions
expand-option: Public generic functions
expand-option: Public generic functions
expand-option: Public generic functions
expand-option: Public generic functions
expand-option: Public generic functions
expand-option: Public generic functions
expand-option: Public generic functions
expand-option: Public generic functions
expand-option: Public generic functions
extend-package: Private ordinary functions
extract-name: Private ordinary functions

F
Function, (setf delete-hook): Public ordinary functions
Function, (setf modularize-hook): Public ordinary functions
Function, (setf module-packages): Public ordinary functions
Function, (setf module-storage): Public ordinary functions
Function, add-package-nickname: Private ordinary functions
Function, call-delete-hooks: Public ordinary functions
Function, call-modularize-hooks: Public ordinary functions
Function, collect-symbols-from: Private ordinary functions
Function, delete-hook: Public ordinary functions
Function, delete-module: Public ordinary functions
Function, demodularize: Public ordinary functions
Function, ensure-package: Private ordinary functions
Function, expand-module: Private ordinary functions
Function, extend-package: Private ordinary functions
Function, extract-name: Private ordinary functions
Function, list-modules: Public ordinary functions
Function, load-module: Public ordinary functions
Function, make-identifier: Private ordinary functions
Function, map-modules: Public ordinary functions
Function, modularize: Public ordinary functions
Function, modularize-hook: Public ordinary functions
Function, module: Public ordinary functions
Function, module-identifier: Public ordinary functions
Function, module-name: Public ordinary functions
Function, module-p: Public ordinary functions
Function, module-packages: Public ordinary functions
Function, module-storage: Public ordinary functions
Function, module-storage-remove: Public ordinary functions
Function, register-virtual-module: Public ordinary functions
Function, remove-delete-hook: Public ordinary functions
Function, remove-modularize-hook: Public ordinary functions
Function, resolve-module: Private ordinary functions
Function, unbind-and-delete-package: Private ordinary functions

G
Generic Function, (setf virtual-module): Public generic functions
Generic Function, (setf virtual-module-name): Public generic functions
Generic Function, expand-option: Public generic functions
Generic Function, remove-virtual-module: Public generic functions
Generic Function, requested: Private generic functions
Generic Function, virtual-module: Public generic functions
Generic Function, virtual-module-name: Public generic functions

I
initialize-instance: Public standalone methods

L
list-modules: Public ordinary functions
load-module: Public ordinary functions

M
Macro, current-module: Public macros
Macro, define-delete-hook: Public macros
Macro, define-modularize-hook: Public macros
Macro, define-module: Public macros
Macro, define-module-extension: Public macros
Macro, define-option-expander: Public macros
Macro, with-module: Public macros
Macro, with-package: Private macros
make-identifier: Private ordinary functions
map-modules: Public ordinary functions
Method, (setf virtual-module): Public generic functions
Method, (setf virtual-module): Public generic functions
Method, (setf virtual-module-name): Public generic functions
Method, expand-option: Public generic functions
Method, expand-option: Public generic functions
Method, expand-option: Public generic functions
Method, expand-option: Public generic functions
Method, expand-option: Public generic functions
Method, expand-option: Public generic functions
Method, expand-option: Public generic functions
Method, expand-option: Public generic functions
Method, expand-option: Public generic functions
Method, expand-option: Public generic functions
Method, expand-option: Public generic functions
Method, initialize-instance: Public standalone methods
Method, reinitialize-instance: Public standalone methods
Method, remove-virtual-module: Public generic functions
Method, remove-virtual-module: Public generic functions
Method, requested: Private generic functions
Method, requested: Private generic functions
Method, requested: Private generic functions
Method, resolve-dependency-combination: Public standalone methods
Method, virtual-module: Public generic functions
Method, virtual-module: Public generic functions
Method, virtual-module-name: Public generic functions
modularize: Public ordinary functions
modularize-hook: Public ordinary functions
module: Public ordinary functions
module-identifier: Public ordinary functions
module-name: Public ordinary functions
module-p: Public ordinary functions
module-packages: Public ordinary functions
module-storage: Public ordinary functions
module-storage-remove: Public ordinary functions

R
register-virtual-module: Public ordinary functions
reinitialize-instance: Public standalone methods
remove-delete-hook: Public ordinary functions
remove-modularize-hook: Public ordinary functions
remove-virtual-module: Public generic functions
remove-virtual-module: Public generic functions
remove-virtual-module: Public generic functions
requested: Private generic functions
requested: Private generic functions
requested: Private generic functions
requested: Private generic functions
resolve-dependency-combination: Public standalone methods
resolve-module: Private ordinary functions

U
unbind-and-delete-package: Private ordinary functions

V
virtual-module: Public generic functions
virtual-module: Public generic functions
virtual-module: Public generic functions
virtual-module-name: Public generic functions
virtual-module-name: Public generic functions

W
with-module: Public macros
with-package: Private macros


A.4 Data types

Jump to:   A   C   D   F   H   M   N   O   P   S   V  
Index Entry  Section

A
asdf.lisp: The modularize/asdf․lisp file

C
Class, module: Public classes
Class, virtual-module: Public classes
Condition, module-not-found: Public conditions
Condition, not-a-module: Public conditions
Condition, virtual-module-not-found: Public conditions

D
documentation.lisp: The modularize/documentation․lisp file

F
File, asdf.lisp: The modularize/asdf․lisp file
File, documentation.lisp: The modularize/documentation․lisp file
File, hooks.lisp: The modularize/hooks․lisp file
File, modularize.asd: The modularize/modularize․asd file
File, module.lisp: The modularize/module․lisp file
File, options.lisp: The modularize/options․lisp file
File, package-toolkit.lisp: The modularize/package-toolkit․lisp file
File, package.lisp: The modularize/package․lisp file

H
hooks.lisp: The modularize/hooks․lisp file

M
modularize: The modularize system
modularize: The modularize package
modularize.asd: The modularize/modularize․asd file
module: Public classes
module-not-found: Public conditions
module.lisp: The modularize/module․lisp file

N
not-a-module: Public conditions

O
options.lisp: The modularize/options․lisp file
org.shirakumo.radiance.lib.modularize.user: The org․shirakumo․radiance․lib․modularize․user package

P
Package, modularize: The modularize package
Package, org.shirakumo.radiance.lib.modularize.user: The org․shirakumo․radiance․lib․modularize․user package
package-toolkit.lisp: The modularize/package-toolkit․lisp file
package.lisp: The modularize/package․lisp file

S
System, modularize: The modularize system

V
virtual-module: Public classes
virtual-module-not-found: Public conditions