Clean up all use of the *-space-free-pointers.
[sbcl.git] / src / code / target-package.lisp
index fddb492..4569a11 100644 (file)
@@ -75,7 +75,7 @@
 
 (defmacro with-package-names ((names &key) &body body)
   `(let ((,names *package-names*))
-     (with-locked-hash-table (,names)
+     (with-locked-system-table (,names)
        ,@body)))
 \f
 ;;;; PACKAGE-HASHTABLE stuff
@@ -599,7 +599,7 @@ implementation it is ~S." *default-package-use-list*)
        (cerror "Clobber existing package."
                "A package named ~S already exists" name)
        (setf clobber t))
-     (with-packages ()
+     (with-package-graph ()
        ;; Check for race, signal the error outside the lock.
        (when (and (not clobber) (find-package name))
          (go :restart))
@@ -640,9 +640,10 @@ implementation it is ~S." *default-package-use-list*)
 (defun rename-package (package-designator name &optional (nicknames ()))
   #!+sb-doc
   "Changes the name and nicknames for a package."
+  (let ((package nil))
   (tagbody :restart
-     (let* ((package (find-undeleted-package-or-lose package-designator))
-            (name (package-namify name))
+       (setq package (find-undeleted-package-or-lose package-designator))
+       (let* ((name (package-namify name))
             (found (find-package name))
             (nicks (mapcar #'string nicknames)))
        (unless (or (not found) (eq found package))
@@ -668,8 +669,8 @@ implementation it is ~S." *default-package-use-list*)
            (setf (package-%name package) name
                  (gethash name names) package
                  (package-%nicknames package) ()))
-         (%enter-new-nicknames package nicknames))
-       package)))
+           (%enter-new-nicknames package nicknames))))
+    package))
 
 (defun delete-package (package-designator)
   #!+sb-doc
@@ -966,8 +967,8 @@ uninterned."
                 (remove symbol shadowing-symbols)))
 
         (multiple-value-bind (s w) (find-symbol name package)
-          (declare (ignore s))
-          (cond ((or (eq w :internal) (eq w :external))
+          (cond ((not (eq symbol s)) nil)
+                ((or (eq w :internal) (eq w :external))
                  (nuke-symbol (if (eq w :internal)
                                   (package-internal-symbols package)
                                   (package-external-symbols package))
@@ -1116,6 +1117,7 @@ the importation, then a correctable error is signalled."
                    (let ((found (member sym syms :test #'string=)))
                      (if found
                          (when (not (eq (car found) sym))
+                           (setf syms (remove (car found) syms))
                            (name-conflict package 'import sym sym (car found)))
                          (push sym syms))))
                   ((not (eq s sym))