Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the cl-reexport Reference Manual, version 0.1, generated automatically by Declt version 3.0 "Montgomery Scott" on Mon Apr 19 15:14:50 2021 GMT+0.
• Introduction | What cl-reexport 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 |
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.
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]
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
You can install cl-reexport
via Quicklisp:
(ql:quicklisp :cl-reexport)
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:
When you use former style, you can use cl-reexport.
Copyright (c) 2014 Masayuki Takagi (kamonama@gmail.com)
Licensed under the LLGPL License.
Next: Modules, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The cl-reexport system |
Masayuki Takagi
LLGPL
Reexport external symbols in other packages.
# 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
cl-reexport.asd (file)
src (module)
Modules are listed depth-first from the system components tree.
• The cl-reexport/src module |
cl-reexport (system)
src/
cl-reexport.lisp (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The cl-reexport.asd file | ||
• The cl-reexport/src/cl-reexport.lisp file |
Next: The cl-reexport/src/cl-reexport․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
cl-reexport.asd
cl-reexport (system)
Previous: The cl-reexport․asd file, Up: Lisp files [Contents][Index]
src (module)
src/cl-reexport.lisp
reexport-from (function)
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The cl-reexport-asd package | ||
• The cl-reexport package |
Next: The cl-reexport package, Previous: Packages, Up: Packages [Contents][Index]
cl-reexport.asd
Previous: The cl-reexport-asd package, Up: Packages [Contents][Index]
cl-reexport.lisp (file)
common-lisp
reexport-from (function)
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 functions |
Previous: Exported definitions, Up: Exported definitions [Contents][Index]
cl-reexport.lisp (file)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal functions |
Previous: Internal definitions, Up: Internal definitions [Contents][Index]
cl-reexport.lisp (file)
cl-reexport.lisp (file)
cl-reexport.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: | C F L M |
---|
Jump to: | C F L M |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | E F I R |
---|
Jump to: | E F I R |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | C P S |
---|
Jump to: | C P S |
---|