This is the cl-reexport Reference Manual, version 0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 05:19:26 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
cl-reexport
Reexport external symbols in other packages.
Masayuki Takagi
LLGPL
# Cl-Reexport
Cl-reexport makes a package reexport symbols which are external symbols in other packages. This fanctionality is intended to be used with (virtual) hierarchical packages. For detail, see Usage section.
## Usage
Think about a (virutal) hierarchical package structure. Since Common Lisp standard has just a flat package system, the three packages are naturally at the same level, but you can regard the packages constituting a hierarchy virtually.
FOO-package
- FOO-PACKAGE.BAR
- FOO-PACKAGE.BAZ
Here, their definitions are:
(in-package :cl-user)
(defpackage foo-package.bar
(:use :cl)
(:export :x))
(defpackage foo-package.baz
(:use :cl)
(:export :y))
(defpackage foo-package
(:use :cl))
If you want reexport external symbols in FOO-PACKAGE.BAR and FOO-PACKAGE.BAZ from FOO-PACKAGE, you may just write as below:
(in-package :foo-package)
(cl-reexport:reexport-from :foo-package.bar)
(cl-reexport:reexport-from :foo-package.baz)
(in-package :cl-user)
(describe ’x)
>> FOO-PACKAGE.BAR:X
>> [symbol]
(describe ’y)
>> FOO-PACKAGE.BAZ:Y
>> [symbol]
### :INCLUDE and :EXCLUDE options
You can also reexport the only symbols you specify or the symbols other than you specify using :INCLUDE option or :EXCLUDE option. Since they are exclusive, you can not use :INCLUDE option and :EXCLUDE option at the same time.
(in-package :cl-user)
(defpackage bar-package.a
(:use :cl)
(:export :x :y :z))
(defpackage bar-package.b
(:use :cl)
(:export :p :q :r))
(defpackage bar-package
(:use :cl))
(in-package :bar-package)
(cl-reexport:reexport-from :bar-package.a
:include ’(:x))
(cl-reexport:reexport-from :bar-package.b
:include ’(:p))
(in-package :cl-user)
(do-external-symbols (x :bar-package)
(print x))
>> BAR-PACKAGE.A:X
>> BAR-PACKAGE.B:Q
>> BAR-PACKAGE.B:R
## Installation
You can install ‘cl-reexport‘ via Quicklisp:
(ql:quicklisp :cl-reexport)
## Difference from ASDF 3’s one-package-per-file fanctionality
ASDF 3 has one-package-per-file fanctionality and its runtime support. The structural difference between (virtual) hierarchical packages and ASDF 3’s one-package-per-file fanctionality is:
* (Virtual) hierarchical packages have one system definition and several packages constitute a hierarchical structure.
* ASDF 3’s one-package-per-file style has hierarchical system definitions and hierarchical packages, whcih are corresponding each other.
When you use former style, you can use cl-reexport.
## Author
* Masayuki Takagi (kamonama@gmail.com)
## Copyright
Copyright (c) 2014 Masayuki Takagi (kamonama@gmail.com)
## License
Licensed under the LLGPL License.
0.1
alexandria
(system).
src
(module).
Modules are listed depth-first from the system components tree.
cl-reexport/src
cl-reexport
(system).
cl-reexport.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
cl-reexport/cl-reexport.asd
cl-reexport
(system).
cl-reexport/src/cl-reexport.lisp
src
(module).
reexport-from
(function).
exclude-symbols
(function).
external-symbols
(function).
include-symbols
(function).
Packages are listed by definition order.
cl-reexport
common-lisp
.
reexport-from
(function).
exclude-symbols
(function).
external-symbols
(function).
include-symbols
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Jump to: | E F I R |
---|
Jump to: | E F I R |
---|
Jump to: | C F M P S |
---|
Jump to: | C F M P S |
---|