Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[389e37]: impnotes / pack-intro.html Maximize Restore History

Download this file

pack-intro.html    42 lines (41 with data), 20.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>11.1. Introduction to Packages</title><link rel="stylesheet" type="text/css" href="impnotes.css" /><link rev="made" href="mailto:clisp-list@lists.sourceforge.net" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_8706" /><link rel="home" href="index.html" title="Implementation Notes for GNU CLISP" /><link rel="up" href="packages.html" title="Chapter 11. Packages" /><link rel="prev" href="packages.html" title="Chapter 11. Packages" /><link rel="next" href="pack-lock.html" title="11.2. Constraints on the “COMMON-LISP” Package for Conforming Programs - package locking" /><link rel="copyright" href="legalese.html" title="Legal Status of the CLISP Implementation Notes" /><meta name="date" content="'generated: 2010-07-07 11:48:49-04:00'" /><link rel="author" title="Authors" href="index.html#authors" /><link rel="contents" title="Table of Contents" href="index.html" /><link rel="glossary" href="glossary.html" /><link rel="help" href="faq.html#faq-help" title="How do I ask for help?" /><link rel="home" title="Home" href="http://clisp.cons.org" /><link rel="index" href="idx.html" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">11.1. Introduction to Packages </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="packages.html">Prev</a> </td><th width="60%" align="center">Chapter 11. Packages </th><td width="20%" align="right"> <a accesskey="n" href="pack-lock.html">Next</a></td></tr></table><hr /></div><div class="section" title="11.1. Introduction to Packages"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="pack-intro"></a>11.1. Introduction to Packages
<a class="clhs" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/sec_11-1-1.html">[sec_11-1-1]</a></h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="pack-intro.html#make-pack">11.1.1. Function <code class="function">MAKE-PACKAGE</code></a></span></dt><dt><span class="section"><a href="pack-intro.html#defpack">11.1.2. Macro <code class="function">DEFPACKAGE</code></a></span></dt><dt><span class="section"><a href="pack-intro.html#re-export">11.1.3. Function <code class="function">EXT:RE-EXPORT</code></a></span></dt><dt><span class="section"><a href="pack-intro.html#pack-inverted">11.1.4. Function <code class="function">EXT:PACKAGE-CASE-INVERTED-P</code></a></span></dt><dt><span class="section"><a href="pack-intro.html#pack-sensitive">11.1.5. Function <code class="function">EXT:PACKAGE-CASE-SENSITIVE-P</code></a></span></dt></dl></div><div class="section" title="11.1.1. Function MAKE-PACKAGE"><div class="titlepage"><div><div><h3 class="title"><a id="make-pack"></a>11.1.1. Function <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_make-package.html" target="_top"><code class="function">MAKE-PACKAGE</code></a></h3></div></div></div><p>The default value of the <code class="constant">:USE</code> argument is
<span class="data"><code class="literal">(<a class="clhs" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/sec_11-1-2-1.html"><strong class="package"><span class="quote"><span class="quote">COMMON-LISP</span></span></strong></a>)</code></span>.</p><p><a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_make-package.html" target="_top"><code class="function">MAKE-PACKAGE</code></a> accepts additional keyword arguments
<a class="link" href="package-case.html" title="11.5. Package Case-Sensitivity"><code class="constant">:CASE-SENSITIVE</code></a> and <a class="link" href="package-case.html" title="11.5. Package Case-Sensitivity"><code class="constant">:CASE-INVERTED</code></a> (but <span class="strong"><strong>not</strong></span> <a class="link" href="package-case.html" title="11.5. Package Case-Sensitivity"><code class="constant">:MODERN</code></a>!)
</p></div><div class="section" title="11.1.2. Macro DEFPACKAGE"><div class="titlepage"><div><div><h3 class="title"><a id="defpack"></a>11.1.2. Macro <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/mac_defpackage.html" target="_top"><code class="function">DEFPACKAGE</code></a></h3></div></div></div><p><a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/mac_defpackage.html" target="_top"><code class="function">DEFPACKAGE</code></a> accepts additional options <a class="link" href="package-case.html" title="11.5. Package Case-Sensitivity"><code class="constant">:CASE-SENSITIVE</code></a>,
<a class="link" href="package-case.html" title="11.5. Package Case-Sensitivity"><code class="constant">:CASE-INVERTED</code></a>, and <a class="link" href="package-case.html" title="11.5. Package Case-Sensitivity"><code class="constant">:MODERN</code></a>.</p><p>When the package being defined already exists, it is modified as
follows (and in this order):</p><div class="variablelist"><dl><dt><span class="term"><a class="link" href="package-case.html" title="11.5. Package Case-Sensitivity"><code class="constant">:CASE-SENSITIVE</code></a></span></dt><dd>adjusted with <code class="code">(<a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/mac_setfcm_psetf.html" target="_top"><code class="function">SETF</code></a> <a class="link" href="pack-intro.html#pack-sensitive" title="11.1.5. Function EXT:PACKAGE-CASE-SENSITIVE-P"><code class="function">EXT:PACKAGE-CASE-SENSITIVE-P</code></a>)</code>
(with a warning)</dd><dt><span class="term"><a class="link" href="package-case.html" title="11.5. Package Case-Sensitivity"><code class="constant">:CASE-INVERTED</code></a></span></dt><dd>adjusted with <code class="code">(<a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/mac_setfcm_psetf.html" target="_top"><code class="function">SETF</code></a> <a class="link" href="pack-intro.html#pack-inverted" title="11.1.4. Function EXT:PACKAGE-CASE-INVERTED-P"><code class="function">EXT:PACKAGE-CASE-INVERTED-P</code></a>)</code>
(with a warning)</dd><dt><span class="term"><a class="link" href="package-case.html" title="11.5. Package Case-Sensitivity"><code class="constant">:MODERN</code></a></span></dt><dd><p>if <a class="clhs" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/sec_11-1-2-1.html"><strong class="package"><span class="quote"><span class="quote">COMMON-LISP</span></span></strong></a> is being used, it is un-used and
<a href="package-case.html" class="olink"><strong class="package"><span class="quote"><span class="quote">CS-COMMON-LISP</span></span></strong></a> is used instead; also, <a href="package-case.html" class="olink"><strong class="package"><span class="quote"><span class="quote">CS-COMMON-LISP</span></span></strong></a> is used instead of <a class="clhs" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/sec_11-1-2-1.html"><strong class="package"><span class="quote"><span class="quote">COMMON-LISP</span></span></strong></a>
throughout the <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/mac_defpackage.html" target="_top"><code class="function">DEFPACKAGE</code></a> form, e.g.,</p><pre class="programlisting">
(<a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/mac_defpackage.html" target="_top"><code class="function">DEFPACKAGE</code></a> "FOO"
(<a class="link" href="package-case.html" title="11.5. Package Case-Sensitivity"><code class="constant">:MODERN</code></a> <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/convar_t.html" target="_top"><code class="constant">T</code></a>)
(<code class="constant">:USE</code> "COMMON-LISP" "EXT"))
</pre><p>is equivalent to</p><pre class="programlisting">
(<a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/mac_defpackage.html" target="_top"><code class="function">DEFPACKAGE</code></a> "FOO"
(<a class="link" href="package-case.html" title="11.5. Package Case-Sensitivity"><code class="constant">:CASE-SENSITIVE</code></a> <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/convar_t.html" target="_top"><code class="constant">T</code></a>)
(<a class="link" href="package-case.html" title="11.5. Package Case-Sensitivity"><code class="constant">:CASE-INVERTED</code></a> <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/convar_t.html" target="_top"><code class="constant">T</code></a>)
(<code class="constant">:USE</code> "CS-COMMON-LISP" "EXT"))
</pre><p class="simpara"><code class="code">(<a class="link" href="package-case.html" title="11.5. Package Case-Sensitivity"><code class="constant">:MODERN</code></a> <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/convar_nil.html" target="_top"><code class="constant">NIL</code></a>)</code> reverts the
effects of <code class="code">(<a class="link" href="package-case.html" title="11.5. Package Case-Sensitivity"><code class="constant">:MODERN</code></a> <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/convar_t.html" target="_top"><code class="constant">T</code></a>)</code>.</p></dd><dt><span class="term"><code class="constant">:NICKNAMES</code></span></dt><dd>adjusted with <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_rename-package.html" target="_top"><code class="function">RENAME-PACKAGE</code></a>
</dd><dt><span class="term"><code class="constant">:DOCUMENTATION</code></span></dt><dd>reset to the new value with <code class="code">(<a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/mac_setfcm_psetf.html" target="_top"><code class="function">SETF</code></a>
<a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/stagenfun_doc_umentationcp.html" target="_top"><code class="function">DOCUMENTATION</code></a>)</code></dd><dt><span class="term"><code class="constant">:SHADOW</code></span></dt><dd>adjusted with <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_shadow.html" target="_top"><code class="function">SHADOW</code></a>
</dd><dt><span class="term"><code class="constant">:SHADOWING-IMPORT-FROM</code></span></dt><dd>adjusted with <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_shadowing-import.html" target="_top"><code class="function">SHADOWING-IMPORT</code></a>
</dd><dt><span class="term"><code class="constant">:USE</code></span></dt><dd>adjusted with <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_use-package.html" target="_top"><code class="function">USE-PACKAGE</code></a> and <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_unuse-package.html" target="_top"><code class="function">UNUSE-PACKAGE</code></a>
</dd><dt><span class="term"><code class="constant">:IMPORT-FROM</code></span></dt><dd>adjusted with <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_import.html" target="_top"><code class="function">IMPORT</code></a>
</dd><dt><span class="term"><code class="constant">:INTERN</code></span></dt><dd>adjusted with <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_intern.html" target="_top"><code class="function">INTERN</code></a> (but <span class="strong"><strong>not</strong></span> <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_unintern.html" target="_top"><code class="function">UNINTERN</code></a>)
</dd><dt><span class="term"><code class="constant">:EXPORT</code></span></dt><dd>adjusted with <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_intern.html" target="_top"><code class="function">INTERN</code></a> and <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_export.html" target="_top"><code class="function">EXPORT</code></a> (but <span class="strong"><strong>not</strong></span>
<a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_unexport.html" target="_top"><code class="function">UNEXPORT</code></a>)</dd><dt><span class="term"><code class="constant">:SIZE</code></span></dt><dd>ignored</dd></dl></div></div><div class="section" title="11.1.3. Function EXT:RE-EXPORT"><div class="titlepage"><div><div><h3 class="title"><a id="re-export"></a>11.1.3. Function <a class="link" href="pack-intro.html#re-export" title="11.1.3. Function EXT:RE-EXPORT"><code class="function">EXT:RE-EXPORT</code></a></h3></div></div></div><p>The function <code class="code">(<a class="link" href="pack-intro.html#re-export" title="11.1.3. Function EXT:RE-EXPORT"><code class="function">EXT:RE-EXPORT</code></a> <em class="replaceable"><code>FROM-PACK</code></em>
<em class="replaceable"><code>TO-PACK</code></em>)</code> re-<a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_export.html" target="_top"><code class="function">EXPORT</code></a>s all external
<a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/syscla_symbol.html" target="_top"><code class="classname">SYMBOL</code></a>s from <em class="replaceable"><code>FROM-PACK</code></em> also from
<em class="replaceable"><code>TO-PACK</code></em>, provided it already uses
<em class="replaceable"><code>FROM-PACK</code></em>; and <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_signal.html" target="_top"><code class="function">SIGNAL</code></a>s an <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/contyp_error.html" target="_top"><code class="classname">ERROR</code></a> otherwise.
</p></div><div class="section" title="11.1.4. Function EXT:PACKAGE-CASE-INVERTED-P"><div class="titlepage"><div><div><h3 class="title"><a id="pack-inverted"></a>11.1.4. Function <a class="link" href="pack-intro.html#pack-inverted" title="11.1.4. Function EXT:PACKAGE-CASE-INVERTED-P"><code class="function">EXT:PACKAGE-CASE-INVERTED-P</code></a></h3></div></div></div><p>Returns <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/convar_t.html" target="_top"><code class="constant">T</code></a> if the argument is a
<a class="link" href="package-case.html#pack-case-inverted">case-inverted package</a>.
This function is <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/mac_setfcm_psetf.html" target="_top"><code class="function">SETF</code></a>able, although it is probably not a good idea
to change the case-inverted status of an existing package.</p></div><div class="section" title="11.1.5. Function EXT:PACKAGE-CASE-SENSITIVE-P"><div class="titlepage"><div><div><h3 class="title"><a id="pack-sensitive"></a>11.1.5. Function <a class="link" href="pack-intro.html#pack-sensitive" title="11.1.5. Function EXT:PACKAGE-CASE-SENSITIVE-P"><code class="function">EXT:PACKAGE-CASE-SENSITIVE-P</code></a></h3></div></div></div><p>Returns <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/convar_t.html" target="_top"><code class="constant">T</code></a> if the argument is a <a class="link" href="package-case.html" title="11.5. Package Case-Sensitivity"><code class="constant">:CASE-SENSITIVE</code></a> <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/syscla_package.html" target="_top"><code class="classname">PACKAGE</code></a>.
This function is <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/mac_setfcm_psetf.html" target="_top"><code class="function">SETF</code></a>able, although it is probably not a good idea
to change the case-sensitive status of an existing package.</p></div></div><div class="bookinfo"><hr /><table width="100%" summary="impnotes meta info"><th><td align="left">These notes document <a class="ulink" href="http://clisp.cons.org" target="_top"><span class="command"><strong>CLISP</strong></span></a> version 2.49</td><td align="right">Last modified: 2010-07-07</td></th></table></div><div class="custom-footer"><hr /><table width="100%"><tr><td align="left"><a href="http://clisp.cons.org"><img src="clisp.png" width="48" height="48" alt="[CLISP home]" /></a></td><td align="center"><a href="https://sourceforge.net/donate/index.php?group_id=1355"><img src="http://images.sourceforge.net/images/project-support.jpg" width="88" height="32" alt="[Support CLISP]" /></a></td><td align="right"><a href="https://sourceforge.net/projects/clisp"><img width="120" height="30" alt="[SourceForge]" src="http://sflogo.sourceforge.net/sflogo.php?group_id=1355&amp;type=12&amp;page=pack-intro" /></a></td></tr></table></div><hr /><form method="get" action="http://www.google.com/custom" target="_top"><table width="100%" border="0"><tr><td nowrap="nowrap" align="center"><input type="hidden" name="domains" value="clisp.cons.org;clisp.podval.org;www.lisp.org" /><label for="sbi" style="display: none">Enter your search terms</label><input type="text" name="q" size="50" maxlength="255" id="sbi" value="11.1. Introduction to Packages" /><label for="sbb" style="display: none">Submit search form</label><input type="submit" name="sa" value="Google Search" id="sbb" /></td></tr><tr><td nowrap="nowrap" align="center"><input type="radio" name="sitesearch" value="" checked="1" id="ss0" /><label for="ss0" title="Search the Web"><small>Web</small></label><input type="radio" name="sitesearch" value="clisp.cons.org" id="ss1" /><label for="ss1" title="Search clisp.cons.org"><small>clisp.cons.org</small></label><input type="radio" name="sitesearch" value="clisp.podval.org" id="ss2" /><label for="ss2" title="Search clisp.podval.org"><small>clisp.podval.org</small></label><input type="radio" name="sitesearch" value="www.lisp.org" id="ss3" /><label for="ss3" title="Search www.lisp.org"><small>www.lisp.org</small></label><input type="hidden" name="client" value="pub-4445255502750357" /><input type="hidden" name="forid" value="1" /><input type="hidden" name="ie" value="UTF-8" /><input type="hidden" name="oe" value="UTF-8" /><input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:000000;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;LH:48;LW:48;L:http://clisp.cons.org/clisp.png;S:http://clisp.cons.org;FORID:1" /><input type="hidden" name="hl" value="en" /></td></tr></table></form><hr /><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="packages.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="packages.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="pack-lock.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 11. Packages  </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 11.2. Constraints on the <strong class="package"><span class="quote"><span class="quote">COMMON-LISP</span></span></strong> Package for Conforming Programs - package locking </td></tr></table></div></body></html>