(defpackage :foo (:use :cl) (:export :hello))
(defpackage :bar (:use :cl))
;; oops, I meant foo:hello
(defpackage :bar (:use :cl :foo))
The new restarts are
0: [KEEP-OLD] Keep symbols already accessible BAR (shadowing others).
1: [TAKE-NEW] Make newly exposed symbols accessible in BAR, uninterning
The most common mistake -- at least for me -- is using a symbol that
was expected to be present but wasn't. Since TAKE-NEW corrects that
mistake, I think it should appear first. (SLIME completion prevents
this problem when typing new code, but moving existing code is another
Replacing the last defpackage with (import 'foo:hello) results in
0: [SHADOWING-IMPORT-IT] Shadowing-import FOO:HELLO, uninterning
1: [DONT-IMPORT-IT] Don't import FOO:HELLO, keeping BAR::HELLO.
This has the "right" order, but regardless of the order it should at
least be consistent with the DEFPACKAGE restarts. I would also vote
for using the same or similar restart names in IMPORT and DEFPACKAGE.
TAKE-NEW and KEEP-OLD seem nicer than SHADOWING-IMPORT-IT and
DONT-IMPORT-IT respectively. The descriptions would obviously remain
different, according to whether IMPORT or DEFPACKAGE was called.