Path: utzoo!attcan!uunet!seismo!ukma!wuarchive!zaphod.mps.ohio-state.edu!caen!hellgate.utah.edu!cdr.utah.edu!moore From: moore%cdr.utah.edu@cs.utah.edu (Tim Moore) Newsgroups: comp.lang.lisp Subject: Re: INTERN in Common Lisp and "old" Lisp Message-ID: <1990Oct25.102550.9695@hellgate.utah.edu> Date: 25 Oct 90 16:25:50 GMT References: <2725F2EA.6996@marob.masa.com> <13101@crdgw1.crd.ge.com> Organization: University of Utah CS Dept Lines: 24 In article <13101@crdgw1.crd.ge.com> halverson@crd.ge.com (Pete Halverson) writes: >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". >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) In Common Lisps that conform to CLtL2 and the emerging ANSI standard, IMPORT itself will do what you want (from pg. 268): "X3J13 voted in June 1987 <102> to clarify that if any symbol to be imported has no home package then IMPORT sets the home package of the symbol to the package to which the symbol is being imported." Tim Moore moore@cs.utah.edu {bellcore,hplabs}!utah-cs!moore "Ah, youth. Ah, statute of limitations." -John Waters