Path: utzoo!attcan!uunet!zaphod.mps.ohio-state.edu!rpi!crdgw1!betelgeuse!halvers From: halvers@betelgeuse.crd.ge.com (Pete Halverson) Newsgroups: comp.lang.lisp Subject: Re: INTERN in Common Lisp and "old" Lisp Message-ID: <13101@crdgw1.crd.ge.com> Date: 25 Oct 90 14:14:25 GMT References: <2725F2EA.6996@marob.masa.com> Sender: news@crdgw1.crd.ge.com Reply-To: halverson@crd.ge.com (Pete Halverson) Organization: General Electric Corporate R&D Center Lines: 33 In article <2725F2EA.6996@marob.masa.com> cowan@marob.masa.com (John Cowan) writes: > >How does one do in Common Lisp what INTERN used to do? ...[namely,] took >an "uninterned" (i.e. package-less) symbol, such as GENSYM generates, and >made it "interned in a package". Well, if you're not worried about pointers to the original symbol, then obviously something like (defun intern-symbol (symbol &optional (package *package*)) (intern (symbol-name symbol) package)) will come close. It doesn't address your goal of changing the original symbol object, though. >Since we can change a symbol 's package slot >to< NIL using UNINTERN, >there should be some way to undo this (UNUNINTERN? SET-PACKAGE? (SETF >(PACKAGE #:FOO) "LISP")?) In Symbolics and Lucid CL, the function (setf symbol-package) seems to work as expected, although Lucid makes you import it into the target package first: (defun intern-symbol (symbol &optional (package *package*)) #+lucid (import symbol package) (setf (symbol-package symbol) package) symbol) -- =============================================================================== Pete Halverson INET: halverson@crd.ge.com GE Corporate R&D Center UUCP: uunet!crd.ge.com!halverson Schenectady, NY "Money for nuthin' and your MIPS for free"