Raymond Toy pushed to branch master at cmucl / cmucl
Commits: f7e92b73 by Raymond Toy at 2015-11-10T21:39:15Z Rename arguments to RENAME-PACKAGE and update docstring
Can't ever remember the order of arguments for RENAME-PACKAGE so just rename the variables to make it clearer. And update the docstring to be a little more verbose.
- - - - -
1 changed file:
- src/code/package.lisp
Changes:
===================================== src/code/package.lisp ===================================== --- a/src/code/package.lisp +++ b/src/code/package.lisp @@ -1204,23 +1204,25 @@ ;;; Change the name if we can, blast any old nicknames and then ;;; add in any new ones. ;;; -(defun rename-package (package name &optional (nicknames ())) - "Changes the name and nicknames for a package." +(defun rename-package (package new-name &optional (new-nicknames ())) + "Replaces the name and nicknames of Package. The old name and all of + the old nicknames of Package are eliminated and are replaced by + New-Name and New-Nicknames." (let* ((package (package-or-lose package)) - (name (string name)) - (found (find-package name))) + (new-name (string new-name)) + (found (find-package new-name))) (unless (or (not found) (eq found package)) (error 'simple-package-error - :package name + :package new-name :format-control (intl:gettext "A package named ~S already exists.") - :format-arguments (list name))) + :format-arguments (list new-name))) (remhash (package-%name package) *package-names*) (dolist (n (package-%nicknames package)) (remhash n *package-names*)) - (setf (package-%name package) name) - (setf (gethash name *package-names*) package) + (setf (package-%name package) new-name) + (setf (gethash new-name *package-names*) package) (setf (package-%nicknames package) ()) - (enter-new-nicknames package nicknames) + (enter-new-nicknames package new-nicknames) package))
;;; Delete-Package -- Public
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/commit/f7e92b739fe1311d89924c9a5f...