From: Didier Verna on 31 May 2010 10:17 rename-package is such a pain... -- Resistance is futile. You will be jazzimilated. Scientific site: http://www.lrde.epita.fr/~didier Music (Jazz) site: http://www.didierverna.com
From: Didier Verna on 31 May 2010 11:14 I wrote: > rename-package is such a pain... Of course, from a practical point of view, it's not a big deal, but still... (defun add-package-nickname (package nickname) (rename-package package (package-name package) (adjoin nickname (package-nicknames package) :test #'string-equal))) -- Resistance is futile. You will be jazzimilated. Scientific site: http://www.lrde.epita.fr/~didier Music (Jazz) site: http://www.didierverna.com
From: Pascal J. Bourguignon on 31 May 2010 11:23 Didier Verna <didier(a)lrde.epita.fr> writes: > rename-package is such a pain... Yes. However, I find that most often we want to ADD a NICKNAME, hence com.informatimago.common-lisp.package:add-nickname in http://git.informatimago.com/viewgit/index.php?a=viewblob&p=public/lisp&h=53fe58142c9b4d496e3212c934a68419e867a484&hb=5b22e7eab73f004ef00d478a119d5f4582174018&f=common-lisp/package.lisp I guess you could also write: (defun nicknames (package) (package-nicknames package)) (defun (setf nicknames) (new-nicknames package) (let* ((temp (gensym "PACKAGE-")) (old-name (package-name package)) (p (rename-package package temp))) (rename-package p package-name new-nicknames) new-nicknames)) -- __Pascal Bourguignon__ http://www.informatimago.com
|
Pages: 1 Prev: What kind of open source license do you use... Next: Programming projects to learn lisp |