From 1ecb2d07a7a3c0964d473c1eca66cebd4223e47a Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Tue, 29 Jan 2013 11:27:34 +0200 Subject: [PATCH] nicer name-conflict restarts for common cases For IMPORT: offer option to SHADOWING-IMPORT the new symbol or skip importing. For EXPORT: offer option to KEEP-OLD or TAKE-NEW. (Shadowing or uninterning the other one.) For USE-PACKAGE: offer option to KEEP-OLD or TAKE-NEW. (Shadowing or uninterning the other ones.) --- src/code/target-package.lisp | 145 ++++++++++++++++++++++++++++-------------- tests/packages.impure.lisp | 84 ++++++++++++++++++++++++ 2 files changed, 182 insertions(+), 47 deletions(-) diff --git a/src/code/target-package.lisp b/src/code/target-package.lisp index 00cbc54..892ceaf 100644 --- a/src/code/target-package.lisp +++ b/src/code/target-package.lisp @@ -894,56 +894,107 @@ implementation it is ~S." *default-package-use-list*) (name-conflict-symbols c))))) (defun name-conflict (package function datum &rest symbols) - (restart-case - (error 'name-conflict :package package :symbols symbols - :function function :datum datum) - (resolve-conflict (chosen-symbol) - :report "Resolve conflict." - :interactive - (lambda () - (let* ((len (length symbols)) - (nlen (length (write-to-string len :base 10))) - (*print-pretty* t)) - (format *query-io* "~&~@