-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add delete-package #190
Add delete-package #190
Conversation
- Test that one can delete a package with package designators, such as a package, a string or symbol - Ensure that tests that create a package delete it before creating the package to avoid errors when attempting to create an existing package when running the test suite in succession.
I created an issue #192 for the etypecase thing. |
@@ -28,6 +28,19 @@ | |||
package-designator | |||
(oget *package-table* (string package-designator)))) | |||
|
|||
(defun package-designator-package (package-designator) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is some overlap between this function and find-package
in package.lisp
.
find-package
uses string
to convert the package-designator into a name, and then get the package. The only problem is that string
is not signaling an error when it receives a non string designator, like a number.
If you use the typecase for string/symbol/character, so an error is signaled in string
, then we can replace this function with just a call to find-package-or-fail
.
- Remove package-designator-package, use find-package instead. - Add TODO notes recording what is needed for a clhs compliant delete-package
Is this what you had in mind? |
;; name a package. | ||
;; TODO: Implement unuse-package and remove the deleted package from packages | ||
;; that use it. | ||
(delete-property (package-name (find-package package-designator)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be find-package-or-fail
, right?
Also, string should fail if its argument is not a string designator. Now in JSCL (find-package 3)
evaluates to NIL instead of signaling an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ups, you are right! sec!
Thanks! |
Hi David,
This is a crude implementation of delete-package. It still has to handle exceptional situations like deleting a package used in another package.
From the changelog
Btw, should the bug about the incorrect typecase be added to the gh issue tracker?