The cl-reexport Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The cl-reexport Reference Manual

This is the cl-reexport Reference Manual, version 0.1, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 11:21:21 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

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:

When you use former style, you can use cl-reexport.

Author

Copyright

Copyright (c) 2014 Masayuki Takagi (kamonama@gmail.com)

License

Licensed under the LLGPL License.


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

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


Previous: , Up: Systems   [Contents][Index]

2.1 cl-reexport

Author

Masayuki Takagi

License

LLGPL

Description

Reexport external symbols in other packages.

Long Description

# 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.

Version

0.1

Dependency

alexandria

Source

cl-reexport.asd (file)

Component

src (module)


Next: , Previous: , Up: Top   [Contents][Index]

3 Modules

Modules are listed depth-first from the system components tree.


Previous: , Up: Modules   [Contents][Index]

3.1 cl-reexport/src

Parent

cl-reexport (system)

Location

src/

Component

cl-reexport.lisp (file)


Next: , Previous: , Up: Top   [Contents][Index]

4 Files

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


Previous: , Up: Files   [Contents][Index]

4.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.1 cl-reexport.asd

Location

cl-reexport.asd

Systems

cl-reexport (system)

Packages

cl-reexport-asd


Previous: , Up: Lisp files   [Contents][Index]

4.1.2 cl-reexport/src/cl-reexport.lisp

Parent

src (module)

Location

src/cl-reexport.lisp

Packages

cl-reexport

Exported Definitions

reexport-from (function)

Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

5.1 cl-reexport-asd

Source

cl-reexport.asd

Use List

Previous: , Up: Packages   [Contents][Index]

5.2 cl-reexport

Source

cl-reexport.lisp (file)

Use List

common-lisp

Exported Definitions

reexport-from (function)

Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

6 Definitions

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


Next: , Previous: , Up: Definitions   [Contents][Index]

6.1 Exported definitions


Previous: , Up: Exported definitions   [Contents][Index]

6.1.1 Functions

Function: reexport-from PACKAGE-FROM &key INCLUDE EXCLUDE
Package

cl-reexport

Source

cl-reexport.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

6.2 Internal definitions


Previous: , Up: Internal definitions   [Contents][Index]

6.2.1 Functions

Function: exclude-symbols EXCLUDE SYMBOLS
Package

cl-reexport

Source

cl-reexport.lisp (file)

Function: external-symbols PACKAGE
Package

cl-reexport

Source

cl-reexport.lisp (file)

Function: include-symbols INCLUDE SYMBOLS
Package

cl-reexport

Source

cl-reexport.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   C   F   L   M  
Index Entry  Section

C
cl-reexport.asd: The cl-reexport<dot>asd file
cl-reexport/src: The cl-reexport/src module
cl-reexport/src/cl-reexport.lisp: The cl-reexport/src/cl-reexport<dot>lisp file

F
File, Lisp, cl-reexport.asd: The cl-reexport<dot>asd file
File, Lisp, cl-reexport/src/cl-reexport.lisp: The cl-reexport/src/cl-reexport<dot>lisp file

L
Lisp File, cl-reexport.asd: The cl-reexport<dot>asd file
Lisp File, cl-reexport/src/cl-reexport.lisp: The cl-reexport/src/cl-reexport<dot>lisp file

M
Module, cl-reexport/src: The cl-reexport/src module

Jump to:   C   F   L   M  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   E   F   I   R  
Index Entry  Section

E
exclude-symbols: Internal functions
external-symbols: Internal functions

F
Function, exclude-symbols: Internal functions
Function, external-symbols: Internal functions
Function, include-symbols: Internal functions
Function, reexport-from: Exported functions

I
include-symbols: Internal functions

R
reexport-from: Exported functions

Jump to:   E   F   I   R  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables


Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   P   S  
Index Entry  Section

C
cl-reexport: The cl-reexport system
cl-reexport: The cl-reexport package
cl-reexport-asd: The cl-reexport-asd package

P
Package, cl-reexport: The cl-reexport package
Package, cl-reexport-asd: The cl-reexport-asd package

S
System, cl-reexport: The cl-reexport system

Jump to:   C   P   S