Re: But how do I finally fix package system?
- From: pjb@xxxxxxxxxxxxxxxxx (Pascal J. Bourguignon)
- Date: Thu, 24 Dec 2009 16:10:06 +0100
budden <budden-lisp@xxxxxxx> writes:
And, what could I do if I have already created trash symbols?
I think some interactive "package cleaner tool" would be useful.
How could it look like?
Like this:
C/P2[261]> (defpackage :p1 (:use :cl) (:export :f))
#<PACKAGE P1>
C/P2[262]> (defun p1:f () '(p1::f p1::in p1::p1))
F
C/P2[263]> (defpackage :p3 (:use :cl))
#<PACKAGE P3>
C/P2[264]> (in-package :p3)
#<PACKAGE P3>
C/P3[265]> (defun f () '(f in p3))
F
C/P3[266]> (use-package :p1)
*** - (USE-PACKAGE (#<PACKAGE P1>) #<PACKAGE P3>): 1 name conflicts remain
Which symbol with name "F" should be accessible in #<PACKAGE P3>?
The following restarts are available:
P1 :R1 #<PACKAGE P1>
P3 :R2 #<PACKAGE P3>
ABORT :R3 ABORT
C/Break 1 P3[267]> :r1
T
C/P3[268]> (f)
(F P1::IN P1::P1)
C/P3[269]>
Oops, it already exists in all CL implementations...
I think I could implement this rather easily with wish.
Any additions, ideas, critics?
(defun force-use-package (package)
(loop
(handler-bind ((package-error (lambda (err) (invoke-restart (first (compute-restarts err))))))
(use-package package)
(return-from force-use-package t))))
--
__Pascal Bourguignon__ http://www.informatimago.com/
In a World without Walls and Fences,
who needs Windows and Gates?
.
- Follow-Ups:
- Re: But how do I finally fix package system?
- From: budden
- Re: But how do I finally fix package system?
- References:
- But how do I finally fix package system?
- From: budden
- But how do I finally fix package system?
- Prev by Date: Re: I have almost given up on lisp
- Next by Date: Re: But how do I finally fix package system?
- Previous by thread: But how do I finally fix package system?
- Next by thread: Re: But how do I finally fix package system?
- Index(es):
Relevant Pages
|