The wild-package-inferred-system Reference Manual

Table of Contents

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

The wild-package-inferred-system Reference Manual

This is the wild-package-inferred-system Reference Manual, version 0.2.0, generated automatically by Declt version 2.4 patchlevel 1 "Will Decker" on Fri May 24 10:04:27 2019 GMT+0.


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

1 Introduction

wild-package-inferred-system

Build Status 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 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-reexporting 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:

;; 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:

;; 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:

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.

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.


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 wild-package-inferred-system

Author

Hugo I.

License

MIT

Description

Introduces the wildcards ‘*’ and ‘**’ into package-inferred-system

Long Description

# wild-package-inferred-system

[![Build Status](https://api.travis-ci.org/privet-kitty/wild-package-inferred-system.svg?branch=master)](https://travis-ci.org/privet-kitty/wild-package-inferred-system/) **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
- CLISP
- ECL

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

Version

0.2.0

Source

wild-package-inferred-system.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 wild-package-inferred-system/src

Parent

wild-package-inferred-system (system)

Location

src/

Components

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 wild-package-inferred-system.asd

Location

wild-package-inferred-system.asd

Systems

wild-package-inferred-system (system)


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

4.1.2 wild-package-inferred-system/src/package.lisp

Parent

src (module)

Location

src/package.lisp

Packages

wild-package-inferred-system


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

4.1.3 wild-package-inferred-system/src/internal-utilities.lisp

Parent

src (module)

Location

src/internal-utilities.lisp

Internal Definitions

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

4.1.4 wild-package-inferred-system/src/main.lisp

Parent

src (module)

Location

src/main.lisp

Exported Definitions
Internal Definitions

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

5 Packages

Packages are listed by definition order.


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

5.1 wild-package-inferred-system

Source

package.lisp (file)

Nicknames
Use List
Exported Definitions
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


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

6.1.1 Conditions

Condition: empty-wild-system ()
Package

wild-package-inferred-system

Source

main.lisp (file)

Direct superclasses

warning (condition)

Direct methods
  • component-pathname (method)
  • component-name (method)
Direct slots
Slot: name
Initargs

:name

Readers

component-name (generic function)

Slot: path
Initargs

:pathname

Readers

component-pathname (generic function)


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

6.1.2 Classes

Class: wild-package-inferred-system ()

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

wild-package-inferred-system

Source

main.lisp (file)

Direct superclasses

package-inferred-system (class)

Direct methods
Direct slots
Slot: package-option
Initargs

:default-package-option

Initform

(quote ((:use :cl)))

Readers

default-package-option (generic function)

Slot: add-non-wild-nickname
Initargs

:add-non-wild-nickname

Readers

non-wild-nickname-p (generic function)


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

6.2 Internal definitions


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

6.2.1 Functions

Function: calc-wild-package-directory-pathname TOPLEVEL-SYSTEM-DIRECTORY

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.

Package

wild-package-inferred-system

Source

main.lisp (file)

Function: excluded-source-pathname-p PATHNAME

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.

Package

wild-package-inferred-system

Source

main.lisp (file)

Function: extract-non-wild-prefix SYSTEM

E.g. returns ’foo/bar’ for ’foo/bar/*’ and ’foo’ for ’foo/**/baz/*/*’.

Package

wild-package-inferred-system

Source

main.lisp (file)

Function: gen-reexporting-form SYSTEM DEPENDENCIES &key NICKNAME DEFAULT-OPTION

Generates the UIOP:DEFINE-PACKAGE form for use-reexporting matched packages.

Package

wild-package-inferred-system

Source

main.lisp (file)

Function: gen-wild-package-filename SYSTEM

Generates the filename for a given wild system.

Package

wild-package-inferred-system

Source

main.lisp (file)

Function: make-keyword STRING-DESIGNATOR &optional FORCE-CASE
Package

wild-package-inferred-system

Source

internal-utilities.lisp (file)

Function: parse-unix-namestring** NAME &rest KEYS &key TYPE DEFAULTS DOT-DOT ENSURE-DIRECTORY &allow-other-keys

Is almost the same as UIOP:PARSE-UNIX-NAMESTRING but interprets star ‘*’ and globstar ‘**’.

Package

wild-package-inferred-system

Source

internal-utilities.lisp (file)

Function: pathname-to-package-name PATHNAME PRIMARY-SYSTEM

Derives the package name of the source file at PATHNAME w.r.t. PRIMARY-SYSTEM.

Package

wild-package-inferred-system

Source

main.lisp (file)

Function: reduce-all-wild-packages PRIMARY-NAME &optional DELETE

Reduces all wild packages beginning with PRIMARY-NAME. (experimental)

Package

wild-package-inferred-system

Source

main.lisp (file)

Function: reduce-package PACKAGE-DESIGNATOR

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.

Package

wild-package-inferred-system

Source

internal-utilities.lisp (file)

Function: same-wild-package-inferred-system-p SYSTEM NAME DIRECTORY SUBPATH AROUND-COMPILE DEPENDENCIES

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

Package

wild-package-inferred-system

Source

main.lisp (file)

Function: split-name-type** FILENAME

Is almost the same as UIOP:SPLIT-NAME-TYPE but interprets star ‘*’.

Package

wild-package-inferred-system

Source

internal-utilities.lisp (file)

Function: split-unix-namestring-directory-components** UNIX-NAMESTRING &key ENSURE-DIRECTORY DOT-DOT

Is almost the same as UIOP:SPLIT-UNIX-NAMESTRING-DIRECTORY-COMPONENTS but interprets star ‘*’ and globstar ‘**’.

Package

wild-package-inferred-system

Source

internal-utilities.lisp (file)

Function: subpathname** PATHNAME SUBPATH &key TYPE

Is almost the same as UIOP:SUBPATHNAME but interprets star ‘*’ and ‘**’ globstar.

Package

wild-package-inferred-system

Source

internal-utilities.lisp (file)

Function: sysdef-wild-package-inferred-system-search SYSTEM

Will be pushed into ASDF:*SYSTEM-DEFINITION-SEARCH-FUNCTIONS*.

Package

wild-package-inferred-system

Source

main.lisp (file)


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

6.2.2 Generic functions

Generic Function: default-package-option OBJECT
Package

wild-package-inferred-system

Methods
Method: default-package-option (WILD-PACKAGE-INFERRED-SYSTEM wild-package-inferred-system)

automatically generated reader method

Source

main.lisp (file)

Generic Function: error-base-pathname CONDITION
Package

wild-package-inferred-system

Methods
Method: error-base-pathname (CONDITION uninterpretable-file-pathname)
Source

main.lisp (file)

Generic Function: non-wild-nickname-p OBJECT
Package

wild-package-inferred-system

Methods
Method: non-wild-nickname-p (WILD-PACKAGE-INFERRED-SYSTEM wild-package-inferred-system)

automatically generated reader method

Source

main.lisp (file)


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

6.2.3 Conditions

Condition: uninterpretable-file-pathname ()
Package

wild-package-inferred-system

Source

main.lisp (file)

Direct superclasses

system-definition-error (condition)

Direct methods
Direct slots
Slot: path
Initargs

:pathname

Readers

error-pathname (generic function)

Slot: base
Initargs

:base-pathname

Readers

error-base-pathname (generic function)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   F   L   M   W  
Index Entry  Section

F
File, Lisp, wild-package-inferred-system.asd: The wild-package-inferred-system<dot>asd file
File, Lisp, wild-package-inferred-system/src/internal-utilities.lisp: The wild-package-inferred-system/src/internal-utilities<dot>lisp file
File, Lisp, wild-package-inferred-system/src/main.lisp: The wild-package-inferred-system/src/main<dot>lisp file
File, Lisp, wild-package-inferred-system/src/package.lisp: The wild-package-inferred-system/src/package<dot>lisp file

L
Lisp File, wild-package-inferred-system.asd: The wild-package-inferred-system<dot>asd file
Lisp File, wild-package-inferred-system/src/internal-utilities.lisp: The wild-package-inferred-system/src/internal-utilities<dot>lisp file
Lisp File, wild-package-inferred-system/src/main.lisp: The wild-package-inferred-system/src/main<dot>lisp file
Lisp File, wild-package-inferred-system/src/package.lisp: The wild-package-inferred-system/src/package<dot>lisp file

M
Module, wild-package-inferred-system/src: The wild-package-inferred-system/src module

W
wild-package-inferred-system.asd: The wild-package-inferred-system<dot>asd file
wild-package-inferred-system/src: The wild-package-inferred-system/src module
wild-package-inferred-system/src/internal-utilities.lisp: The wild-package-inferred-system/src/internal-utilities<dot>lisp file
wild-package-inferred-system/src/main.lisp: The wild-package-inferred-system/src/main<dot>lisp file
wild-package-inferred-system/src/package.lisp: The wild-package-inferred-system/src/package<dot>lisp file

Jump to:   F   L   M   W  

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

A.2 Functions

Jump to:   C   D   E   F   G   M   N   P   R   S  
Index Entry  Section

C
calc-wild-package-directory-pathname: Internal functions

D
default-package-option: Internal generic functions
default-package-option: Internal generic functions

E
error-base-pathname: Internal generic functions
error-base-pathname: Internal generic functions
excluded-source-pathname-p: Internal functions
extract-non-wild-prefix: Internal functions

F
Function, calc-wild-package-directory-pathname: Internal functions
Function, excluded-source-pathname-p: Internal functions
Function, extract-non-wild-prefix: Internal functions
Function, gen-reexporting-form: Internal functions
Function, gen-wild-package-filename: Internal functions
Function, make-keyword: Internal functions
Function, parse-unix-namestring**: Internal functions
Function, pathname-to-package-name: Internal functions
Function, reduce-all-wild-packages: Internal functions
Function, reduce-package: Internal functions
Function, same-wild-package-inferred-system-p: Internal functions
Function, split-name-type**: Internal functions
Function, split-unix-namestring-directory-components**: Internal functions
Function, subpathname**: Internal functions
Function, sysdef-wild-package-inferred-system-search: Internal functions

G
gen-reexporting-form: Internal functions
gen-wild-package-filename: Internal functions
Generic Function, default-package-option: Internal generic functions
Generic Function, error-base-pathname: Internal generic functions
Generic Function, non-wild-nickname-p: Internal generic functions

M
make-keyword: Internal functions
Method, default-package-option: Internal generic functions
Method, error-base-pathname: Internal generic functions
Method, non-wild-nickname-p: Internal generic functions

N
non-wild-nickname-p: Internal generic functions
non-wild-nickname-p: Internal generic functions

P
parse-unix-namestring**: Internal functions
pathname-to-package-name: Internal functions

R
reduce-all-wild-packages: Internal functions
reduce-package: Internal functions

S
same-wild-package-inferred-system-p: Internal functions
split-name-type**: Internal functions
split-unix-namestring-directory-components**: Internal functions
subpathname**: Internal functions
sysdef-wild-package-inferred-system-search: Internal functions

Jump to:   C   D   E   F   G   M   N   P   R   S  

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

A.3 Variables

Jump to:   A   B   N   P   S  
Index Entry  Section

A
add-non-wild-nickname: Exported classes

B
base: Internal conditions

N
name: Exported conditions

P
package-option: Exported classes
path: Exported conditions
path: Internal conditions

S
Slot, add-non-wild-nickname: Exported classes
Slot, base: Internal conditions
Slot, name: Exported conditions
Slot, package-option: Exported classes
Slot, path: Exported conditions
Slot, path: Internal conditions

Jump to:   A   B   N   P   S  

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

A.4 Data types

Jump to:   C   E   P   S   U   W  
Index Entry  Section

C
Class, wild-package-inferred-system: Exported classes
Condition, empty-wild-system: Exported conditions
Condition, uninterpretable-file-pathname: Internal conditions

E
empty-wild-system: Exported conditions

P
Package, wild-package-inferred-system: The wild-package-inferred-system package

S
System, wild-package-inferred-system: The wild-package-inferred-system system

U
uninterpretable-file-pathname: Internal conditions

W
wild-package-inferred-system: The wild-package-inferred-system system
wild-package-inferred-system: The wild-package-inferred-system package
wild-package-inferred-system: Exported classes

Jump to:   C   E   P   S   U   W