1
0
Fork 0
cl-sites/novaspec.org/cl/f_shadowing-import.html
2025-02-05 18:52:26 +01:00

326 lines
No EOL
6.8 KiB
HTML

<!DOCTYPE HTML>
<HTML LANG="en-us"
><HEAD
><TITLE
>shadowing-import | Common Lisp Nova Spec</TITLE
><META CHARSET="US-ASCII"
><LINK REL="canonical" HREF="f_shadowing-import.html"
><LINK REL="next" HREF="f_delete-package.html" TYPE="text/html" TITLE="delete-package"
><LINK REL="prev" HREF="f_shadow.html" TYPE="text/html" TITLE="shadow"
><LINK REL="up" HREF="11_2_Packages_Dictionary.html" TYPE="text/html" TITLE="11.2 Packages Dictionary"
><LINK REL="start" HREF="index.html" TYPE="text/html" TITLE="Common Lisp Nova Spec"
><META NAME="VIEWPORT" CONTENT="width=device-width, initial-scale=1.0"
><LINK REL="STYLESHEET" HREF="dpans.css%3F3909942064.css"
><SCRIPT SRC="dpans.js%3F3909942064"
></SCRIPT
><SCRIPT SRC="apropos.js%3F3909942064"
></SCRIPT
></HEAD
><BODY
><DIV
><DIV CLASS="topnav"
><DIV CLASS="breadcrumb"
><SPAN CLASS="breadcrumb-item"
><A HREF="index.html"
>Common Lisp Nova Spec</A
></SPAN
> <SPAN CLASS="breadcrumb-item"
>&#8594; <A HREF="11_Packages.html"
>11. Packages</A
></SPAN
> <SPAN CLASS="breadcrumb-item"
>&#8594; <A HREF="11_2_Packages_Dictionary.html"
>11.2 Packages Dictionary</A
></SPAN
> <SPAN CLASS="breadcrumb-item"
>&#8594; <A HREF="f_shadowing-import.html"
>shadowing-import</A
></SPAN
></DIV
><DIV CLASS="apropos"
><DIV CLASS="apropos-io"
><A HREF="f_shadow.html" CLASS="prev"
>&#8592;</A
><SPAN ID="apropos-label"
>Apropos </SPAN
><INPUT ID="apropos" AUTOFOCUS="AUTOFOCUS" PLACEHOLDER="Type here to search" ONINPUT="aproposInput(this);" ONKEYUP="aproposKeyup(event);" ONCHANGE="aproposChange(this);" ONFOCUS="aproposFocus(this);" ONFOCUSOUT="aproposFocusout(this);"
><A HREF="f_delete-package.html" CLASS="next"
>&#8594;</A
></DIV
><DIV ID="apropos-res"
></DIV
></DIV
></DIV
><DIV CLASS="matter"
><DIV CLASS="com"
><DIV CLASS="begincom"
><HR
><TABLE WIDTH="100%" CELLSPACING="0" CELLPADDING="0"
><TR
><TD ALIGN="LEFT" VALIGN="BASELINE" WIDTH="100%" CLASS="name"
><SPAN CLASS="idx" DATA-KIND="idxref" DATA-TERM="shadowing-import"
></SPAN
><B
>shadowing-import</B
></TD
><TD ALIGN="RIGHT" VALIGN="BASELINE" WIDTH="0" NOWRAP="NOWRAP" CLASS="ftype"
><I
>Function</I
></TD
></TR
></TABLE
><HR
></DIV
><UL CLASS="subtoc"
></UL
><DL
><DT
><B
>Syntax</B
></DT
><DD
><P CLASS="j"
><B
>shadowing-import</B
> <SPAN CLASS="cmssi"
>symbols</SPAN
> <SPAN CLASS="cmtt"
>&amp;optional</SPAN
> <SPAN CLASS="cmssi"
>package</SPAN
> <SPAN CLASS="arrow"
>&#8594;</SPAN
> <SPAN CLASS="misc"
><B
>t</B
></SPAN
></P
></DD
><DT
><B
>Arguments and Values</B
></DT
><DD
><P CLASS="j"
><VAR CLASS="param"
>symbols</VAR
> &#8212; a <A HREF="26_1_Glossary.html#designator"
><EM CLASS="term"
>designator</EM
></A
> for a <A HREF="26_1_Glossary.html#list"
><EM CLASS="term"
>list</EM
></A
> of <A HREF="26_1_Glossary.html#symbol"
><EM CLASS="term"
>symbols</EM
></A
>. </P
><P CLASS="j"
><VAR CLASS="param"
>package</VAR
> &#8212; a <A HREF="26_1_Glossary.html#package_designator"
><EM CLASS="term"
>package designator</EM
></A
>. The default is the <A HREF="26_1_Glossary.html#current_package"
><EM CLASS="term"
>current package</EM
></A
>.</P
></DD
><DT
><B
>Description</B
></DT
><DD
><P CLASS="j"
><A HREF="f_shadowing-import.html" CLASS="funref"
><B
>shadowing-import</B
></A
> is like <A HREF="f_import.html" CLASS="funref"
><B
>import</B
></A
>, but it does not signal an error even if the importation of a <A HREF="26_1_Glossary.html#symbol"
><EM CLASS="term"
>symbol</EM
></A
> would shadow some <A HREF="26_1_Glossary.html#symbol"
><EM CLASS="term"
>symbol</EM
></A
> already <A HREF="26_1_Glossary.html#accessible"
><EM CLASS="term"
>accessible</EM
></A
> in <VAR CLASS="param"
>package</VAR
>. </P
><P CLASS="j"
><A HREF="f_shadowing-import.html" CLASS="funref"
><B
>shadowing-import</B
></A
> inserts each of <VAR CLASS="param"
>symbols</VAR
> into <VAR CLASS="param"
>package</VAR
> as an internal symbol, regardless of whether another <A HREF="26_1_Glossary.html#symbol"
><EM CLASS="term"
>symbol</EM
></A
> of the same name is shadowed by this action. If a different <A HREF="26_1_Glossary.html#symbol"
><EM CLASS="term"
>symbol</EM
></A
> of the same name is already <A HREF="26_1_Glossary.html#present"
><EM CLASS="term"
>present</EM
></A
> in <VAR CLASS="param"
>package</VAR
>, that <A HREF="26_1_Glossary.html#symbol"
><EM CLASS="term"
>symbol</EM
></A
> is first <A HREF="26_1_Glossary.html#uninterned"
><EM CLASS="term"
>uninterned</EM
></A
> from <VAR CLASS="param"
>package</VAR
>. The new <A HREF="26_1_Glossary.html#symbol"
><EM CLASS="term"
>symbol</EM
></A
> is added to <VAR CLASS="param"
>package</VAR
>&#8217;s shadowing-symbols list. </P
><P CLASS="j"
><A HREF="f_shadowing-import.html" CLASS="funref"
><B
>shadowing-import</B
></A
> does name-conflict checking to the extent that it checks whether a distinct existing <A HREF="26_1_Glossary.html#symbol"
><EM CLASS="term"
>symbol</EM
></A
> with the same name is <A HREF="26_1_Glossary.html#accessible"
><EM CLASS="term"
>accessible</EM
></A
>; if so, it is shadowed by the new <A HREF="26_1_Glossary.html#symbol"
><EM CLASS="term"
>symbol</EM
></A
>, which implies that it must be uninterned if it was <A HREF="26_1_Glossary.html#present"
><EM CLASS="term"
>present</EM
></A
> in <VAR CLASS="param"
>package</VAR
>.</P
></DD
><DT
><B
>Examples</B
></DT
><DD
><PRE CLASS="screen"
>(in-package "COMMON-LISP-USER") <SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> #&lt;PACKAGE "COMMON-LISP-USER"&gt;
(setq sym (intern "CONFLICT")) <SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> CONFLICT
(intern "CONFLICT" (make-package 'temp)) <SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> TEMP::CONFLICT, NIL
(package-shadowing-symbols 'temp) <SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> NIL
(shadowing-import sym 'temp) <SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> T
(package-shadowing-symbols 'temp) <SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> (CONFLICT)</PRE
></DD
><DT
><B
>Side Effects</B
></DT
><DD
><P CLASS="j"
><A HREF="f_shadowing-import.html" CLASS="funref"
><B
>shadowing-import</B
></A
> changes the state of the package system in such a way that the consistency rules do not hold across the change. </P
><P CLASS="j"
><VAR CLASS="param"
>package</VAR
>&#8217;s shadowing-symbols list is modified.</P
></DD
><DT
><B
>Affected By</B
></DT
><DD
><P CLASS="j"
>Current state of the package system.</P
></DD
><DT
><B
>See Also</B
></DT
><DD
><P CLASS="j"
><A HREF="f_import.html" CLASS="funref"
><B
>import</B
></A
>, <A HREF="f_unintern.html" CLASS="funref"
><B
>unintern</B
></A
>, <A HREF="f_package-shadowing-symbols.html" CLASS="funref"
><B
>package-shadowing-symbols</B
></A
></P
></DD
></DL
></DIV
></DIV
><DIV CLASS="footer"
><DIV CLASS="btmnav"
><A HREF="f_shadow.html" CLASS="prev"
>&#8592;</A
><A HREF="f_delete-package.html" CLASS="next"
>&#8594;</A
></DIV
><DIV CLASS="trail"
>Conversion to HTML copyright 2023 by Gilbert Baumann</DIV
></DIV
></DIV
><SCRIPT
>domReady();</SCRIPT
></BODY
></HTML
>