X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ftarget-package.lisp;h=7a914d3581623cb9e390b30a8d429e1bf766ddc8;hb=fd324a9d981355d8bc10d2bd469cb54c4c9108fd;hp=a8ccd00f028cff676a57f26c83e16409491c2dc5;hpb=d5319592583dda6833b74b34b52dbd2aa3109948;p=sbcl.git diff --git a/src/code/target-package.lisp b/src/code/target-package.lisp index a8ccd00..7a914d3 100644 --- a/src/code/target-package.lisp +++ b/src/code/target-package.lisp @@ -78,7 +78,7 @@ res))) ;;; Destructively resize TABLE to have room for at least SIZE entries -;;; and rehash its existing entries. +;;; and rehash its existing entries. (defun resize-package-hashtable (table size) (let* ((vec (package-hashtable-table table)) (hash (package-hashtable-hash table)) @@ -786,6 +786,17 @@ error if any of PACKAGES is not a valid package designator." string length hash ehash) (values symbol found)))) +(defun print-symbol-with-prefix (stream symbol colon at) + #!+sb-doc + "For use with ~/: Write SYMBOL to STREAM as if it is not accessible from + the current package." + (declare (ignore colon at)) + ;; Only keywords should be accessible from the keyword package, and + ;; keywords are always printed with colons, so this guarantees that the + ;; symbol will not be printed without a prefix. + (let ((*package* *keyword-package*)) + (write symbol :stream stream :escape t))) + (define-condition name-conflict (reference-condition package-error) ((function :initarg :function :reader name-conflict-function) (datum :initarg :datum :reader name-conflict-datum) @@ -794,7 +805,8 @@ error if any of PACKAGES is not a valid package designator." (:report (lambda (c s) (format s "~@<~S ~S causes name-conflicts in ~S between the ~ - following symbols:~2I~@:_~{~S~^, ~}~:@>" + following symbols:~2I~@:_~ + ~{~/sb-impl::print-symbol-with-prefix/~^, ~}~:@>" (name-conflict-function c) (name-conflict-datum c) (package-error-package c) @@ -812,7 +824,9 @@ error if any of PACKAGES is not a valid package designator." (nlen (length (write-to-string len :base 10))) (*print-pretty* t)) (format *query-io* "~&~@