| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| 2 |
<html> |
| 3 |
<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ --> |
| 4 |
<head> |
| 5 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 6 |
<title>Accessibility of Symbols in a Package (ANSI and GNU Common Lisp Document)</title> |
| 7 |
|
| 8 |
<meta name="description" content="Accessibility of Symbols in a Package (ANSI and GNU Common Lisp Document)"> |
| 9 |
<meta name="keywords" content="Accessibility of Symbols in a Package (ANSI and GNU Common Lisp Document)"> |
| 10 |
<meta name="resource-type" content="document"> |
| 11 |
<meta name="distribution" content="global"> |
| 12 |
<meta name="Generator" content="makeinfo"> |
| 13 |
<link href="index.html" rel="start" title="Top"> |
| 14 |
<link href="Introduction-to-Packages.html" rel="up" title="Introduction to Packages"> |
| 15 |
<link href="Locating-a-Symbol-in-a-Package.html" rel="next" title="Locating a Symbol in a Package"> |
| 16 |
<link href="Package-Inheritance.html" rel="prev" title="Package Inheritance"> |
| 17 |
<style type="text/css"> |
| 18 |
<!-- |
| 19 |
a.summary-letter {text-decoration: none} |
| 20 |
blockquote.indentedblock {margin-right: 0em} |
| 21 |
div.display {margin-left: 3.2em} |
| 22 |
div.example {margin-left: 3.2em} |
| 23 |
div.lisp {margin-left: 3.2em} |
| 24 |
kbd {font-style: oblique} |
| 25 |
pre.display {font-family: inherit} |
| 26 |
pre.format {font-family: inherit} |
| 27 |
pre.menu-comment {font-family: serif} |
| 28 |
pre.menu-preformatted {font-family: serif} |
| 29 |
span.nolinebreak {white-space: nowrap} |
| 30 |
span.roman {font-family: initial; font-weight: normal} |
| 31 |
span.sansserif {font-family: sans-serif; font-weight: normal} |
| 32 |
ul.no-bullet {list-style: none} |
| 33 |
--> |
| 34 |
</style> |
| 35 |
|
| 36 |
|
| 37 |
</head> |
| 38 |
|
| 39 |
<body lang="en"> |
| 40 |
<span id="Accessibility-of-Symbols-in-a-Package"></span><div class="header"> |
| 41 |
<p> |
| 42 |
Next: <a href="Locating-a-Symbol-in-a-Package.html" accesskey="n" rel="next">Locating a Symbol in a Package</a>, Previous: <a href="Package-Inheritance.html" accesskey="p" rel="prev">Package Inheritance</a>, Up: <a href="Introduction-to-Packages.html" accesskey="u" rel="up">Introduction to Packages</a> </p> |
| 43 |
</div> |
| 44 |
<hr> |
| 45 |
<span id="Accessibility-of-Symbols-in-a-Package-1"></span><h4 class="subsubsection">11.1.1.5 Accessibility of Symbols in a Package</h4> |
| 46 |
|
| 47 |
<p>A <i>symbol</i> becomes <i>accessible</i> |
| 48 |
<span id="index-accessible"></span> |
| 49 |
in a <i>package</i> |
| 50 |
if that is its <i>home package</i> when it is created, |
| 51 |
or if it is <i>imported</i> into that <i>package</i>, |
| 52 |
or by inheritance via <b>use-package</b>. |
| 53 |
</p> |
| 54 |
<p>If a <i>symbol</i> is <i>accessible</i> in a <i>package</i>, |
| 55 |
it can be referred to when using the <i>Lisp reader</i> |
| 56 |
without a <i>package prefix</i> when that <i>package</i> is the <i>current package</i>, |
| 57 |
regardless of whether it is <i>present</i> or inherited. |
| 58 |
</p> |
| 59 |
<p><i>Symbols</i> from one <i>package</i> can be made <i>accessible</i> |
| 60 |
in another <i>package</i> in two ways. |
| 61 |
</p> |
| 62 |
<dl compact="compact"> |
| 63 |
<dt>–</dt> |
| 64 |
<dd><p>Any individual <i>symbol</i> can be added to a <i>package</i> by use |
| 65 |
of <b>import</b>. After the call to <b>import</b> the |
| 66 |
<i>symbol</i> is <i>present</i> in the importing <i>package</i>. |
| 67 |
The status of the <i>symbol</i> in the <i>package</i> |
| 68 |
it came from (if any) is unchanged, and the <i>home package</i> for |
| 69 |
this <i>symbol</i> is unchanged. |
| 70 |
Once <i>imported</i>, a <i>symbol</i> is <i>present</i> in the |
| 71 |
importing <i>package</i> |
| 72 |
and can be removed only by calling <b>unintern</b>. |
| 73 |
</p> |
| 74 |
<p>A <i>symbol</i> is <i>shadowed</i>_3 by another <i>symbol</i> |
| 75 |
in some <i>package</i> if the first <i>symbol</i> would be <i>accessible</i> |
| 76 |
by inheritance if not for the presence of the second <i>symbol</i>. |
| 77 |
See <b>shadowing-import</b>. |
| 78 |
</p> |
| 79 |
</dd> |
| 80 |
<dt>–</dt> |
| 81 |
<dd><p>The second mechanism for making <i>symbols</i> from one <i>package</i> |
| 82 |
<i>accessible</i> in another is provided by <b>use-package</b>. |
| 83 |
All of the <i>external symbols</i> of the used <i>package</i> are inherited |
| 84 |
by the using <i>package</i>. |
| 85 |
The <i>function</i> <b>unuse-package</b> undoes the effects of a previous <b>use-package</b>. |
| 86 |
</p></dd> |
| 87 |
</dl> |
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
</body> |
| 93 |
</html> |