![[LISPWORKS]](/image.pl?url=http%3a%2f%2fwww.lispworks.com%2fdocumentation%2fHyperSpec%2fBody%2f..%2fGraphics%2fLWSmall.gif&f=jpg&w=240)
![[Common Lisp HyperSpec (TM)]](/image.pl?url=http%3a%2f%2fwww.lispworks.com%2fdocumentation%2fHyperSpec%2fBody%2f..%2fGraphics%2fCLHS_Sm.gif&f=jpg&w=240)
Syntax:
importsymbols&optional package =>t
Arguments and Values:
symbols---adesignator for alist ofsymbols.
package---apackage designator. The default is thecurrent package.
Description:
import addssymbol orsymbols to the internals ofpackage, checking for name conflicts with existingsymbols eitherpresent inpackage oraccessible to it. Once thesymbols have beenimported, they may be referenced in theimportingpackage without the use of apackage prefix when using theLisp reader.
A name conflict inimport between thesymbol being imported and a symbol inherited from some otherpackage can be resolved in favor of thesymbol beingimported by making it a shadowing symbol, or in favor of thesymbol alreadyaccessible by not doing theimport. A name conflict inimport with asymbol alreadypresent in thepackage may be resolved by uninterning thatsymbol, or by not doing theimport.
The importedsymbol is not automatically exported from thecurrent package, but if it is alreadypresent and external, then the fact that it is external is not changed. If anysymbol to beimported has no home package (i.e.,(symbol-packagesymbol) => nil),import sets thehome package of thesymbol topackage.
If thesymbol is alreadypresent in the importingpackage,import has no effect.
Examples:
(import 'common-lisp::car (make-package 'temp :use nil)) => T (find-symbol "CAR" 'temp) => CAR, :INTERNAL (find-symbol "CDR" 'temp) => NIL, NIL
The form(import 'editor:buffer) takes the external symbol namedbuffer in theEDITOR package (this symbol was located when the form was read by theLisp reader) and adds it to thecurrent package as aninternal symbol. The symbolbuffer is thenpresent in thecurrent package.
Side Effects:
The package system is modified.
Affected By:
Current state of the package system.
Exceptional Situations:
import signals acorrectable error oftypepackage-error if any of thesymbols to beimported has thesamename (understring=) as some distinctsymbol (undereql) alreadyaccessible in thepackage, even if the conflict is with ashadowing symbol of thepackage.
See Also:
Notes: None.