Simplify restarts for symbol conflicts

Bug #1205148 reported by James M. Lawrence
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
New
Undecided
Unassigned

Bug Description

(defpackage :foo (:use :cl) (:export :hello))
(defpackage :bar (:use :cl)) ; oops, forgot to :use foo
(in-package :bar)

'hello ; oops, I meant foo:hello

;; Import and choose a restart...
(import 'foo:hello)

;; ...or fix the defpackage and choose a restart.
(defpackage :bar (:use :cl :foo))

The attached patch tweaks some restarts.

Old restarts for the above IMPORT form:

 0: [SHADOWING-IMPORT-IT] Shadowing-import FOO:HELLO, uninterning HELLO.
 1: [DONT-IMPORT-IT] Don't import FOO:HELLO, keeping HELLO.

New restarts for the above IMPORT form:

 0: [TAKE-NEW] Shadowing-import FOO:HELLO, uninterning BAR::HELLO.
 1: [KEEP-OLD] Don't import FOO:HELLO, keeping BAR::HELLO.

New restarts for the second DEFPACKAGE form:

 0: [TAKE-NEW] Make newly exposed symbols accessible in BAR, uninterning old ones.
 1: [KEEP-OLD] Keep symbols already accessible in BAR (shadowing others).

The DEFPACKAGE restarts are unchanged except the order is swapped. I
would argue that the more common mistake is referring to a symbol that
was expected to be present but wasn't, as in the above example. Since
TAKE-NEW corrects that, it should go first.

Tags: patch
Revision history for this message
James M. Lawrence (llmjjmll) wrote :
tags: added: patch
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.