clasp icon indicating copy to clipboard operation
clasp copied to clipboard

Suboptimal resolution for multiple USE-PACKAGE conflict

Open Bike opened this issue 4 years ago • 0 comments

(defpackage #:aaa (:export #:ff))
(defpackage #:bbb (:export #:ff))
(defpackage #:ccc (:export #:ff))
(defpackage #:ddd (:use #:aaa #:bbb :#ccc))

Calls to use-package with multiple packages are treated as sequenced calls to use-package with one package. This means that DDD will first use AAA, and then try to use BBB. A conflict is signaled between the inherited AAA:FF and the new BBB:FF, which can be resolved by shadowing-importing one of them; then CCC is used and there is no conflict because of the shadowing import. So it is not possible to specify that CCC:FF should be imported, and in fact there is no indication that there is a conflict with CCC. It would be better in cases like this (where there is a conflict between multiple newly inherited packages) to present the entire conflict at once, with the resolve-conflict restart like unintern has. (Also, if DDD already had a symbol named ff, a keep-old restart.)

Pointed out by beach in #sicl https://irclog.tymoon.eu/libera/%23sicl?around=1627053484#1627053484

Bike avatar Jul 29 '21 14:07 Bike