Antsan
3/30/2016 4:53:00 PM
Am Mittwoch, 30. März 2016 11:56:12 UTC+2 schrieb Jim Newton:
> When I load a CL package (in slime anyway) and symbol
> conflicts are encountered, slime/sbcl gives me the following restarts.
>
> I always choose restart=2, which shows me the two symbols and asks me
> which one I want. But can someone explain to me what restart=0 and restart=1
> do? In the example below, I want to use CLOSER-MOP::DEFGENERIC
> rather than DISPATCH::DEFGENERIC. Can I do that by selecting restart=0
> or restart=1? If so, couldn't the text of the restart be made to state that explicitly?
>
>
> USE-PACKAGE #<PACKAGE "CLOSER-MOP"> causes name-conflicts in
> #<PACKAGE "DISPATCH"> between the following symbols:
> CLOSER-MOP:DEFGENERIC, COMMON-LISP:DEFGENERIC
> [Condition of type NAME-CONFLICT]
> See also:
> Common Lisp Hyperspec, 11.1.1.2.5 [:section]
>
> Restarts:
> 0: [KEEP-OLD] Keep symbols already accessible DISPATCH (shadowing others).
> 1: [TAKE-NEW] Make newly exposed symbols accessible in DISPATCH, uninterning old ones.
> 2: [RESOLVE-CONFLICT] Resolve conflict.
> 3: [RETRY] Retry compiling #<CL-SOURCE-FILE "dispatch" "src" "dispatch">.
> 4: [ACCEPT] Continue, treating compiling #<CL-SOURCE-FILE "dispatch" "src" "dispatch"> as having been successful.
> 5: [RETRY] Retry ASDF operation.
> --more--
>
> Backtrace:
> 0: (NAME-CONFLICT #<PACKAGE "DISPATCH"> USE-PACKAGE #<PACKAGE "CLOSER-MOP"> CLOSER-MOP:DEFGENERIC DEFGENERIC)
> 1: ((FLET SB-IMPL::THUNK :IN USE-PACKAGE))
I can't really tell which one you'd choose in this situation, but seeing
how you probably didn't load the DISPATCH package, then overwrite some symbols
and then reload the DISPATCH package again, I think you'd have to choose
1: [TAKE-NEW]
here.
Wait a second, that's not DISPATCH::DEFGENERIC but CL::DEFGENERIC!
Still, if you loaded the CL package first (which I assume is what most people
do) you'd take
1: [TAKE-NEW]