Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asdf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Didier Verna
asdf
Commits
611a9c65
Commit
611a9c65
authored
11 years ago
by
Robert P. Goldman
Browse files
Options
Downloads
Patches
Plain Diff
Draft documentation for DEFINE-PACKAGE.
parent
3ffdfc50
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
uiop/package.lisp
+23
-0
23 additions, 0 deletions
uiop/package.lisp
with
23 additions
and
0 deletions
uiop/package.lisp
+
23
−
0
View file @
611a9c65
...
...
@@ -484,7 +484,14 @@ or when loading the package is optional."
(
home-package-p
existing
to-package
)
(
symbol-package-name
existing
)))
(
t
(
ensure-inherited
name
symbol
to-package
from-package
t
shadowed
imported
inherited
)))))))
(
defun
recycle-symbol
(
name
recycle
exported
)
;; Takes a symbol NAME (a string), a list of package designators for RECYCLE
;; packages, and a hash-table of names (strings) of symbols scheduled to be
;; EXPORTED from the package being defined. It returns two values, the
;; symbol found (if any, or else NIL), and a boolean flag indicating whether
;; a symbol was found. The caller (DEFINE-PACKAGE) will then do the
;; re-homing of the symbol, etc.
(
check-type
name
string
)
(
check-type
recycle
list
)
(
check-type
exported
hash-table
)
...
...
@@ -698,6 +705,22 @@ or when loading the package is optional."
:mix
,
mix
:reexport
,
reexport
:unintern
,
unintern
)))))
(
defmacro
define-package
(
package
&rest
clauses
)
"Supports the following keyword arguments:
USE, SHADOW, SHADOWING-IMPORT-FROM, IMPORT-FROM, EXPORT, INTERN -- as per CL:DEFPACKAGE.
RECYCLE -- Recycle the package's exported symbols from the specified packages,
in order. For every symbol scheduled to be exported by the DEFINE-PACKAGE,
either through an :EXPORT option or a :REEXPORT option, if the symbol exists in
one of the :RECYCLE packages, the first such symbol is re-homed to the package
being defined.
For the sake of idempotence, it is important that the package being defined
should appear in first position if it already exists, and even if it doesn't,
ahead of any package that is not going to be deleted afterwards and never
created again. In short, except for special cases, always make it the first
package on the list if the list is not empty.
MIX -- ?
REEXPORT -- A list of packages. For each package in the list, export the
symbols from this package.
UNINTERN -- Remove symbols here from PACKAGE."
(
let
((
ensure-form
`
(
apply
'ensure-package
',
(
parse-define-package-form
package
clauses
))))
`
(
progn
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment