This is the wild-package-inferred-system Reference Manual, version 0.2.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 08:05:56 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
wild-package-inferred-system
Introduces the wildcards ‘*’ and ‘**’ into package-inferred-system
Hugo I.
MIT
# wild-package-inferred-system
[![Build Status](https://github.com/privet-kitty/wild-package-inferred-system/workflows/CI/badge.svg)](https://github.com/privet-kitty/wild-package-inferred-system/actions) **This library is still in a alpha stage.**
‘wild-package-inferred-system‘ is an extension of ASDF ‘package-inferred-system‘ that interprets star ‘*‘ and globstar ‘**‘ in package (or system) names.
If you are not sure about ‘package-inferred-system‘, see [the section](https://common-lisp.net/project/asdf/asdf/The-package_002dinferred_002dsystem-extension.html) about it in the ASDF manual. In short, ‘wild-package-inferred-system‘ is aimed at elimininating the need for ‘foo/.../all‘-type subsystems, which have been manually written only for ‘use-reexport‘ing other .lisp files in the (sub)directories.
## Usage
You need to specify the ‘:defsystem-depends-on‘ and ‘:class‘ options to use ‘wild-package-inferred-system‘ as follows:
“‘lisp
;; foo-wild/foo-wild.asd
(defsystem "foo-wild"
:defsystem-depends-on ("wild-package-inferred-system")
:class "winfer:wild-package-inferred-system"
:depends-on ("foo-wild/baz/*"))
“‘
Each source file in the system ‘foo-wild‘ will begin with ‘defpackage‘ or ‘uiop:define-package‘ in the same way as ‘package-inferred-system‘:
“‘lisp
;; foo-wild/baz/hello.lisp
(uiop:define-package :foo-wild/baz/hello
(:use :cl :foo-wild/qux/*)
(:import-from :foo-wild/bar/**/* #:sym1 #:sym2)
(:export #:hello-world))
“‘
The only difference is that ‘wild-package-inferred-system‘ can interpret wildcards in a package name: ‘*‘ matches one directory or (if in the end) any .lisp files in the directory; ‘**‘ matches zero or more subdirectories. In the above example, the package ‘:foo-wild/qux/*‘ corresponds to the unix path ‘foo-wild/qux/*.lisp‘ and ‘:foo-wild/bar/**/*‘ to ‘foo-wild/bar/**/*.lisp‘. (The latter path matches all the recursively reachable .lisp files under ‘foo-wild/bar/‘.)
Since a wild package is just a standard CL package, you can apply ‘find-package‘, ‘use-package‘, ‘in-package‘ etc. to it if once generated. Likewise you can apply ‘find-system‘, ‘load-system‘ or other operations to the corresponding wild system.
You _can_ use any other combinations of wildcards, e.g. ‘foo/*/bar‘ or ‘foo/**/*/interface/*‘(, though I recommend that you think about if you really need such a complicated desigination).
## Dependencies
**ASDF version 3.3** or later is required.
‘wild-package-inferred-system‘ is tested on the (usually latest vesions of the) following implementations:
- SBCL
- Clozure CL
- Allegro CL
- ABCL
## Installation
‘wild-package-inferred-system‘ will be automatically fetched and loaded via quicklisp. If you want to install it from this repository, just run:
“‘
$ cd ~/common-lisp/ # , ~/quicklisp/local-projects/, ~/.roswell/local-projects/ etc.
$ git clone https://github.com/privet-kitty/wild-package-inferred-system.git
“‘
## Mechanism
To be edited
## FAQ
### How can I let a specific file be excluded from wildcard?
‘wild-package-inferred-system‘ ignores the files whose names begin with dot ‘.‘ or whose types are ‘.nosystem.lisp‘ or ‘.script.lisp‘ even if they match a given wild package.
### How can I make a wild package in REPL?
Just call ‘asdf:load-system‘. Evaluating a form like ‘(asdf:load-system "foo/bar/**/*")‘ will make the wild package and register the corresponding system simultaneously (only if the system ‘foo‘ is ‘wild-package-inferred-system‘, of course).
### Can I use the wildcard ‘*‘ as a part of file or directory name like ‘foo/bar-*-*/*baz‘?
No. See [the issue](https://github.com/privet-kitty/wild-package-inferred-system/issues/1).
### How can I nickname a wild package?
Of course you may manually give arbitrary nicknames to a wild package by e.g. ‘(uiop:ensure-package :foo/bar/* :nicknames ’(:foo/bar))‘.
In addition, ‘wild-package-inferred-system‘ provides an option to nickname a wild package automatically. If ‘:add-non-wild-nickname t‘ is specified in ‘defsystem‘ form, a nickname is given to each wild package, which is the prefix containing no wildcards: e.g. the nickname of ‘:foo/bar/**/baz/*‘ is ‘:foo/bar‘. Therefore you cannot make two packages with a common prefix (e.g. ‘:foo/bar/**/*‘ and ‘:foo/bar/*‘) if you enable this option.
## Copyright
Copyright (c) 2018 Hugo I.
0.2.0
src
(module).
Modules are listed depth-first from the system components tree.
wild-package-inferred-system/src
wild-package-inferred-system
(system).
package.lisp
(file).
internal-utilities.lisp
(file).
main.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
wild-package-inferred-system/wild-package-inferred-system.asd
wild-package-inferred-system/src/package.lisp
wild-package-inferred-system/src/internal-utilities.lisp
wild-package-inferred-system/src/main.lisp
wild-package-inferred-system/wild-package-inferred-system.asd
wild-package-inferred-system
(system).
wild-package-inferred-system/src/internal-utilities.lisp
src
(module).
make-keyword
(function).
parse-unix-namestring**
(function).
reduce-package
(function).
split-name-type**
(function).
split-unix-namestring-directory-components**
(function).
subpathname**
(function).
wild-package-inferred-system/src/main.lisp
src
(module).
component-name
(reader method).
component-pathname
(reader method).
empty-wild-system
(condition).
error-pathname
(reader method).
wild-package-inferred-system
(class).
calc-wild-package-directory-pathname
(function).
default-package-option
(reader method).
error-base-pathname
(reader method).
excluded-source-pathname-p
(function).
extract-non-wild-prefix
(function).
gen-reexporting-form
(function).
gen-wild-package-filename
(function).
non-wild-nickname-p
(reader method).
pathname-to-package-name
(function).
reduce-all-wild-packages
(function).
same-wild-package-inferred-system-p
(function).
sysdef-wild-package-inferred-system-search
(function).
uninterpretable-file-pathname
(condition).
Packages are listed by definition order.
wild-package-inferred-system
wpis
winfer
asdf/interface
.
common-lisp
.
uiop/driver
.
empty-wild-system
(condition).
wild-package-inferred-system
(class).
calc-wild-package-directory-pathname
(function).
default-package-option
(generic reader).
error-base-pathname
(generic reader).
excluded-source-pathname-p
(function).
extract-non-wild-prefix
(function).
gen-reexporting-form
(function).
gen-wild-package-filename
(function).
make-keyword
(function).
non-wild-nickname-p
(generic reader).
parse-unix-namestring**
(function).
pathname-to-package-name
(function).
reduce-all-wild-packages
(function).
reduce-package
(function).
same-wild-package-inferred-system-p
(function).
split-name-type**
(function).
split-unix-namestring-directory-components**
(function).
subpathname**
(function).
sysdef-wild-package-inferred-system-search
(function).
uninterpretable-file-pathname
(condition).
Definitions are sorted by export status, category, package, and then by lexicographic order.
empty-wild-system
)) ¶empty-wild-system
)) ¶uninterpretable-file-pathname
)) ¶Is almost the same as ASDF:PACKAGE-INFERRED-SYSTEM, except it
can interpret star ‘*’ and globstar ‘**’ in package names.
Package options given to :DEFAULT-PACKAGE-OPTION are merged into auto-generated
wild package forms. The default is ((:USE :CL)). You can specify any options
UIOP:DEFINE-PACKAGE accepts.
If :ADD-NON-WILD-NICKNAME is true, a nickname is given to each wild package, which is the prefix containing no wildcards: e.g. the nickname of :foo/bar/**/baz/* is :foo/bar. Therefore you cannot make packages with a common prefix (e.g. :foo/bar/**/baz* and :foo/bar/*) if you enable this option.
package-inferred-system
.
(quote ((:use :cl)))
:default-package-option
This slot is read-only.
:add-non-wild-nickname
This slot is read-only.
CL source files for wild systems are put under the translated directory by ASDF-OUTPUT-TRANSLATIONS, which will be ASDF:*USER-CACHE* in the default configuration.
WILD-PACKAGE-INFERRED-SYSTEM ignores the file names beginning with dot ‘.’ and file types .nosystem.lisp and .script.lisp even if they match a given wild-pathname.
E.g. returns ’foo/bar’ for ’foo/bar/*’ and ’foo’ for ’foo/**/baz/*/*’.
Generates the UIOP:DEFINE-PACKAGE form for use-reexporting matched packages.
Generates the filename for a given wild system.
Is almost the same as UIOP:PARSE-UNIX-NAMESTRING but interprets star ‘*’ and globstar ‘**’.
Derives the package name of the source file at PATHNAME w.r.t. PRIMARY-SYSTEM.
Reduces all wild packages beginning with PRIMARY-NAME. (experimental)
Reduces the package from the graph of user-usee relationship: for example, (A B) using C using (D E F) is transformed to A using (D E F) and B using (D E F) if package C is reduced.
Is almost the same as ASDF/PACKAGE-INFERRED-SYSTEM::SAME-PACKAGE-INFERRED-SYSTEM-P that checks whether the system equals to the one specified by the other parameters
Is almost the same as UIOP:SPLIT-NAME-TYPE but interprets star ‘*’.
Is almost the same as UIOP:SPLIT-UNIX-NAMESTRING-DIRECTORY-COMPONENTS but interprets star ‘*’ and globstar ‘**’.
Is almost the same as UIOP:SUBPATHNAME but interprets star ‘*’ and ‘**’ globstar.
Will be pushed into ASDF:*SYSTEM-DEFINITION-SEARCH-FUNCTIONS*.
wild-package-inferred-system
)) ¶automatically generated reader method
uninterpretable-file-pathname
)) ¶wild-package-inferred-system
)) ¶automatically generated reader method
Jump to: | C D E F G M N P R S |
---|
Jump to: | C D E F G M N P R S |
---|
Jump to: | A B N P S |
---|
Jump to: | A B N P S |
---|
Jump to: | C E F I M P S U W |
---|
Jump to: | C E F I M P S U W |
---|