Diff of /impnotes/require.html [e5c0d5] .. [389e37] Maximize Restore

  Switch to side-by-side view

--- a/impnotes/require.html
+++ b/impnotes/require.html
@@ -1,12 +1,25 @@
 <?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>24.3. Function REQUIRE</title><link rel="stylesheet" href="impnotes.css" type="text/css" /><link rev="made" href="mailto:clisp-list@lists.sourceforge.net" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_8465" /><link rel="home" href="index.html" title="Implementation Notes for GNU CLISP" /><link rel="up" href="system.html" title="Chapter 24. System Construction" /><link rel="prev" href="compile-file-path.html" title="24.2. Function COMPILE-FILE-PATHNAME" /><link rel="next" href="loadfile.html" title="24.4. Function LOAD" /><link rel="copyright" href="legalese.html" title="Legal Status of the CLISP Implementation Notes" /><meta name="date" content="'generated: 2009-07-28 12: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">24.3. Function <code class="function">REQUIRE</code></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="compile-file-path.html">Prev</a> </td><th width="60%" align="center">Chapter 24. System Construction   </th><td width="20%" align="right"> <a accesskey="n" href="loadfile.html">Next</a></td></tr></table><hr /></div><div class="section" title="24.3. Function REQUIRE"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="require"></a>24.3. Function <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_providecm_require.html" target="_top"><code class="function">REQUIRE</code></a></h2></div></div></div><p>The function <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_providecm_require.html" target="_top"><code class="function">REQUIRE</code></a> receives as the optional argument either
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>24.3. Function REQUIRE</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="system.html" title="Chapter 24. System Construction" /><link rel="prev" href="compile-file-path.html" title="24.2. Function COMPILE-FILE-PATHNAME" /><link rel="next" href="loadfile.html" title="24.4. Function LOAD" /><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">24.3. Function <code class="function">REQUIRE</code></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="compile-file-path.html">Prev</a> </td><th width="60%" align="center">Chapter 24. System Construction   </th><td width="20%" align="right"> <a accesskey="n" href="loadfile.html">Next</a></td></tr></table><hr /></div><div class="section" title="24.3. Function REQUIRE"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="require"></a>24.3. Function <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_providecm_require.html" target="_top"><code class="function">REQUIRE</code></a></h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="require.html#require-search">24.3.1. Additional <code class="function">LOAD</code> locations</a></span></dt><dt><span class="section"><a href="require.html#lib-files">24.3.2. Interaction with <code class="function">COMPILE-FILE</code></a></span></dt></dl></div><p>The function <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_providecm_require.html" target="_top"><code class="function">REQUIRE</code></a> receives as the optional argument either
  a <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/syscla_pathname.html" target="_top"><code class="classname">PATHNAME</code></a> or a <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/syscla_list.html" target="_top"><code class="classname">LIST</code></a> of <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/syscla_pathname.html" target="_top"><code class="classname">PATHNAME</code></a>s: files to be <a href="loadfile.html" class="olink"><code class="function">LOAD</code></a>ed
- if the required module is not already present.</p><p>At compile time, <code class="code">(<a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_providecm_require.html" target="_top"><code class="function">REQUIRE</code></a> <code class="filename">#P"foo"</code>)</code>
+ if the required module is not already present.</p><div class="section" title="24.3.1. Additional LOAD locations"><div class="titlepage"><div><div><h3 class="title"><a id="require-search"></a>24.3.1. Additional <a href="loadfile.html" class="olink"><code class="function">LOAD</code></a> locations</h3></div></div></div><p>In addition to (and <span class="strong"><strong>before</strong></span>) <a href="loadfile.html#load-paths" class="olink"><code class="varname">CUSTOM:*LOAD-PATHS*</code></a>, <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_providecm_require.html" target="_top"><code class="function">REQUIRE</code></a> tries to
+ find the file to <a href="loadfile.html" class="olink"><code class="function">LOAD</code></a> in the following locations:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p class="simpara"><span class="plat-dep">Platform Dependent: <span class="plat-dep">Only in <a class="ulink" href="http://clisp.cons.org" target="_top"><span class="command"><strong>CLISP</strong></span></a> built <span class="strong"><strong>without</strong></span> configure flag <code class="option"><a href="modules.html#mod-dynload" class="olink">--without-dynamic-modules</a></code>.</span></span></p><p class="simpara">The system-wide external modules directory
+    <code class="code">(<a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_merge-pathnames.html" target="_top"><code class="function">MERGE-PATHNAMES</code></a> "dynmod/" <a href="clisp.html#opt-libdir" class="olink"><code class="varname">CUSTOM:*LIB-DIRECTORY*</code></a>)</code>.</p></li><li class="listitem"><p class="simpara"><span class="plat-dep">Platform Dependent: <span class="plat-dep">Only in <a class="ulink" href="http://clisp.cons.org" target="_top"><span class="command"><strong>CLISP</strong></span></a> built <span class="strong"><strong>without</strong></span> configure flag <code class="option"><a href="modules.html#mod-dynload" class="olink">--without-dynamic-modules</a></code>.</span></span></p><p class="simpara">The user external modules directory <code class="code">(<a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_merge-pathnames.html" target="_top"><code class="function">MERGE-PATHNAMES</code></a>
+     "dynmod/" <a href="clisp-link.html#opt-install" class="olink"><code class="varname">CUSTOM:*USER-LIB-DIRECTORY*</code></a>)</code>
+    (when <a href="clisp-link.html#opt-install" class="olink"><code class="varname">CUSTOM:*USER-LIB-DIRECTORY*</code></a> is non-<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>).</p></li><li class="listitem">When <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_providecm_require.html" target="_top"><code class="function">REQUIRE</code></a> was called while <a href="loadfile.html" class="olink"><code class="function">LOAD</code></a>ing, the
+    directory with the file being loaded (i.e., <code class="code">(<a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_make-pathname.html" target="_top"><code class="function">MAKE-PATHNAME</code></a>
+     :name <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> :type <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> :defaults <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/var_stload-pa_d-truenamest.html" target="_top"><code class="varname">*LOAD-TRUENAME*</code></a>)</code>).
+</li></ul></div></div><div class="section" title="24.3.2. Interaction with COMPILE-FILE"><div class="titlepage"><div><div><h3 class="title"><a id="lib-files"></a>24.3.2. Interaction with <a href="compilefile.html" class="olink"><code class="function">COMPILE-FILE</code></a></h3></div></div></div><p>At compile time, <code class="code">(<a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_providecm_require.html" target="_top"><code class="function">REQUIRE</code></a> <code class="filename">#P"foo"</code>)</code>
 forms are treated specially: <a href="loadfile.html#load-paths" class="olink"><code class="varname">CUSTOM:*LOAD-PATHS*</code></a> is searched for
 <code class="filename">#P"foo.lisp"</code> <span class="strong"><strong>and</strong></span> <code class="filename">#P"foo.lib"</code>.
 If the latest such file is a <code class="filename">#P".lisp"</code>, it is compiled;
-otherwise the <a class="link" href="require.html" title="24.3. Function REQUIRE"><code class="filename">#P".lib"</code></a> is loaded.</p><p>The <a class="link" href="require.html" title="24.3. Function REQUIRE"><code class="filename">#P".lib"</code></a> is a <span class="quote">“<span class="quote">header</span>”</span> file which contains the
+otherwise the <a class="link" href="require.html#lib-files" title="24.3.2. Interaction with COMPILE-FILE"><code class="filename">#P".lib"</code></a> is loaded.
+If neither is found, <code class="code">(<a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_providecm_require.html" target="_top"><code class="function">REQUIRE</code></a> <code class="filename">#P"foo"</code>)</code> is called.</p><div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title"><a id="module-user-file-name-conflict"></a>Warning</h3><p>It is a <span class="strong"><strong>very</strong></span> bad
+idea to name your files the same way as <a class="ulink" href="http://clisp.cons.org" target="_top"><span class="command"><strong>CLISP</strong></span></a> modules
+(whether <a class="link" href="modules.html#included-modules" title="32.2.9. Modules included in the source distribution">system-supplied</a>
+or <a href="clisp-link.html#opt-install" class="olink">user-installed</a>)
+because then <a href="require.html" class="olink"><code class="function">REQUIRE</code></a> will use different files at compile
+and execution times.</p></div><p>The <a class="link" href="require.html#lib-files" title="24.3.2. Interaction with COMPILE-FILE"><code class="filename">#P".lib"</code></a> is a <span class="quote">“<span class="quote">header</span>”</span> file which contains the
 constant, variable, inline and macro definitions necessary for
 compilation of the files that <a class="ulink" href="http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_providecm_require.html" target="_top"><code class="function">REQUIRE</code></a> this file, but not the function
 definitions and calls that are not necessary for that.
@@ -23,7 +36,7 @@
 bar.fas: bar.lisp foo.fas
 	clisp -c bar
 </pre><p>
-instead of the more cumbersome (and slower, since <a class="link" href="require.html" title="24.3. Function REQUIRE"><code class="filename">#P".lib"</code></a>s are
+instead of the more cumbersome (and slower, since <a class="link" href="require.html#lib-files" title="24.3.2. Interaction with COMPILE-FILE"><code class="filename">#P".lib"</code></a>s are
 usually smaller and load faster that <code class="filename">#P".fas"</code>s):
 </p><pre class="programlisting">
 bar.fas: bar.lisp foo.fas
@@ -34,4 +47,4 @@
 If memory is tight, and if <code class="filename">#P"foo.lisp"</code> contains only a few inline
 functions, macros, constants or variables, this is a space and time
 saver.  If <code class="filename">#P"foo.lisp"</code> does a lot of initializations or side effects
-when being loaded, this is important as well.</p></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.48</td><td align="right">Last modified: 2009-07-28</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=require" /></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="24.3. Function REQUIRE" /><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="compile-file-path.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="system.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="loadfile.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">24.2. Function <code class="function">COMPILE-FILE-PATHNAME</code> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 24.4. Function <code class="function">LOAD</code></td></tr></table></div></body></html>
+when being loaded, this is important as well.</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=require" /></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="24.3. Function REQUIRE" /><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="compile-file-path.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="system.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="loadfile.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">24.2. Function <code class="function">COMPILE-FILE-PATHNAME</code> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 24.4. Function <code class="function">LOAD</code></td></tr></table></div></body></html>