- Timestamp:
- Apr 20, 2008, 5:06:22 AM (17 years ago)
- Location:
- release/1.2/source
- Files:
-
- 3 deleted
- 18 edited
- 8 copied
-
doc/HTML (deleted)
-
doc/INFO (deleted)
-
doc/ccl-documentation.html (modified) (677 diffs)
-
doc/src (modified) (1 prop)
-
doc/src/Makefile.fedora (modified) (3 diffs)
-
doc/src/Makefile.macports (modified) (3 diffs)
-
doc/src/makehtml (modified) (1 diff)
-
doc/src/xsl/footer.xsl (modified) (2 diffs)
-
examples/gtk-step.lisp (deleted)
-
level-1/linux-files.lisp (modified) (1 diff)
-
lib/foreign-types.lisp (modified) (1 diff)
-
tools/asdf-install/COPYRIGHT (modified) (1 diff)
-
tools/asdf-install/RELNOTES (copied) (copied from trunk/source/tools/asdf-install/RELNOTES )
-
tools/asdf-install/asdf-install.asd (modified) (2 diffs)
-
tools/asdf-install/changes.text (copied) (copied from trunk/source/tools/asdf-install/changes.text )
-
tools/asdf-install/conditions.lisp (copied) (copied from trunk/source/tools/asdf-install/conditions.lisp )
-
tools/asdf-install/dead-letter.lisp (copied) (copied from trunk/source/tools/asdf-install/dead-letter.lisp )
-
tools/asdf-install/defpackage.lisp (modified) (1 diff)
-
tools/asdf-install/deprecated.lisp (copied) (copied from trunk/source/tools/asdf-install/deprecated.lisp )
-
tools/asdf-install/digitool.lisp (modified) (1 diff)
-
tools/asdf-install/installer.lisp (modified) (14 diffs)
-
tools/asdf-install/lift-standard.config (copied) (copied from trunk/source/tools/asdf-install/lift-standard.config )
-
tools/asdf-install/load-asdf-install.lisp (modified) (3 diffs)
-
tools/asdf-install/loader.lisp (modified) (1 diff)
-
tools/asdf-install/notes.text (copied) (copied from trunk/source/tools/asdf-install/notes.text )
-
tools/asdf-install/port.lisp (modified) (15 diffs)
-
tools/asdf-install/split-sequence.lisp (modified) (2 diffs)
-
tools/asdf-install/variables.lisp (copied) (copied from trunk/source/tools/asdf-install/variables.lisp )
-
tools/asdf.lisp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
release/1.2/source/doc/ccl-documentation.html
r9200 r9219 5 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 6 <title>Clozure CL Documentation</title> 7 <meta name="generator" content="DocBook XSL Stylesheets V1.7 2.0" />8 <link rel="start" href="#id3 12246" title="Clozure CL Documentation" />9 <link rel="next" href="#id 469589" title="Chapter 1. About Clozure CL" />7 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> 8 <link rel="start" href="#id301106" title="Clozure CL Documentation" /> 9 <link rel="next" href="#id322476" title="Chapter 1. About Clozure CL" /> 10 10 </head> 11 11 <body> … … 14 14 <div> 15 15 <div> 16 <h1 class="title"><a id="id3 12246"></a>Clozure CL Documentation</h1>16 <h1 class="title"><a id="id301106"></a>Clozure CL Documentation</h1> 17 17 </div> 18 18 </div> … … 23 23 <dt> 24 24 <span class="chapter"> 25 <a href="#id 469589">1. About Clozure CL</a>25 <a href="#id322476">1. About Clozure CL</a> 26 26 </span> 27 27 </dt> … … 30 30 <dt> 31 31 <span class="sect1"> 32 <a href="#id 461338">1.1. Introduction to Clozure CL</a>32 <a href="#id378260">1.1. Introduction to Clozure CL</a> 33 33 </span> 34 34 </dt> … … 37 37 <dt> 38 38 <span class="chapter"> 39 <a href="#id 457672">2. Obtaining, Installing, and Running Clozure CL</a>39 <a href="#id335115">2. Obtaining, Installing, and Running Clozure CL</a> 40 40 </span> 41 41 </dt> … … 44 44 <dt> 45 45 <span class="sect1"> 46 <a href="#id 452608">2.1. Releases and System Requirements</a>46 <a href="#id360672">2.1. Releases and System Requirements</a> 47 47 </span> 48 48 </dt> 49 49 <dt> 50 50 <span class="sect1"> 51 <a href="#id 485386">2.2. Obtaining Clozure CL</a>51 <a href="#id364310">2.2. Obtaining Clozure CL</a> 52 52 </span> 53 53 </dt> 54 54 <dt> 55 55 <span class="sect1"> 56 <a href="#id 478754">2.3. Command Line Set Up</a>56 <a href="#id308181">2.3. Command Line Set Up</a> 57 57 </span> 58 58 </dt> … … 81 81 <dt> 82 82 <span class="chapter"> 83 <a href="#id 459555">3. Building Clozure CL from its Source Code</a>83 <a href="#id321732">3. Building Clozure CL from its Source Code</a> 84 84 </span> 85 85 </dt> … … 115 115 <dt> 116 116 <span class="chapter"> 117 <a href="#id 462094">4. Using Clozure CL</a>117 <a href="#id322946">4. Using Clozure CL</a> 118 118 </span> 119 119 </dt> … … 122 122 <dt> 123 123 <span class="sect1"> 124 <a href="#id 482055">4.1. Introduction</a>124 <a href="#id370264">4.1. Introduction</a> 125 125 </span> 126 126 </dt> … … 159 159 <dt> 160 160 <span class="chapter"> 161 <a href="#id 471096">5. The Clozure CL IDE</a>161 <a href="#id351866">5. The Clozure CL IDE</a> 162 162 </span> 163 163 </dt> … … 166 166 <dt> 167 167 <span class="sect1"> 168 <a href="#id 447378">5.1. Introduction</a>168 <a href="#id391992">5.1. Introduction</a> 169 169 </span> 170 170 </dt> 171 171 <dt> 172 172 <span class="sect1"> 173 <a href="#id 461540">5.2. Building the IDE</a>173 <a href="#id388704">5.2. Building the IDE</a> 174 174 </span> 175 175 </dt> 176 176 <dt> 177 177 <span class="sect1"> 178 <a href="#id 460360">5.3. Running the IDE</a>178 <a href="#id352336">5.3. Running the IDE</a> 179 179 </span> 180 180 </dt> 181 181 <dt> 182 182 <span class="sect1"> 183 <a href="#id 443840">5.4. IDE Features</a>183 <a href="#id349170">5.4. IDE Features</a> 184 184 </span> 185 185 </dt> 186 186 <dt> 187 187 <span class="sect1"> 188 <a href="#id 495865">5.5. IDE Sources</a>188 <a href="#id394341">5.5. IDE Sources</a> 189 189 </span> 190 190 </dt> 191 191 <dt> 192 192 <span class="sect1"> 193 <a href="#id 464104">5.6. The Application Builder</a>193 <a href="#id394374">5.6. The Application Builder</a> 194 194 </span> 195 195 </dt> … … 421 421 <dt> 422 422 <span class="sect1"> 423 <a href="#id 523636">12.12. The Foreign-Function-Interface Dictionary</a>423 <a href="#id430545">12.12. The Foreign-Function-Interface Dictionary</a> 424 424 </span> 425 425 </dt> … … 656 656 <div> 657 657 <div> 658 <h2 class="title"><a id="id 469589"></a>Chapter 1. About Clozure CL</h2>658 <h2 class="title"><a id="id322476"></a>Chapter 1. About Clozure CL</h2> 659 659 </div> 660 660 </div> … … 664 664 <dt> 665 665 <span class="sect1"> 666 <a href="#id 461338">1.1. Introduction to Clozure CL</a>666 <a href="#id378260">1.1. Introduction to Clozure CL</a> 667 667 </span> 668 668 </dt> … … 673 673 <div> 674 674 <div> 675 <h2 class="title" style="clear: both"><a id="id 461338"></a>1.1. Introduction to Clozure CL</h2>675 <h2 class="title" style="clear: both"><a id="id378260"></a>1.1. Introduction to Clozure CL</h2> 676 676 </div> 677 677 </div> … … 782 782 <div> 783 783 <div> 784 <h2 class="title"><a id="id 457672"></a>Chapter 2. Obtaining, Installing, and Running Clozure CL</h2>784 <h2 class="title"><a id="id335115"></a>Chapter 2. Obtaining, Installing, and Running Clozure CL</h2> 785 785 </div> 786 786 </div> … … 790 790 <dt> 791 791 <span class="sect1"> 792 <a href="#id 452608">2.1. Releases and System Requirements</a>792 <a href="#id360672">2.1. Releases and System Requirements</a> 793 793 </span> 794 794 </dt> … … 797 797 <dt> 798 798 <span class="sect2"> 799 <a href="#id 483238">2.1.1. LinuxPPC</a>799 <a href="#id369379">2.1.1. LinuxPPC</a> 800 800 </span> 801 801 </dt> 802 802 <dt> 803 803 <span class="sect2"> 804 <a href="#id 485826">2.1.2. Linux X8664</a>804 <a href="#id349897">2.1.2. Linux X8664</a> 805 805 </span> 806 806 </dt> 807 807 <dt> 808 808 <span class="sect2"> 809 <a href="#id 454012">2.1.3. FreeBSD-amd64</a>809 <a href="#id347997">2.1.3. FreeBSD-amd64</a> 810 810 </span> 811 811 </dt> 812 812 <dt> 813 813 <span class="sect2"> 814 <a href="#id 463497">2.1.4. DarwinPPC-MacOS-X</a>814 <a href="#id366253">2.1.4. DarwinPPC-MacOS-X</a> 815 815 </span> 816 816 </dt> 817 817 <dt> 818 818 <span class="sect2"> 819 <a href="#id 463405">2.1.5. Darwinx8664-MacOS-X</a>819 <a href="#id364292">2.1.5. Darwinx8664-MacOS-X</a> 820 820 </span> 821 821 </dt> … … 824 824 <dt> 825 825 <span class="sect1"> 826 <a href="#id 485386">2.2. Obtaining Clozure CL</a>826 <a href="#id364310">2.2. Obtaining Clozure CL</a> 827 827 </span> 828 828 </dt> … … 831 831 <dt> 832 832 <span class="sect2"> 833 <a href="#id 484245">2.2.1. The Mac Way</a>833 <a href="#id364330">2.2.1. The Mac Way</a> 834 834 </span> 835 835 </dt> 836 836 <dt> 837 837 <span class="sect2"> 838 <a href="#id 487280">2.2.2. Getting Clozure CL with Subversion</a>838 <a href="#id397955">2.2.2. Getting Clozure CL with Subversion</a> 839 839 </span> 840 840 </dt> 841 841 <dt> 842 842 <span class="sect2"> 843 <a href="#id 458292">2.2.3. Tarballs</a>843 <a href="#id308156">2.2.3. Tarballs</a> 844 844 </span> 845 845 </dt> … … 848 848 <dt> 849 849 <span class="sect1"> 850 <a href="#id 478754">2.3. Command Line Set Up</a>850 <a href="#id308181">2.3. Command Line Set Up</a> 851 851 </span> 852 852 </dt> … … 894 894 <dt> 895 895 <span class="sect2"> 896 <a href="#id 491137">2.6.3. Installing SLIME</a>896 <a href="#id371816">2.6.3. Installing SLIME</a> 897 897 </span> 898 898 </dt> … … 930 930 <div> 931 931 <div> 932 <h2 class="title" style="clear: both"><a id="id 452608"></a>2.1. Releases and System Requirements</h2>932 <h2 class="title" style="clear: both"><a id="id360672"></a>2.1. Releases and System Requirements</h2> 933 933 </div> 934 934 </div> … … 977 977 <div> 978 978 <div> 979 <h3 class="title"><a id="id 483238"></a>2.1.1. LinuxPPC</h3>979 <h3 class="title"><a id="id369379"></a>2.1.1. LinuxPPC</h3> 980 980 </div> 981 981 </div> … … 989 989 <div> 990 990 <div> 991 <h3 class="title"><a id="id 485826"></a>2.1.2. Linux X8664</h3>991 <h3 class="title"><a id="id349897"></a>2.1.2. Linux X8664</h3> 992 992 </div> 993 993 </div> … … 1015 1015 <div> 1016 1016 <div> 1017 <h3 class="title"><a id="id 454012"></a>2.1.3. FreeBSD-amd64</h3>1017 <h3 class="title"><a id="id347997"></a>2.1.3. FreeBSD-amd64</h3> 1018 1018 </div> 1019 1019 </div> … … 1030 1030 <div> 1031 1031 <div> 1032 <h3 class="title"><a id="id 463497"></a>2.1.4. DarwinPPC-MacOS-X</h3>1032 <h3 class="title"><a id="id366253"></a>2.1.4. DarwinPPC-MacOS-X</h3> 1033 1033 </div> 1034 1034 </div> … … 1050 1050 <div> 1051 1051 <div> 1052 <h3 class="title"><a id="id 463405"></a>2.1.5. Darwinx8664-MacOS-X</h3>1052 <h3 class="title"><a id="id364292"></a>2.1.5. Darwinx8664-MacOS-X</h3> 1053 1053 </div> 1054 1054 </div> … … 1069 1069 <div> 1070 1070 <div> 1071 <h2 class="title" style="clear: both"><a id="id 485386"></a>2.2. Obtaining Clozure CL</h2>1071 <h2 class="title" style="clear: both"><a id="id364310"></a>2.2. Obtaining Clozure CL</h2> 1072 1072 </div> 1073 1073 </div> … … 1092 1092 <div> 1093 1093 <div> 1094 <h3 class="title"><a id="id 484245"></a>2.2.1. The Mac Way</h3>1094 <h3 class="title"><a id="id364330"></a>2.2.1. The Mac Way</h3> 1095 1095 </div> 1096 1096 </div> … … 1101 1101 After that you can double-click the Clozure CL application to 1102 1102 run it. The disk images are available at 1103 <a href="ftp://clozure.com/pub/testing/" target="_top">ftp://clozure.com/pub/testing/</a> </p>1103 <a class="ulink" href="ftp://clozure.com/pub/testing/" target="_top">ftp://clozure.com/pub/testing/</a> </p> 1104 1104 <p xmlns="http://www.w3.org/1999/xhtml">So that Clozure CL can locate its source code, and for other 1105 1105 reasons explained in 1106 <a href="#Predefined-Logical-Hosts" title="4.4.2. Predefined Logical Hosts">Section 4.4.2, âPredefined Logical Hostsâ</a>, you should either put the1106 <a class="xref" href="#Predefined-Logical-Hosts" title="4.4.2. Predefined Logical Hosts">Section 4.4.2, âPredefined Logical Hostsâ</a>, you should either put the 1107 1107 <code class="literal">ccl</code> directory in the same directory as the 1108 1108 Clozure CL application, or else put the Clozure CL application … … 1120 1120 <div> 1121 1121 <div> 1122 <h3 class="title"><a id="id 487280"></a>2.2.2. Getting Clozure CL with Subversion</h3>1122 <h3 class="title"><a id="id397955"></a>2.2.2. Getting Clozure CL with Subversion</h3> 1123 1123 </div> 1124 1124 </div> … … 1220 1220 to install it on your OS. You can find information about 1221 1221 obtaining and installing Subversion at 1222 the <a href="http://subversion.tigris.org/project_packages.html" target="_top">Subversion1222 the <a class="ulink" href="http://subversion.tigris.org/project_packages.html" target="_top">Subversion 1223 1223 Packages page</a>.</p> 1224 1224 </div> … … 1228 1228 <div> 1229 1229 <div> 1230 <h3 class="title"><a id="id 458292"></a>2.2.3. Tarballs</h3>1230 <h3 class="title"><a id="id308156"></a>2.2.3. Tarballs</h3> 1231 1231 </div> 1232 1232 </div> 1233 1233 </div> 1234 <p xmlns="http://www.w3.org/1999/xhtml">Tarballs are available at <a href="ftp://clozure.com/pub/testing/" target="_top">ftp://clozure.com/pub/testing/</a>. Download and extract1234 <p xmlns="http://www.w3.org/1999/xhtml">Tarballs are available at <a class="ulink" href="ftp://clozure.com/pub/testing/" target="_top">ftp://clozure.com/pub/testing/</a>. Download and extract 1235 1235 one on your local disk. Then edit the Clozure CL shell script to set 1236 1236 the value of <em class="varname">CCL_DEFAULT_DIRECTORY</em> and start 1237 up the appropriate Clozure CL kernel. See <a href="#The-ccl-Shell-Script" title="2.3.1. The ccl Shell Script">Section 2.3.1, âThe ccl Shell Scriptâ</a> for more information about the1237 up the appropriate Clozure CL kernel. See <a class="xref" href="#The-ccl-Shell-Script" title="2.3.1. The ccl Shell Script">Section 2.3.1, âThe ccl Shell Scriptâ</a> for more information about the 1238 1238 Clozure CL shell scripts.</p> 1239 1239 </div> … … 1243 1243 <div> 1244 1244 <div> 1245 <h2 class="title" style="clear: both"><a id="id 478754"></a>2.3. Command Line Set Up</h2>1245 <h2 class="title" style="clear: both"><a id="id308181"></a>2.3. Command Line Set Up</h2> 1246 1246 </div> 1247 1247 </div> … … 1262 1262 such as <code class="literal">require</code> and 1263 1263 <code class="literal">provide</code>, access to foreign interface 1264 information (see <a href="#The-Interface-Database" title="12.4. The Interface Database">The1264 information (see <a class="link" href="#The-Interface-Database" title="12.4. The Interface Database">The 1265 1265 Interface Database</a>) and the Lisp build process (see 1266 <a href="#Building-CCL">Building Clozure CL from its Source1266 <a class="link" href="#Building-CCL">Building Clozure CL from its Source 1267 1267 Code</a>). Specifically, it needs to set up logical 1268 1268 pathname translations for the <code class="literal">"ccl:"</code> … … 1358 1358 </pre> 1359 1359 <p xmlns="http://www.w3.org/1999/xhtml">The ccl shell script passes all of its arguments to the 1360 Clozure CL kernel. See <a href="#Invocation" title="2.3.2. Invocation">Section 2.3.2, âInvocationâ</a> for more1360 Clozure CL kernel. See <a class="xref" href="#Invocation" title="2.3.2. Invocation">Section 2.3.2, âInvocationâ</a> for more 1361 1361 information about these arguments. When invoked this way, the 1362 1362 Lisp should be able to initialize the <code class="literal">"ccl:"</code> … … 1447 1447 Clozure CL then exits. This is the same thing that is 1448 1448 returned by 1449 <span ><strong class="function">LISP-APPLICATION-VERSION</strong></span>.</p>1449 <span class="function"><strong>LISP-APPLICATION-VERSION</strong></span>.</p> 1450 1450 </li> 1451 1451 <li> … … 1455 1455 <em class="parameter"><code>character-encoding-name</code></em>). 1456 1456 Specifies the character encoding to use for 1457 <em class="varname">*TERMINAL-IO*</em> (see <a href="#Character-Encodings" title="4.3.4. Character Encodings">Section 4.3.4, âCharacter Encodingsâ</a>). Specifically, the1457 <em class="varname">*TERMINAL-IO*</em> (see <a class="xref" href="#Character-Encodings" title="4.3.4. Character Encodings">Section 4.3.4, âCharacter Encodingsâ</a>). Specifically, the 1458 1458 <em class="parameter"><code>character-encoding-name</code></em> string 1459 1459 is uppercased and interned in the KEYWORD package. If an … … 1483 1483 <p><code class="literal">-e</code> <em class="parameter"><code>form</code></em> 1484 1484 (or <code class="literal">--eval</code>). An expression is read (via 1485 <span ><strong class="function">READ-FROM-STRING</strong></span>) from the string1485 <span class="function"><strong>READ-FROM-STRING</strong></span>) from the string 1486 1486 <em class="parameter"><code>form</code></em> and evaluated. If 1487 1487 <em class="parameter"><code>form</code></em> contains shell metacharacters, … … 1499 1499 <code class="literal">--set-lisp-heap-gc-threshold</code> 1500 1500 <em class="parameter"><code>n</code></em>). Sets the Lisp gc threshold to 1501 <em class="parameter"><code>n</code></em>. (see <a href="#GC-Page-reclamation-policy" title="15.3. GC Page reclamation policy">Section 15.3, âGC Page reclamation policyâ</a></p>1501 <em class="parameter"><code>n</code></em>. (see <a class="xref" href="#GC-Page-reclamation-policy" title="15.3. GC Page reclamation policy">Section 15.3, âGC Page reclamation policyâ</a></p> 1502 1502 </li> 1503 1503 <li> … … 1511 1511 <code class="literal">--heap-reserve</code>). Reserves 1512 1512 <em class="parameter"><code>n</code></em> bytes for heap expansion. The 1513 default is <code class="literal"> 549755813888</code>. (see <a href="#Heap-space-allocation" title="15.1. Heap space allocation">Section 15.1, âHeap space allocationâ</a>)</p>1513 default is <code class="literal"> 549755813888</code>. (see <a class="xref" href="#Heap-space-allocation" title="15.1. Heap space allocation">Section 15.1, âHeap space allocationâ</a>)</p> 1514 1514 </li> 1515 1515 <li> 1516 1516 <p><code class="literal">-S</code> <em class="parameter"><code>n</code></em> (or 1517 1517 <code class="literal">--stack-size</code> <em class="parameter"><code>n</code></em>). Sets the size of the 1518 initial control stack to <em class="parameter"><code>n</code></em>. (see <a href="#Thread-Stack-Sizes" title="7.3.1. Thread Stack Sizes">Section 7.3.1, âThread Stack Sizesâ</a>)</p>1518 initial control stack to <em class="parameter"><code>n</code></em>. (see <a class="xref" href="#Thread-Stack-Sizes" title="7.3.1. Thread Stack Sizes">Section 7.3.1, âThread Stack Sizesâ</a>)</p> 1519 1519 </li> 1520 1520 <li> … … 1522 1522 <code class="literal">--thread-stack-size</code> 1523 1523 <em class="parameter"><code>n</code></em>). Sets the size of the first 1524 thread's stack to <em class="parameter"><code>n</code></em>. (see <a href="#Thread-Stack-Sizes" title="7.3.1. Thread Stack Sizes">Section 7.3.1, âThread Stack Sizesâ</a>)</p>1524 thread's stack to <em class="parameter"><code>n</code></em>. (see <a class="xref" href="#Thread-Stack-Sizes" title="7.3.1. Thread Stack Sizes">Section 7.3.1, âThread Stack Sizesâ</a>)</p> 1525 1525 </li> 1526 1526 <li> … … 1593 1593 </div> 1594 1594 <p xmlns="http://www.w3.org/1999/xhtml">For complete information about SLIME, see the 1595 SLIME <a href="http://common-lisp.net/project/slime/" target="_top">home1595 SLIME <a class="ulink" href="http://common-lisp.net/project/slime/" target="_top">home 1596 1596 page</a>. The SLIME home page provides up-to-date downloads, 1597 1597 plus documentation, tutorials, and instructional … … 1677 1677 <div> 1678 1678 <div> 1679 <h3 class="title"><a id="id 491137"></a>2.6.3. Installing SLIME</h3>1679 <h3 class="title"><a id="id371816"></a>2.6.3. Installing SLIME</h3> 1680 1680 </div> 1681 1681 </div> … … 1793 1793 mailing lists. You can find information about the mailing 1794 1794 lists on the 1795 Clozure CL <a href="http://trac.clozure.com/openmcl" target="_top">wiki</a>.</p>1795 Clozure CL <a class="ulink" href="http://trac.clozure.com/openmcl" target="_top">wiki</a>.</p> 1796 1796 </div> 1797 1797 </div> … … 1830 1830 <div> 1831 1831 <div> 1832 <h2 class="title"><a id="id 459555"></a>Chapter 3. Building Clozure CL from its Source Code</h2>1832 <h2 class="title"><a id="id321732"></a>Chapter 3. Building Clozure CL from its Source Code</h2> 1833 1833 </div> 1834 1834 </div> … … 1941 1941 <p xmlns="http://www.w3.org/1999/xhtml">The following terms are used in subsequent sections; it 1942 1942 may be helpful to refer to these definitions.</p> 1943 <p xmlns="http://www.w3.org/1999/xhtml"><a id="id 452942" class="indexterm"></a><ahref="#fasl-file"><em class="glossterm">fasl1944 files</em></a> are the object files produced1943 <p xmlns="http://www.w3.org/1999/xhtml"><a id="id352854" class="indexterm"></a><a class="glossterm" href="#fasl-file"><em class="glossterm">fasl 1944 files</em></a> are the object files produced 1945 1945 by <code class="literal">compile-file</code>. fasl files store the 1946 1946 machine code associated with function definitions and the … … 1951 1951 types (extensions) to name fasl files on different platforms; 1952 1952 see 1953 <a href="#Platform-specific-filename-conventions" title="Table 3.1. Platform-specific filename conventions">Table 3.1, âPlatform-specific filename conventionsâ</a> </p>1954 <p xmlns="http://www.w3.org/1999/xhtml">The <a id="id 483934" class="indexterm"></a> <ahref="#lisp_kernel"><em class="glossterm">Lisp1955 kernel</em></a> is a C program with a fair amount of1953 <a class="xref" href="#Platform-specific-filename-conventions" title="Table 3.1. Platform-specific filename conventions">Table 3.1, âPlatform-specific filename conventionsâ</a> </p> 1954 <p xmlns="http://www.w3.org/1999/xhtml">The <a id="id361301" class="indexterm"></a> <a class="glossterm" href="#lisp_kernel"><em class="glossterm">Lisp 1955 kernel</em></a> is a C program with a fair amount of 1956 1956 platform-specific assembly language code. Its basic job is to 1957 1957 map a lisp heap image into memory, transfer control to some … … 1961 1961 code. Clozure CL uses different filenames to name the lisp kernel 1962 1962 files on different platforms; see 1963 <a href="#Platform-specific-filename-conventions" title="Table 3.1. Platform-specific filename conventions">Table 3.1, âPlatform-specific filename conventionsâ</a>.</p>1964 <p xmlns="http://www.w3.org/1999/xhtml">A <a id="id 476697" class="indexterm"></a> <ahref="#lisp_image"><em class="glossterm">heap1965 image</em></a> is a file that can be quickly mapped into a1963 <a class="xref" href="#Platform-specific-filename-conventions" title="Table 3.1. Platform-specific filename conventions">Table 3.1, âPlatform-specific filename conventionsâ</a>.</p> 1964 <p xmlns="http://www.w3.org/1999/xhtml">A <a id="id374738" class="indexterm"></a> <a class="glossterm" href="#lisp_image"><em class="glossterm">heap 1965 image</em></a> is a file that can be quickly mapped into a 1966 1966 process' address space. Conceptually, it's not too different 1967 1967 from an executable file or shared library in the OS's native … … 1972 1972 comprise Clozure CL. Clozure CL uses different filenames to name the 1973 1973 standard full heap image files on different platforms; see 1974 <a href="#Platform-specific-filename-conventions" title="Table 3.1. Platform-specific filename conventions">Table 3.1, âPlatform-specific filename conventionsâ</a>.</p>1975 <p xmlns="http://www.w3.org/1999/xhtml">A <a id="id 464058" class="indexterm"></a> bootstrapping image is a minimal1974 <a class="xref" href="#Platform-specific-filename-conventions" title="Table 3.1. Platform-specific filename conventions">Table 3.1, âPlatform-specific filename conventionsâ</a>.</p> 1975 <p xmlns="http://www.w3.org/1999/xhtml">A <a id="id366185" class="indexterm"></a> bootstrapping image is a minimal 1976 1976 heap image used in the process of building Clozure CL itself. The 1977 1977 bootstrapping image contains just enough code to load the rest … … 1980 1980 chicken. Clozure CL uses different filenames to name the standard 1981 1981 bootstrapping image files on different platforms; see 1982 <a href="#Platform-specific-filename-conventions" title="Table 3.1. Platform-specific filename conventions">Table 3.1, âPlatform-specific filename conventionsâ</a>1982 <a class="xref" href="#Platform-specific-filename-conventions" title="Table 3.1. Platform-specific filename conventions">Table 3.1, âPlatform-specific filename conventionsâ</a> 1983 1983 .</p> 1984 1984 <p xmlns="http://www.w3.org/1999/xhtml">Each supported platform (and possibly a few 1985 1985 as-yet-unsupported ones) has a uniquely named subdirectory of 1986 1986 <code class="literal">ccl/lisp-kernel/</code>; each such 1987 <a id="id 474934" class="indexterm"></a>1987 <a id="id366211" class="indexterm"></a> 1988 1988 contains a Makefile and may contain some auxiliary files (linker 1989 1989 scripts, etc.) that are used to build the lisp kernel on a 1990 1990 particular platform.The platform-specific name of the kernel 1991 1991 build directory is described in 1992 <a href="#Platform-specific-filename-conventions" title="Table 3.1. Platform-specific filename conventions">Table 3.1, âPlatform-specific filename conventionsâ</a>.</p>1992 <a class="xref" href="#Platform-specific-filename-conventions" title="Table 3.1. Platform-specific filename conventions">Table 3.1, âPlatform-specific filename conventionsâ</a>.</p> 1993 1993 <div class="sect2" lang="en" xml:lang="en"> 1994 1994 <div xmlns="http://www.w3.org/1999/xhtml" class="titlepage"> … … 2106 2106 <li> 2107 2107 <p>Version 1.1 - the more recent version, which 2108 runs on more platforms (including x86-64 platforms) and2109 supports Unicode</p>2108 runs on more platforms (including x86-64 platforms) and 2109 supports Unicode</p> 2110 2110 </li> 2111 2111 <li> 2112 2112 <p>Version 1.2 - supports (at least) all of the 2113 features and platforms as 1.1, but is distributed and updated2114 differently</p>2113 features and platforms as 1.1, but is distributed and updated 2114 differently</p> 2115 2115 </li> 2116 2116 </ul> … … 2147 2147 $ cd ccl 2148 2148 $ cvs login # password is "cvs" 2149 # this step only needs to be done once,2150 # that'll store the trivially encrypted2151 # password in ~/.cvspas2149 # this step only needs to be done once, 2150 # that'll store the trivially encrypted 2151 # password in ~/.cvspas 2152 2152 $ cvs update 2153 </pre>2153 </pre> 2154 2154 <p xmlns="http://www.w3.org/1999/xhtml">Unless you tell it to, cvs won't delete ("prune") empty 2155 2155 directories or create new ones when the repository changes. … … 2157 2157 <pre xmlns="http://www.w3.org/1999/xhtml" class="programlisting"> 2158 2158 $ cvs update -d -P # create dirs as needed, prune empty ones 2159 </pre>2159 </pre> 2160 2160 <p xmlns="http://www.w3.org/1999/xhtml">Version 1.2 archives follow naming conventions that are 2161 2161 similar to those used by 1.0 (though more platforms are supported.) … … 2165 2165 <p xmlns="http://www.w3.org/1999/xhtml">Subversion client programs are pre-installed on OSX 10.5 and 2166 2166 later and are typically either pre-installed or readily available 2167 on Linux and FreeBSD platforms. The <a href="http://subversion.tigris.org" target="_top">Subversion web page</a> contains links to subversion client programs2167 on Linux and FreeBSD platforms. The <a class="ulink" href="http://subversion.tigris.org" target="_top">Subversion web page</a> contains links to subversion client programs 2168 2168 for many platforms; users of OSX versions 10.4 and earlier can also 2169 2169 install Subversion clients via Fink or MacPorts.</p> … … 2182 2182 <pre xmlns="http://www.w3.org/1999/xhtml" class="programlisting"> 2183 2183 ? (ccl:rebuild-ccl :full t) 2184 </pre>2184 </pre> 2185 2185 <p xmlns="http://www.w3.org/1999/xhtml">That call to the function <code class="literal">rebuild-ccl</code> 2186 will performthe following steps:</p>2186 performs the following steps:</p> 2187 2187 <div xmlns="http://www.w3.org/1999/xhtml" class="itemizedlist"> 2188 2188 <ul type="disc"> 2189 2189 <li> 2190 2190 <p>Deletes all fasl files and other object files in the 2191 <code class="literal">ccl</code>directory tree</p>2191 <code class="literal">ccl</code> directory tree</p> 2192 2192 </li> 2193 2193 <li> 2194 <p>Runs an external process whichdoes a2195 <code class="literal">make</code> in the currentplatform's kernel2196 build directory to create a new kernel</p>2194 <p>Runs an external process that does a 2195 <code class="literal">make</code> in the current platform's kernel 2196 build directory to create a new kernel</p> 2197 2197 </li> 2198 2198 <li> 2199 2199 <p>Does <code class="literal">(compile-ccl t)</code> in the running 2200 lisp, to produce aset of fasl files from the âhigher2201 levelâ lisp sources.</p>2200 lisp, to produce a set of fasl files from the âhigher 2201 levelâ lisp sources.</p> 2202 2202 </li> 2203 2203 <li> 2204 2204 <p>Does <code class="literal">(xload-level-0 :force)</code> in the 2205 running lisp, to compile thelisp sources in the2206 âccl:level-0;â directory into fasl files and2207 then createa bootstrapping image from those fasl2208 files.</p>2205 running lisp, to compile the lisp sources in the 2206 âccl:level-0;â directory into fasl files and 2207 then create a bootstrapping image from those fasl 2208 files.</p> 2209 2209 </li> 2210 2210 <li> 2211 2211 <p>Runs another external process, which causes the newly 2212 compiled lispkernel to load the new bootstrapping image.2213 The bootsrtrapping image then loadsthe âhigher2214 levelâ fasl files and a new copy of the platform's2215 full heap imageis then saved.</p>2212 compiled lisp kernel to load the new bootstrapping image. 2213 The bootsrtrapping image then loads the âhigher 2214 levelâ fasl files and a new copy of the platform's 2215 full heap image is then saved.</p> 2216 2216 </li> 2217 2217 </ul> … … 2235 2235 </div> 2236 2236 </div> 2237 <p xmlns="http://www.w3.org/1999/xhtml">The Lisp kernel is the executable whichyou run to use2237 <p xmlns="http://www.w3.org/1999/xhtml">The Lisp kernel is the executable that you run to use 2238 2238 Lisp. It doesn't actually contain the entire Lisp 2239 2239 implementation; rather, it loads a heap image which contains the 2240 specifics -the "library", as it might be called if this was a C2240 specificsâthe "library", as it might be called if this was a C 2241 2241 program. The kernel also provides runtime support to the heap 2242 2242 image, such as garbage collection, memory allocation, exception 2243 2243 handling, and the OS interface.</p> 2244 2244 <p xmlns="http://www.w3.org/1999/xhtml">The Lisp kernel file has different names on different 2245 platforms. See FIXTHIS . On all platforms the lisp kernel sources reside 2245 platforms. See 2246 <a class="xref" href="#Platform-specific-filename-conventions" title="Table 3.1. Platform-specific filename conventions">Table 3.1, âPlatform-specific filename conventionsâ</a>. On all 2247 platforms the lisp kernel sources reside 2246 2248 in <code class="literal">ccl/lisp-kernel</code>.</p> 2247 2249 <p xmlns="http://www.w3.org/1999/xhtml">This section gives directions on how to rebuild the Lisp … … 2256 2258 </pre> 2257 2259 <p xmlns="http://www.w3.org/1999/xhtml"> 2258 </p>2260 </p> 2259 2261 <div class="sect2" lang="en" xml:lang="en"> 2260 2262 <div xmlns="http://www.w3.org/1999/xhtml" class="titlepage"> … … 2266 2268 </div> 2267 2269 <p xmlns="http://www.w3.org/1999/xhtml">The Clozure CL kernel can be bult with the following widely 2268 available tools:</p>2270 available tools:</p> 2269 2271 <div xmlns="http://www.w3.org/1999/xhtml" class="itemizedlist"> 2270 2272 <ul type="disc"> … … 2287 2289 </div> 2288 2290 <p xmlns="http://www.w3.org/1999/xhtml"> In general, the more recent the versions of those 2289 tools, the better; some versions of gcc 3.x on Linux have2290 difficulty compiling some of the kernel source code correctly2291 (so gcc 4.0 should be used, if possible.) On OSX, the2292 versions of the tools distributed with XCode should work fine;2293 on Linux, the versions of the tools installed with the OS (or2294 available through its package management system) should work2295 fine if they're "recent enough". On FreeBSD, the installed2296 version of the <code class="literal">m4</code> program doesn't support2297 some features that the kernel build process depends on; the2298 GNU version of the m4 macroprocessor (called2299 <code class="literal">gm4</code> on FreeBSD) should be installed2291 tools, the better; some versions of gcc 3.x on Linux have 2292 difficulty compiling some of the kernel source code correctly 2293 (so gcc 4.0 should be used, if possible.) On OSX, the 2294 versions of the tools distributed with XCode should work fine; 2295 on Linux, the versions of the tools installed with the OS (or 2296 available through its package management system) should work 2297 fine if they're "recent enough". On FreeBSD, the installed 2298 version of the <code class="literal">m4</code> program doesn't support 2299 some features that the kernel build process depends on; the 2300 GNU version of the m4 macroprocessor (called 2301 <code class="literal">gm4</code> on FreeBSD) should be installed. 2300 2302 2301 </p>2303 </p> 2302 2304 </div> 2303 2305 <div class="sect2" lang="en" xml:lang="en"> … … 2314 2316 shell> cd ccl/lisp-kernel/<em class="replaceable"><code>PLATFORM</code></em> 2315 2317 shell> make 2316 </pre>2318 </pre> 2317 2319 <p xmlns="http://www.w3.org/1999/xhtml"> 2318 </p>2320 </p> 2319 2321 <p xmlns="http://www.w3.org/1999/xhtml">That'll assemble several assembly language source files, 2320 2322 compile several C source files, and link 2321 2323 ../../<em class="replaceable"><code>the kernel</code></em>. 2322 </p>2324 </p> 2323 2325 </div> 2324 2326 </div> … … 2332 2334 </div> 2333 2335 <p xmlns="http://www.w3.org/1999/xhtml">The initial heap image is loaded by the Lisp kernel, and 2334 provides most allof the language implementation The heap image2336 provides most of the language implementation The heap image 2335 2337 captures the entire state of a running Lisp (except for external 2336 2338 resources, such as open files and TCP sockets). After it is … … 2347 2349 build a new heap image.</p> 2348 2350 <p xmlns="http://www.w3.org/1999/xhtml">(You might also wish to build a heap image if you have a 2349 large program which it is very complicated or time-consuming to2351 large program that is very complicated or time-consuming to 2350 2352 load, so that you will be able to load it once, save an image, 2351 2353 and thenceforth never have to load it again. At any time, a heap … … 2367 2369 <li> 2368 2370 <p>Using your existing Clozure CL, create a 2369 bootstrapping image</p>2371 bootstrapping image</p> 2370 2372 </li> 2371 2373 <li> 2372 2374 <p>Using your existing Clozure CL, recompile your 2373 updated Clozure CL sources</p>2375 updated Clozure CL sources</p> 2374 2376 </li> 2375 2377 <li> 2376 2378 <p>Invoke Clozure CL with the bootstrapping image 2377 you just created (rather than with the existing full heap2378 image).</p>2379 you just created (rather than with the existing full heap 2380 image).</p> 2379 2381 </li> 2380 2382 </ol> 2381 2383 </div> 2382 2384 <p xmlns="http://www.w3.org/1999/xhtml">When you invoke Clozure CL with the bootstrapping image, it 2383 will start up, load al of the Clozure CL fasl files, and save out2384 anew full heap image. Voila. You've created a new heap2385 image.</p>2385 starts up, loads all of the Clozure CL fasl files, and saves out a 2386 new full heap image. Voila. You've created a new heap 2387 image.</p> 2386 2388 <p xmlns="http://www.w3.org/1999/xhtml">A few points worth noting:</p> 2387 2389 <div xmlns="http://www.w3.org/1999/xhtml" class="itemizedlist"> … … 2389 2391 <li> 2390 2392 <p>There's a circular dependency between the full heap 2391 image and thebootstrapping image, in that each is used to2392 build the other.</p>2393 image and the bootstrapping image, in that each is used to 2394 build the other.</p> 2393 2395 </li> 2394 2396 <li> 2395 2397 <p>There are some minor implementation 2396 differences, but the environment in effect after the2397 bootstrapping image has loaded its fasl files is essentially2398 equivalent to the environment provided by the full heap2399 image; the latter loads a lot faster and is easier to2400 distribute, of course.</p>2398 differences, but the environment in effect after the 2399 bootstrapping image has loaded its fasl files is essentially 2400 equivalent to the environment provided by the full heap 2401 image; the latter loads a lot faster and is easier to 2402 distribute, of course.</p> 2401 2403 </li> 2402 2404 <li> 2403 2405 <p>If the full heap image doesn't work (because 2404 of an OScompatibilty problem or other bug), it's very likely2405 that thebootstrapping image will suffer the same2406 problems.</p>2406 of an OS compatibilty problem or other bug), it's very likely 2407 that the bootstrapping image will suffer the same 2408 problems.</p> 2407 2409 </li> 2408 2410 </ul> … … 2434 2436 <code class="literal">save-application</code>. This process is called 2435 2437 "cross-dumping".</p> 2436 <p xmlns="http://www.w3.org/1999/xhtml">Given a source distribution, a lisp kernel, and a heap2437 image, one can produce a bootst apping image by first invoking2438 <p xmlns="http://www.w3.org/1999/xhtml">Given a source distribution, a lisp kernel, and a heap 2439 image, one can produce a bootstrapping image by first invoking 2438 2440 Clozure CL from the shell:</p> 2439 2441 <pre xmlns="http://www.w3.org/1999/xhtml" class="programlisting"> … … 2441 2443 Welcome to Clozure CL .... ! 2442 2444 ? 2443 </pre>2445 </pre> 2444 2446 <p xmlns="http://www.w3.org/1999/xhtml">then calling <code class="literal">ccl:xload-level-0</code> at the 2445 lisp prompt</p>2447 lisp prompt</p> 2446 2448 <pre xmlns="http://www.w3.org/1999/xhtml" class="programlisting"> 2447 2449 ? (ccl:xload-level-0) 2448 </pre>2449 <p xmlns="http://www.w3.org/1999/xhtml">This will compilethe lisp sources in the ccl/level-02450 </pre> 2451 <p xmlns="http://www.w3.org/1999/xhtml">This function compiles the lisp sources in the ccl/level-0 2450 2452 directory if they're newer than the corresponding fasl files 2451 and will then load the resulting fasl files into a simulated2452 lisp heap contained insidedata structures inside the running2453 and then loads the resulting fasl files into a simulated lisp 2454 heap contained in data structures inside the running 2453 2455 lisp. That simulated heap image is then written to 2454 2456 disk.</p> … … 2459 2461 <pre xmlns="http://www.w3.org/1999/xhtml" class="programlisting"> 2460 2462 ? (ccl:xload-level-0 :force) 2461 </pre>2462 <p xmlns="http://www.w3.org/1999/xhtml"> will forcerecompilation of the level-0 sources.</p>2463 </pre> 2464 <p xmlns="http://www.w3.org/1999/xhtml">forces recompilation of the level-0 sources.</p> 2463 2465 </div> 2464 2466 <div class="sect2" lang="en" xml:lang="en"> … … 2473 2475 <pre xmlns="http://www.w3.org/1999/xhtml" class="programlisting"> 2474 2476 ? (ccl:compile-ccl) 2475 </pre>2476 <p xmlns="http://www.w3.org/1999/xhtml">at the lisp prompt will compileany fasl files that are2477 out-of-date with respect to the corresponding lisp sources;2478 <code class="literal">(ccl:compile-ccl t)</code> will force2479 recompilation. <code class="literal">ccl:compile-ccl</code> will reload2480 newly-compiled versions of some files;2481 <code class="literal">ccl:xcompile-ccl</code> is analogous, but skips2482 this reloading step.</p>2483 <p xmlns="http://www.w3.org/1999/xhtml">Unless there are bootstrapping considerations involved, 2484 it usually doesn't matter whether these filesreloaded after2477 </pre> 2478 <p xmlns="http://www.w3.org/1999/xhtml">at the lisp prompt compiles any fasl files that are 2479 out-of-date with respect to the corresponding lisp sources; 2480 <code class="literal">(ccl:compile-ccl t)</code> forces 2481 recompilation. <code class="literal">ccl:compile-ccl</code> reloads 2482 newly-compiled versions of some files; 2483 <code class="literal">ccl:xcompile-ccl</code> is analogous, but skips 2484 this reloading step.</p> 2485 <p xmlns="http://www.w3.org/1999/xhtml">Unless there are bootstrapping considerations involved, it 2486 usually doesn't matter whether these files are reloaded after 2485 2487 they're recompiled.</p> 2486 2488 <p xmlns="http://www.w3.org/1999/xhtml">Calling <code class="literal">compile-ccl</code> or … … 2504 2506 </div> 2505 2507 <p xmlns="http://www.w3.org/1999/xhtml">To build a full image from a bootstrapping image, just 2506 invoke the kernel with the bootstrapping image is an2507 argument</p>2508 invoke the kernel with the bootstrapping image as an 2509 argument</p> 2508 2510 <pre xmlns="http://www.w3.org/1999/xhtml" class="programlisting"> 2509 2511 $ cd ccl # wherever your ccl directory is 2510 2512 $ ./KERNEL BOOT_IMAGE 2511 </pre>2513 </pre> 2512 2514 <p xmlns="http://www.w3.org/1999/xhtml">Where <em class="replaceable"><code>KERNEL</code></em> and 2513 2515 <em class="replaceable"><code>BOOT_IMAGE</code></em> are the names of 2514 2516 the kernel and boot image appropriate to the platform you are 2515 running on. See FIXTHIS</p>2517 running on. See <a class="xref" href="#Platform-specific-filename-conventions" title="Table 3.1. Platform-specific filename conventions">Table 3.1, âPlatform-specific filename conventionsâ</a></p> 2516 2518 <p xmlns="http://www.w3.org/1999/xhtml">That should load a few dozen fasl files (printing a 2517 2519 message as each file is loaded.) If all of these files … … 2523 2525 <pre xmlns="http://www.w3.org/1999/xhtml" class="programlisting"> 2524 2526 ? (ccl:save-application "<em class="replaceable"><code>image_name</code></em>") ; Overwiting the existing heap image 2525 </pre> 2526 <p xmlns="http://www.w3.org/1999/xhtml">Where <em class="replaceable"><code>image_name</code></em> is the name 2527 of the full heap image for your platform. See FIXTHIS.</p> 2527 </pre> 2528 <p xmlns="http://www.w3.org/1999/xhtml">Where <em class="replaceable"><code>image_name</code></em> is the name of 2529 the full heap image for your platform. See 2530 <a class="xref" href="#Platform-specific-filename-conventions" title="Table 3.1. Platform-specific filename conventions">Table 3.1, âPlatform-specific filename conventionsâ</a>.</p> 2528 2531 <p xmlns="http://www.w3.org/1999/xhtml">If things go wrong in the early stages of the loading 2529 2532 sequence, errors are often difficult to debug; until a fair … … 2541 2544 <div> 2542 2545 <div> 2543 <h2 class="title"><a id="id 462094"></a>Chapter 4. Using Clozure CL</h2>2546 <h2 class="title"><a id="id322946"></a>Chapter 4. Using Clozure CL</h2> 2544 2547 </div> 2545 2548 </div> … … 2549 2552 <dt> 2550 2553 <span class="sect1"> 2551 <a href="#id 482055">4.1. Introduction</a>2554 <a href="#id370264">4.1. Introduction</a> 2552 2555 </span> 2553 2556 </dt> … … 2566 2569 <dt> 2567 2570 <span class="sect2"> 2568 <a href="#id 496233">4.3.1. Characters</a>2571 <a href="#id388381">4.3.1. Characters</a> 2569 2572 </span> 2570 2573 </dt> … … 2595 2598 <dt> 2596 2599 <span class="sect2"> 2597 <a href="#id 497617">4.4.1. Pathname Expansion</a>2600 <a href="#id383711">4.4.1. Pathname Expansion</a> 2598 2601 </span> 2599 2602 </dt> … … 2605 2608 <dt> 2606 2609 <span class="sect2"> 2607 <a href="#id 497696">4.4.3. OS X (Darwin)</a>2610 <a href="#id383814">4.4.3. OS X (Darwin)</a> 2608 2611 </span> 2609 2612 </dt> 2610 2613 <dt> 2611 2614 <span class="sect2"> 2612 <a href="#id 497707">4.4.4. Linux</a>2615 <a href="#id383826">4.4.4. Linux</a> 2613 2616 </span> 2614 2617 </dt> 2615 2618 <dt> 2616 2619 <span class="sect2"> 2617 <a href="#id 497718">4.4.5. FreeBSD</a>2620 <a href="#id383838">4.4.5. FreeBSD</a> 2618 2621 </span> 2619 2622 </dt> … … 2641 2644 <div> 2642 2645 <div> 2643 <h2 class="title" style="clear: both"><a id="id 482055"></a>4.1. Introduction</h2>2646 <h2 class="title" style="clear: both"><a id="id370264"></a>4.1. Introduction</h2> 2644 2647 </div> 2645 2648 </div> … … 2669 2672 </p> 2670 2673 <p xmlns="http://www.w3.org/1999/xhtml"> 2671 <a id="id 460839" class="indexterm"></a>2672 <span ><strong class="command"><em class="varname"><a id="trace"></a>TRACE</em> {<em class="replaceable"><code>keyword</code></em>2674 <a id="id358756" class="indexterm"></a> 2675 <span class="command"><strong><em class="varname"><a id="trace"></a>TRACE</em> {<em class="replaceable"><code>keyword</code></em> 2673 2676 <em class="replaceable"><code>global-value</code></em>}* {<em class="replaceable"><code>spec</code></em> | 2674 2677 (<em class="replaceable"><code>spec</code></em> {<em class="replaceable"><code>keyword</code></em> … … 3113 3116 </div> 3114 3117 <p xmlns="http://www.w3.org/1999/xhtml"> 3115 <a id="id 438298" class="indexterm"></a>3116 <span ><strong class="command"><em class="varname"><a id="trace-level"></a>CCL:*TRACE-LEVEL*</em> [Variable]</strong></span>3118 <a id="id388151" class="indexterm"></a> 3119 <span class="command"><strong><em class="varname"><a id="trace-level"></a>CCL:*TRACE-LEVEL*</em> [Variable]</strong></span> 3117 3120 </p> 3118 3121 <p xmlns="http://www.w3.org/1999/xhtml">Variable bound to the current nesting level during execution of before and after trace actions. The default printing actions use it to determine the amount of indentation.</p> 3119 3122 <p xmlns="http://www.w3.org/1999/xhtml"> 3120 <a id="id 425701" class="indexterm"></a>3121 <span ><strong class="command"><em class="varname"><a id="trace-max-indent"></a>CCL:*TRACE-MAX-INDENT*</em> [Variable]</strong></span>3123 <a id="id388178" class="indexterm"></a> 3124 <span class="command"><strong><em class="varname"><a id="trace-max-indent"></a>CCL:*TRACE-MAX-INDENT*</em> [Variable]</strong></span> 3122 3125 </p> 3123 3126 <p xmlns="http://www.w3.org/1999/xhtml">The default before and after print actions will not indent by more than the value of <em class="varname">ccl:*trace-max-indent*</em> regardless of the current trace level.</p> 3124 3127 <p xmlns="http://www.w3.org/1999/xhtml"> 3125 <a id="id 496099" class="indexterm"></a>3126 <span ><strong class="command"><em class="varname"><a id="trace-function"></a>CCL:TRACE-FUNCTION</em> <em class="replaceable"><code>spec</code></em> <em class="varname">&key</em> {<em class="replaceable"><code>keyword</code></em> <em class="replaceable"><code>value</code></em>}* [Function]</strong></span>3128 <a id="id388207" class="indexterm"></a> 3129 <span class="command"><strong><em class="varname"><a id="trace-function"></a>CCL:TRACE-FUNCTION</em> <em class="replaceable"><code>spec</code></em> <em class="varname">&key</em> {<em class="replaceable"><code>keyword</code></em> <em class="replaceable"><code>value</code></em>}* [Function]</strong></span> 3127 3130 </p> 3128 3131 <p xmlns="http://www.w3.org/1999/xhtml"> … … 3131 3134 </p> 3132 3135 <p xmlns="http://www.w3.org/1999/xhtml"> 3133 <a id="id 496137" class="indexterm"></a>3134 <span ><strong class="command"><em class="varname"><a id="trace-print-level"></a>CCL:*TRACE-PRINT-LEVEL*</em> [Variable]</strong></span>3136 <a id="id388256" class="indexterm"></a> 3137 <span class="command"><strong><em class="varname"><a id="trace-print-level"></a>CCL:*TRACE-PRINT-LEVEL*</em> [Variable]</strong></span> 3135 3138 </p> 3136 3139 <p xmlns="http://www.w3.org/1999/xhtml">The default print actions bind <em class="varname">CL:*PRINT-LEVEL*</em> to this value while … … 3139 3142 explicit printing done by user code.</p> 3140 3143 <p xmlns="http://www.w3.org/1999/xhtml"> 3141 <a id="id 496163" class="indexterm"></a>3142 <span ><strong class="command"><em class="varname"><a id="trace-print-length"></a>CCL:*TRACE-PRINT-LENGTH*</em> [Variable]</strong></span>3144 <a id="id388290" class="indexterm"></a> 3145 <span class="command"><strong><em class="varname"><a id="trace-print-length"></a>CCL:*TRACE-PRINT-LENGTH*</em> [Variable]</strong></span> 3143 3146 </p> 3144 3147 <p xmlns="http://www.w3.org/1999/xhtml">The default print actions bind <em class="varname">CL:*PRINT-LENGTH*</em> to this value while … … 3147 3150 explicit printing done by user code.</p> 3148 3151 <p xmlns="http://www.w3.org/1999/xhtml"> 3149 <a id="id 496190" class="indexterm"></a>3150 <span ><strong class="command"><em class="varname"><a id="trace-bar-frequency"></a>CCL:*TRACE-BAR-FREQUENCY*</em> [Variable]</strong></span>3152 <a id="id388325" class="indexterm"></a> 3153 <span class="command"><strong><em class="varname"><a id="trace-bar-frequency"></a>CCL:*TRACE-BAR-FREQUENCY*</em> [Variable]</strong></span> 3151 3154 </p> 3152 3155 <p xmlns="http://www.w3.org/1999/xhtml">By default, this is nil. If non-nil it should be a integer, … … 3166 3169 and one <code class="literal">STRING</code> type in Clozure CL. There has been a 3167 3170 lot of discussion about this decision which can be found by 3168 searching the openmcl-devel archives at <a href="http://clozure.com/pipermail/openmcl-devel/" target="_top">http://clozure.com/pipermail/openmcl-devel/</a>. Suffice it3171 searching the openmcl-devel archives at <a class="ulink" href="http://clozure.com/pipermail/openmcl-devel/" target="_top">http://clozure.com/pipermail/openmcl-devel/</a>. Suffice it 3169 3172 to say that we decided that the simplicity and speed advantages of 3170 3173 only supporting UTF-32 outweigh the space disadvantage.</p> … … 3173 3176 <div> 3174 3177 <div> 3175 <h3 class="title"><a id="id 496233"></a>4.3.1. Characters</h3>3178 <h3 class="title"><a id="id388381"></a>4.3.1. Characters</h3> 3176 3179 </div> 3177 3180 </div> … … 3183 3186 characters can be directly represented. As of Unicode 5.0, only 3184 3187 about 100,000 of 1,114,112 possible <code class="literal">CHAR-CODE</code>s 3185 are actually defined. The function <span ><strong class="function">CODE-CHAR</strong></span>3188 are actually defined. The function <span class="function"><strong>CODE-CHAR</strong></span> 3186 3189 knows that certain ranges of code values (notably 3187 3190 <code class="literal">#xd800</code>-<code class="literal">#xddff</code>) will never be … … 3192 3195 values.</p> 3193 3196 <p xmlns="http://www.w3.org/1999/xhtml">Clozure CL supports character names of the form 3194 <code class="literal">u+xxxx</code> -where <code class="literal">x</code> is a3197 <code class="literal">u+xxxx</code>âwhere <code class="literal">x</code> is a 3195 3198 sequence of one or more hex digits. The value of the hex digits 3196 3199 denotes the code of the character. The <code class="literal">+</code> … … 3203 3206 spaces replaced by underscores. So 3204 3207 <code class="literal">#\Greek_Capital_Letter_Epsilon</code> can be used to 3205 refer to the character whose <span ><strong class="function">CHAR-CODE</strong></span> is3208 refer to the character whose <span class="function"><strong>CHAR-CODE</strong></span> is 3206 3209 <code class="literal">#x395</code>. To see the complete list of supported 3207 3210 character names, look just below the definition for 3208 <span><strong class="function">register-character-name</strong></span> in 3209 <code class="literal">ccl:level-1;l1-reader.lisp</code> see the complete 3210 list of char</p> 3211 <span class="function"><strong>register-character-name</strong></span> in 3212 <code class="literal">ccl:level-1;l1-reader.lisp</code>.</p> 3211 3213 </div> 3212 3214 <div class="sect2" lang="en" xml:lang="en"> … … 3218 3220 </div> 3219 3221 </div> 3220 <p xmlns="http://www.w3.org/1999/xhtml"><span ><strong class="function">OPEN</strong></span>, <span><strong class="function">LOAD</strong></span>, and3221 <span ><strong class="function">COMPILE-FILE</strong></span> all take an3222 <p xmlns="http://www.w3.org/1999/xhtml"><span class="function"><strong>OPEN</strong></span>, <span class="function"><strong>LOAD</strong></span>, and 3223 <span class="function"><strong>COMPILE-FILE</strong></span> all take an 3222 3224 <code class="literal">:EXTERNAL-FORMAT</code> keyword argument. The value 3223 3225 of <code class="literal">:EXTERNAL-FORMAT</code> can be 3224 3226 <code class="literal">:DEFAULT</code> (the default value), a line 3225 termination keyword (see <a href="#Line-Termination-Keywords" title="4.3.3. Line Termination Keywords">Section 4.3.3, âLine Termination Keywordsâ</a>), a character encoding3226 keyword (see <a href="#Character-Encodings" title="4.3.4. Character Encodings">Section 4.3.4, âCharacter Encodingsâ</a>), an3227 termination keyword (see <a class="xref" href="#Line-Termination-Keywords" title="4.3.3. Line Termination Keywords">Section 4.3.3, âLine Termination Keywordsâ</a>), a character encoding 3228 keyword (see <a class="xref" href="#Character-Encodings" title="4.3.4. Character Encodings">Section 4.3.4, âCharacter Encodingsâ</a>), an 3227 3229 external-format object created using 3228 <span ><strong class="function">CCL::MAKE-EXTERNAL-FORMAT</strong></span>(see <ahref="#f_make-external-format" title="Function MAKE-EXTERNAL-FORMAT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-external-format</b></a>), or a plist with keys:3230 <span class="function"><strong>CCL::MAKE-EXTERNAL-FORMAT</strong></span> (see <a class="xref" href="#f_make-external-format" title="Function MAKE-EXTERNAL-FORMAT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-external-format</b></a>), or a plist with keys: 3229 3231 <code class="literal">:DOMAIN</code>, <code class="literal">:CHARACTER-ENCODING</code> 3230 3232 and <code class="literal">:LINE-TERMINATION</code>. If … … 3251 3253 <p xmlns="http://www.w3.org/1999/xhtml">EXTERNAL-FORMATs are objects (structures) with three 3252 3254 read-only fields that can be accessed via the functions: 3253 <span ><strong class="function">EXTERNAL-FORMAT-DOMAIN</strong></span>,3254 <span ><strong class="function">EXTERNAL-FORMAT-LINE-TERMINATION</strong></span> and3255 <span ><strong class="function">EXTERNAL-FORMAT-CHARACTER-ENCODING</strong></span>.</p>3255 <span class="function"><strong>EXTERNAL-FORMAT-DOMAIN</strong></span>, 3256 <span class="function"><strong>EXTERNAL-FORMAT-LINE-TERMINATION</strong></span> and 3257 <span class="function"><strong>EXTERNAL-FORMAT-CHARACTER-ENCODING</strong></span>.</p> 3256 3258 <p> 3257 3259 <div class="refentrytitle"> … … 3260 3262 <br></br> 3261 3263 <code> 3262 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">make-external-format</strong></span>3264 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>make-external-format</strong></span> 3263 3265 <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&key</em> domain character-encoding line-termination 3264 3266 => external-format … … 3272 3274 <div> 3273 3275 <div class="refsect1" lang="en" xml:lang="en"> 3274 <a xmlns="http://www.w3.org/1999/xhtml" id="id 496501"></a>3276 <a xmlns="http://www.w3.org/1999/xhtml" id="id382341"></a> 3275 3277 <div class="header">Arguments and Values:</div> 3276 3278 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">domain</span></i>---This is used to indicate where the external … … 3286 3288 <em xmlns="http://www.w3.org/1999/xhtml" class="parameter"><code>line-termination</code></em>.</p> 3287 3289 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">character-encoding</span></i>---A keyword that specifies the character encoding 3288 for the external format. <a xmlns="http://www.w3.org/1999/xhtml" href="#Character-Encodings" title="4.3.4. Character Encodings">Section 4.3.4, âCharacter Encodingsâ</a>. Defaults to3290 for the external format. <a xmlns="http://www.w3.org/1999/xhtml" class="xref" href="#Character-Encodings" title="4.3.4. Character Encodings">Section 4.3.4, âCharacter Encodingsâ</a>. Defaults to 3289 3291 <code xmlns="http://www.w3.org/1999/xhtml" class="literal">:DEFAULT</code> which means if 3290 3292 <em xmlns="http://www.w3.org/1999/xhtml" class="parameter"><code>domain</code></em> is … … 3299 3301 <code xmlns="http://www.w3.org/1999/xhtml" class="literal">:ISO-8859-1</code> encoding.</p> 3300 3302 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">line-termination</span></i>---A keyword that indicates a line termination 3301 keyword <a xmlns="http://www.w3.org/1999/xhtml" href="#Line-Termination-Keywords" title="4.3.3. Line Termination Keywords">Section 4.3.3, âLine Termination Keywordsâ</a>.3303 keyword <a xmlns="http://www.w3.org/1999/xhtml" class="xref" href="#Line-Termination-Keywords" title="4.3.3. Line Termination Keywords">Section 4.3.3, âLine Termination Keywordsâ</a>. 3302 3304 Defaults to <code xmlns="http://www.w3.org/1999/xhtml" class="literal">:DEFAULT</code> which means 3303 3305 use the value of the variable 3304 3306 <em xmlns="http://www.w3.org/1999/xhtml" class="varname">CCL:*DEFAULT-LINE-TERMINATION*</em>.</p> 3305 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term"> [result]</span></i>---[description]</p>3307 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">external-format</span></i>---An external-format object as described above.</p> 3306 3308 </div> 3307 3309 <div class="refsect1" lang="en" xml:lang="en"> 3308 <a xmlns="http://www.w3.org/1999/xhtml" id="id 496634"></a>3310 <a xmlns="http://www.w3.org/1999/xhtml" id="id382520"></a> 3309 3311 <div class="header">Description:</div> 3310 <p xmlns="http://www.w3.org/1999/xhtml">Despite the function's name, it doesn't necessarily 3311 create anew, unique EXTERNAL-FORMAT object: two calls to3312 MAKE-EXTERNAL-FORMAT with the same arguments made in the 3313 same dynamic environment willreturn the same (eq) object.3312 <p xmlns="http://www.w3.org/1999/xhtml">Despite the function's name, it doesn't necessarily create a 3313 new, unique EXTERNAL-FORMAT object: two calls to 3314 MAKE-EXTERNAL-FORMAT with the same arguments made in the same 3315 dynamic environment return the same (eq) object. 3314 3316 </p> 3315 3317 </div> … … 3455 3457 character encodings. Clozure CL implements some of these encodings as 3456 3458 detailed below. These encodings are part of the specification of 3457 external formats <a href="#External-Formats" title="4.3.2. External Formats">Section 4.3.2, âExternal Formatsâ</a>. When reading3459 external formats <a class="xref" href="#External-Formats" title="4.3.2. External Formats">Section 4.3.2, âExternal Formatsâ</a>. When reading 3458 3460 from a stream, characters are converted from the specified 3459 3461 external character encoding to UTF-32. When writing to a stream, … … 3474 3476 <div> 3475 3477 <div> 3476 <h4 class="title"><a id="id 496886"></a>4.3.4.1. Encoding Problems</h4>3478 <h4 class="title"><a id="id382864"></a>4.3.4.1. Encoding Problems</h4> 3477 3479 </div> 3478 3480 </div> 3479 3481 </div> 3480 3482 <p xmlns="http://www.w3.org/1999/xhtml">On output to streams with character encodings that can 3481 encode the full range of Unicode - and on input from any stream3482 - "unencodable characters" are represented using the Unicode3483 #\Replacement_Character (= #\U+fffd); the presence of such a3484 character usually indicates that something got lost in3483 encode the full range of Unicodeâand on input from any 3484 streamâ"unencodable characters" are represented using the 3485 Unicode #\Replacement_Character (= #\U+fffd); the presence of 3486 such a character usually indicates that something got lost in 3485 3487 translation. Either data wasn't encoded properly or there was a 3486 3488 bug in the decoding process.</p> … … 3490 3492 <div> 3491 3493 <div> 3492 <h4 class="title"><a id="id 496902"></a>4.3.4.2. Byte Order Marks</h4>3494 <h4 class="title"><a id="id382877"></a>4.3.4.2. Byte Order Marks</h4> 3493 3495 </div> 3494 3496 </div> … … 3503 3505 used with UTF-8 character encodings, where it is simply used to 3504 3506 indicate that the encoding is UTF-8.)</p> 3505 <p xmlns="http://www.w3.org/1999/xhtml">Clozure CL w ill write a byte order mark as the first3506 character of a file or socket stream when the endianness of the3507 character encoding is not explicit. Clozure CL also expects a3508 byte order mark on input from streams where the endianness is3509 not explicit. If a byte order mark is missing from input data,3510 thatdata is assumed to be in big-endian order.</p>3507 <p xmlns="http://www.w3.org/1999/xhtml">Clozure CL writes a byte order mark as the first character 3508 of a file or socket stream when the endianness of the character 3509 encoding is not explicit. Clozure CL also expects a byte order 3510 mark on input from streams where the endianness is not 3511 explicit. If a byte order mark is missing from input data, that 3512 data is assumed to be in big-endian order.</p> 3511 3513 <p xmlns="http://www.w3.org/1999/xhtml">A byte order mark from a UTF-8 encoded input stream is not 3512 treated specially and and will just appear as normal character3513 from the input stream. It is probably a good idea to skip over3514 thischaracter.</p>3514 treated specially and just appears as a normal character from 3515 the input stream. It is probably a good idea to skip over this 3516 character.</p> 3515 3517 </div> 3516 3518 <div class="sect3" lang="en" xml:lang="en"> … … 3518 3520 <div> 3519 3521 <div> 3520 <h4 class="title"><a id="id 496941"></a>4.3.4.3. <span><strong class="function">DESCRIBE-CHARACTER-ENCODINGS</strong></span></h4>3522 <h4 class="title"><a id="id382915"></a>4.3.4.3. <span class="function"><strong>DESCRIBE-CHARACTER-ENCODINGS</strong></span></h4> 3521 3523 </div> 3522 3524 </div> … … 3524 3526 <p xmlns="http://www.w3.org/1999/xhtml">The set of character encodings supported by Clozure CL can be 3525 3527 retrieved by calling 3526 <span ><strong class="function">CCL:DESCRIBE-CHARACTER-ENCODINGS</strong></span>.</p>3528 <span class="function"><strong>CCL:DESCRIBE-CHARACTER-ENCODINGS</strong></span>.</p> 3527 3529 <p> 3528 3530 <div class="refentrytitle"> … … 3531 3533 <br></br> 3532 3534 <code> 3533 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">describe-character-encodings</strong></span>3535 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>describe-character-encodings</strong></span> 3534 3536 </code> 3535 3537 </div> … … 3540 3542 <div> 3541 3543 <div class="refsect1" lang="en" xml:lang="en"> 3542 <a xmlns="http://www.w3.org/1999/xhtml" id="id 496992"></a>3544 <a xmlns="http://www.w3.org/1999/xhtml" id="id382986"></a> 3543 3545 <div class="header">Description:</div> 3544 3546 <p xmlns="http://www.w3.org/1999/xhtml">Writes descriptions of all defined character encodings … … 3549 3551 </div> 3550 3552 <div class="refsect1" lang="en" xml:lang="en"> 3551 <a xmlns="http://www.w3.org/1999/xhtml" id="id 497009"></a>3553 <a xmlns="http://www.w3.org/1999/xhtml" id="id383003"></a> 3552 3554 <div class="header">See Also:</div> 3553 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#Character-Encodings" title="4.3.4. Character Encodings">Section 4.3.4, âCharacter Encodingsâ</a>, <a href="#External-Formats" title="4.3.2. External Formats">Section 4.3.2, âExternal Formatsâ</a>, <ahref="#Supported-Character-Encodings" title="4.3.4.4. Supported Character Encodings">Section 4.3.4.4, âSupported Character Encodingsâ</a></span>3555 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#Character-Encodings" title="4.3.4. Character Encodings">Section 4.3.4, âCharacter Encodingsâ</a>, <a class="xref" href="#External-Formats" title="4.3.2. External Formats">Section 4.3.2, âExternal Formatsâ</a>, <a class="xref" href="#Supported-Character-Encodings" title="4.3.4.4. Supported Character Encodings">Section 4.3.4.4, âSupported Character Encodingsâ</a></span> 3554 3556 </div> 3555 3557 </div> … … 3587 3589 EXTERNAL-FORMAT isn't explicitly specified. The default for 3588 3590 <em class="varname">*TERMINAL-IO*</em> can be set via the 3589 <code class="literal">-K</code> command-line argument (see <a href="#Command-Line-Options" title="2.5. Command Line Options">Section 2.5, âCommand Line Optionsâ</a>).3591 <code class="literal">-K</code> command-line argument (see <a class="xref" href="#Command-Line-Options" title="2.5. Command Line Options">Section 2.5, âCommand Line Optionsâ</a>). 3590 3592 </p> 3591 3593 <p>ISO-8859-1 just covers the first 256 Unicode code … … 3966 3968 <div> 3967 3969 <div> 3968 <h3 class="title"><a id="id 497617"></a>4.4.1. Pathname Expansion</h3>3970 <h3 class="title"><a id="id383711"></a>4.4.1. Pathname Expansion</h3> 3969 3971 </div> 3970 3972 </div> … … 3986 3988 </div> 3987 3989 <p xmlns="http://www.w3.org/1999/xhtml">Clozure CL sets up logical pathname translations for logical hosts: <code class="literal">ccl</code> and <code class="literal">home</code></p> 3988 <a xmlns="http://www.w3.org/1999/xhtml" id="id 497658" class="indexterm"></a>3990 <a xmlns="http://www.w3.org/1999/xhtml" id="id383764" class="indexterm"></a> 3989 3991 <p xmlns="http://www.w3.org/1999/xhtml">The <code class="literal">CCL</code> logical host should point to the 3990 3992 <code class="literal">ccl</code> directory. It is used for a variety of … … 3994 3996 is set to the value of the environment variable 3995 3997 <em class="varname">CCL_DEFAULT_DIRECTORY</em>, which is set by the 3996 openmcl shell script <a href="#The-ccl-Shell-Script" title="2.3.1. The ccl Shell Script">Section 2.3.1, âThe ccl Shell Scriptâ</a>. If3998 openmcl shell script <a class="xref" href="#The-ccl-Shell-Script" title="2.3.1. The ccl Shell Script">Section 2.3.1, âThe ccl Shell Scriptâ</a>. If 3997 3999 <em class="varname">CCL_DEFAULT_DIRECTORY</em> is not set, then it is set 3998 4000 to the directory containing the current heap image.</p> … … 4002 4004 <div> 4003 4005 <div> 4004 <h3 class="title"><a id="id 497696"></a>4.4.3. OS X (Darwin)</h3>4006 <h3 class="title"><a id="id383814"></a>4.4.3. OS X (Darwin)</h3> 4005 4007 </div> 4006 4008 </div> … … 4012 4014 <div> 4013 4015 <div> 4014 <h3 class="title"><a id="id 497707"></a>4.4.4. Linux</h3>4016 <h3 class="title"><a id="id383826"></a>4.4.4. Linux</h3> 4015 4017 </div> 4016 4018 </div> … … 4023 4025 <div> 4024 4026 <div> 4025 <h3 class="title"><a id="id 497718"></a>4.4.5. FreeBSD</h3>4027 <h3 class="title"><a id="id383838"></a>4.4.5. FreeBSD</h3> 4026 4028 </div> 4027 4029 </div> … … 4041 4043 </div> 4042 4044 <p xmlns="http://www.w3.org/1999/xhtml">In release 1.2 and later, Clozure CL 4043 supports <a href="#memory_mapped_file"><em class="glossterm">memory-mapped4045 supports <a class="glossterm" href="#memory_mapped_file"><em class="glossterm">memory-mapped 4044 4046 files</em></a>. On operating systems that support memory-mapped 4045 4047 files (including Mac OS X, Linux, and FreeBSD), the operating … … 4088 4090 platforms.</p> 4089 4091 <p xmlns="http://www.w3.org/1999/xhtml"> 4090 <a id="id 497839" class="indexterm"></a>4091 <span ><strong class="command"><em class="varname"><a id="map-file-to-ivector"></a>CCL:MAP-FILE-TO-IVECTOR</em>4092 <a id="id383954" class="indexterm"></a> 4093 <span class="command"><strong><em class="varname"><a id="map-file-to-ivector"></a>CCL:MAP-FILE-TO-IVECTOR</em> 4092 4094 <em class="parameter"><code>pathname</code></em> 4093 4095 <em class="parameter"><code>element-type</code></em> … … 4112 4114 <p>The element-type of the vector to be 4113 4115 created. Specified as 4114 a <a href="#type-specifier"><em class="glossterm">type-specifier</em></a>4116 a <a class="glossterm" href="#type-specifier"><em class="glossterm">type-specifier</em></a> 4115 4117 that names a subtype of either <em class="varname">SIGNED-BYTE</em> 4116 4118 or <em class="varname">UNSIGNED-BYTE</em>.</p> … … 4128 4130 </p> 4129 4131 <p xmlns="http://www.w3.org/1999/xhtml">The returned vector is 4130 a <a href="#displaced-array"><em class="glossterm">displaced-array</em></a>4132 a <a class="glossterm" href="#displaced-array"><em class="glossterm">displaced-array</em></a> 4131 4133 whose element-type is <em class="varname">(UPGRADED-ARRAY-ELEMENT-TYPE 4132 4134 element-type)</em>. The target of the displaced array is a … … 4148 4150 a memory error.</p> 4149 4151 <p xmlns="http://www.w3.org/1999/xhtml"> 4150 <a id="id4 97966" class="indexterm"></a>4151 <span ><strong class="command"><em class="varname"><a id="unmap-ivector"></a>CCL:UNMAP-IVECTOR</em>4152 <a id="id405599" class="indexterm"></a> 4153 <span class="command"><strong><em class="varname"><a id="unmap-ivector"></a>CCL:UNMAP-IVECTOR</em> 4152 4154 <em class="parameter"><code>displaced-array</code></em> 4153 4155 [Function]</strong></span> … … 4160 4162 target is an empty vector (of length zero).</p> 4161 4163 <p xmlns="http://www.w3.org/1999/xhtml"> 4162 <a id="id4 97997" class="indexterm"></a>4163 <span ><strong class="command"><em class="varname"><a id="map-file-to-octet-vector"></a>CCL:MAP-FILE-TO-OCTET-VECTOR</em>4164 <a id="id405634" class="indexterm"></a> 4165 <span class="command"><strong><em class="varname"><a id="map-file-to-octet-vector"></a>CCL:MAP-FILE-TO-OCTET-VECTOR</em> 4164 4166 <em class="parameter"><code>pathname</code></em> 4165 4167 [Function]</strong></span> … … 4170 4172 bytes.</p> 4171 4173 <p xmlns="http://www.w3.org/1999/xhtml"> 4172 <a id="id4 98022" class="indexterm"></a>4173 <span ><strong class="command"><em class="varname"><a id="unmap-octet-vector"></a>CCL:UNMAP-OCTET-VECTOR</em>4174 <a id="id405666" class="indexterm"></a> 4175 <span class="command"><strong><em class="varname"><a id="unmap-octet-vector"></a>CCL:UNMAP-OCTET-VECTOR</em> 4174 4176 <em class="parameter"><code>displaced-array</code></em> 4175 4177 [Function]</strong></span> … … 4187 4189 </div> 4188 4190 <p xmlns="http://www.w3.org/1999/xhtml">Clozure CL supports the definition 4189 of <a href="#static_variable"><em class="glossterm">static4191 of <a class="glossterm" href="#static_variable"><em class="glossterm">static 4190 4192 variables</em></a>, whose values are the same across threads, 4191 4193 and which may not be dynamically bound. The value of a static … … 4209 4211 static.</p> 4210 4212 <p xmlns="http://www.w3.org/1999/xhtml"> 4211 <a id="id4 98089" class="indexterm"></a>4212 <span ><strong class="command"><em class="varname"><a id="defstatic"></a>DEFSTATIC</em>4213 <a id="id405741" class="indexterm"></a> 4214 <span class="command"><strong><em class="varname"><a id="defstatic"></a>DEFSTATIC</em> 4213 4215 <em class="parameter"><code>var</code></em> 4214 4216 <em class="parameter"><code>value</code></em> … … 4247 4249 </div> 4248 4250 <p xmlns="http://www.w3.org/1999/xhtml">Proclaims the 4249 variable <a href="#special_variable"><em class="glossterm">special</em></a>,4251 variable <a class="glossterm" href="#special_variable"><em class="glossterm">special</em></a>, 4250 4252 assigns the variable the supplied value, and assigns 4251 4253 the <em class="varname">doc-string</em> to the … … 4263 4265 </div> 4264 4266 </div> 4265 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 98190" class="indexterm"></a>4267 <a xmlns="http://www.w3.org/1999/xhtml" id="id405853" class="indexterm"></a> 4266 4268 <p xmlns="http://www.w3.org/1999/xhtml">Clozure CL provides the 4267 4269 function <code class="literal">CCL:SAVE-APPLICATION</code>, which creates a file 4268 4270 containing an archived Lisp memory image.</p> 4269 4271 <p xmlns="http://www.w3.org/1999/xhtml">Clozure CL consists of a small executable called the 4270 Lisp <a href="#lisp_image"><em class="glossterm">kernel</em></a>, which4272 Lisp <a class="glossterm" href="#lisp_image"><em class="glossterm">kernel</em></a>, which 4271 4273 implements the very lowest level features of the Lisp system, and 4272 an <a href="#lisp_image"><em class="glossterm">image</em></a>, which4274 an <a class="glossterm" href="#lisp_image"><em class="glossterm">image</em></a>, which 4273 4275 contains the in-memory representation of most of the Lisp system, 4274 4276 including functions, data structures, variables, and so on. When … … 4289 4291 changes and later load them for use.</p> 4290 4292 <p xmlns="http://www.w3.org/1999/xhtml">In fact, you can go further than that. You can replace 4291 Clozure CL's <a href="#toplevel_function"><em class="glossterm">toplevel4293 Clozure CL's <a class="glossterm" href="#toplevel_function"><em class="glossterm">toplevel 4292 4294 function</em></a> with your own, and then, when the image is 4293 4295 loaded, the Lisp system immediately performs your tasks rather … … 4310 4312 in an executable image.</p> 4311 4313 <p xmlns="http://www.w3.org/1999/xhtml">On Mac OS X, 4312 the <a href="#application_builder">application builder</a>4314 the <a class="link" href="#application_builder">application builder</a> 4313 4315 uses <code class="literal">CCL:SAVE-APPLICATION</code> to create the executable 4314 portion of the <a href="#application_bundle"><em class="glossterm">application4316 portion of the <a class="glossterm" href="#application_bundle"><em class="glossterm">application 4315 4317 bundle</em></a>. Double-clicking the application bundle runs 4316 4318 the executable image created … … 4343 4345 converted, because address 0 can always be relied upon to refer to 4344 4346 the same thing.</p> 4345 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 98382" class="indexterm"></a>4347 <a xmlns="http://www.w3.org/1999/xhtml" id="id406074" class="indexterm"></a> 4346 4348 <p xmlns="http://www.w3.org/1999/xhtml">As of Clozure CL 1.2, the constant <code class="literal">CCL:+NULL-PTR+</code> 4347 4349 refers to a <code class="literal">MACPTR</code> object that points to address 0.</p> … … 4354 4356 or <code class="literal">opencml64</code> script.</p> 4355 4357 <p xmlns="http://www.w3.org/1999/xhtml"> 4356 <a id="id4 98419" class="indexterm"></a>4357 <span ><strong class="command"><em class="varname"><a id="save-application"></a>SAVE-APPLICATION</em>4358 <a id="id406122" class="indexterm"></a> 4359 <span class="command"><strong><em class="varname"><a id="save-application"></a>SAVE-APPLICATION</em> 4358 4360 <em class="parameter"><code>filename</code></em> 4359 4361 <em class="varname">&key</em> … … 4392 4394 <p>If this parameter is not supplied, Clozure CL uses its 4393 4395 default toplevel. The default toplevel runs 4394 the <a href="#REPL"><em class="glossterm">read-eval-print4396 the <a class="glossterm" href="#REPL"><em class="glossterm">read-eval-print 4395 4397 loop</em></a>.</p> 4396 4398 </dd> … … 4458 4460 <div> 4459 4461 <div> 4460 <h2 class="title"><a id="id 471096"></a>Chapter 5. The Clozure CL IDE</h2>4462 <h2 class="title"><a id="id351866"></a>Chapter 5. The Clozure CL IDE</h2> 4461 4463 </div> 4462 4464 </div> … … 4466 4468 <dt> 4467 4469 <span class="sect1"> 4468 <a href="#id 447378">5.1. Introduction</a>4470 <a href="#id391992">5.1. Introduction</a> 4469 4471 </span> 4470 4472 </dt> 4471 4473 <dt> 4472 4474 <span class="sect1"> 4473 <a href="#id 461540">5.2. Building the IDE</a>4475 <a href="#id388704">5.2. Building the IDE</a> 4474 4476 </span> 4475 4477 </dt> 4476 4478 <dt> 4477 4479 <span class="sect1"> 4478 <a href="#id 460360">5.3. Running the IDE</a>4480 <a href="#id352336">5.3. Running the IDE</a> 4479 4481 </span> 4480 4482 </dt> 4481 4483 <dt> 4482 4484 <span class="sect1"> 4483 <a href="#id 443840">5.4. IDE Features</a>4485 <a href="#id349170">5.4. IDE Features</a> 4484 4486 </span> 4485 4487 </dt> … … 4488 4490 <dt> 4489 4491 <span class="sect2"> 4490 <a href="#id 464744">5.4.1. Editor Windows</a>4492 <a href="#id347206">5.4.1. Editor Windows</a> 4491 4493 </span> 4492 4494 </dt> 4493 4495 <dt> 4494 4496 <span class="sect2"> 4495 <a href="#id 427255">5.4.2. The Lisp Menu</a>4497 <a href="#id362540">5.4.2. The Lisp Menu</a> 4496 4498 </span> 4497 4499 </dt> 4498 4500 <dt> 4499 4501 <span class="sect2"> 4500 <a href="#id 495106">5.4.3. The Tools Menu</a>4502 <a href="#id373691">5.4.3. The Tools Menu</a> 4501 4503 </span> 4502 4504 </dt> 4503 4505 <dt> 4504 4506 <span class="sect2"> 4505 <a href="#id 483840">5.4.4. The Inspector Window</a>4507 <a href="#id373711">5.4.4. The Inspector Window</a> 4506 4508 </span> 4507 4509 </dt> … … 4510 4512 <dt> 4511 4513 <span class="sect1"> 4512 <a href="#id 495865">5.5. IDE Sources</a>4514 <a href="#id394341">5.5. IDE Sources</a> 4513 4515 </span> 4514 4516 </dt> 4515 4517 <dt> 4516 4518 <span class="sect1"> 4517 <a href="#id 464104">5.6. The Application Builder</a>4519 <a href="#id394374">5.6. The Application Builder</a> 4518 4520 </span> 4519 4521 </dt> … … 4524 4526 <div> 4525 4527 <div> 4526 <h2 class="title" style="clear: both"><a id="id 447378"></a>5.1. Introduction</h2>4528 <h2 class="title" style="clear: both"><a id="id391992"></a>5.1. Introduction</h2> 4527 4529 </div> 4528 4530 </div> … … 4546 4548 <div> 4547 4549 <div> 4548 <h2 class="title" style="clear: both"><a id="id 461540"></a>5.2. Building the IDE</h2>4550 <h2 class="title" style="clear: both"><a id="id388704"></a>5.2. Building the IDE</h2> 4549 4551 </div> 4550 4552 </div> … … 4559 4561 <li> 4560 4562 <p>Run ccl from the shell. The easiest way to do this is 4561 generally to execute the openmcl or openmcl64 command.</p>4563 generally to execute the ccl or ccl64 command.</p> 4562 4564 </li> 4563 4565 <li> … … 4570 4572 interactions builds the IDE:</p> 4571 4573 <pre xmlns="http://www.w3.org/1999/xhtml" class="programlisting"> 4572 oshirion:ccl mikel$ openmcl644573 Welcome to Clozure Common Lisp Version 1.2-r8516MS(DarwinX8664)!4574 ? (require :cocoa-application)4575 ;Loading #P"ccl:cocoa-ide;fasls;cocoa-utils.dx64fsl.newest"...4576 ;Loading #P"ccl:cocoa-ide;fasls;cocoa-defaults.dx64fsl.newest"...4574 oshirion:ccl mikel$ ccl64 4575 Welcome to Clozure Common Lisp Version 1.2-r9198M-trunk (DarwinX8664)! 4576 ? (require :cocoa-application) 4577 ;Loading #P"ccl:cocoa-ide;fasls;cocoa-utils.dx64fsl.newest"... 4578 ;Loading #P"ccl:cocoa-ide;fasls;cocoa-defaults.dx64fsl.newest"... 4577 4579 4578 [...many lines of "Compiling" and "Loading" omitted...]4580 [...many lines of "Compiling" and "Loading" omitted...] 4579 4581 4580 Saving application to /usr/local/ccl/Clozure CL.app/4582 Saving application to /usr/local/ccl/Clozure CL.app/ 4581 4583 4582 oshirion:ccl mikel$4584 oshirion:ccl mikel$ 4583 4585 4584 4586 </pre> … … 4593 4595 <div> 4594 4596 <div> 4595 <h2 class="title" style="clear: both"><a id="id 460360"></a>5.3. Running the IDE</h2>4597 <h2 class="title" style="clear: both"><a id="id352336"></a>5.3. Running the IDE</h2> 4596 4598 </div> 4597 4599 </div> … … 4600 4602 application normally, by double-clicking its icon. When 4601 4603 launched, the IDE initially displays a 4602 single <a href="#listener_window"><em class="glossterm">listener4604 single <a class="glossterm" href="#listener_window"><em class="glossterm">listener 4603 4605 window</em></a> that you can use to interact with Lisp. You 4604 4606 can type Lisp expressions for evaluation at the prompt in the 4605 4607 listener window. You can also 4606 use <a href="#hemlock"><em class="glossterm">Hemlock</em></a> editing4608 use <a class="glossterm" href="#hemlock"><em class="glossterm">Hemlock</em></a> editing 4607 4609 commands to edit the text of expressions in the listener 4608 4610 window.</p> … … 4612 4614 <div> 4613 4615 <div> 4614 <h2 class="title" style="clear: both"><a id="id 443840"></a>5.4. IDE Features</h2>4616 <h2 class="title" style="clear: both"><a id="id349170"></a>5.4. IDE Features</h2> 4615 4617 </div> 4616 4618 </div> … … 4620 4622 <div> 4621 4623 <div> 4622 <h3 class="title"><a id="id 464744"></a>5.4.1. Editor Windows</h3>4624 <h3 class="title"><a id="id347206"></a>5.4.1. Editor Windows</h3> 4623 4625 </div> 4624 4626 </div> … … 4631 4633 the File menu.</p> 4632 4634 <p xmlns="http://www.w3.org/1999/xhtml">Editor windows 4633 implement <a href="#hemlock"><em class="glossterm">Hemlock</em></a>4635 implement <a class="glossterm" href="#hemlock"><em class="glossterm">Hemlock</em></a> 4634 4636 editing commands. You can use all the editing and customization 4635 4637 features of Hemlock within any editor window (including listener … … 4640 4642 <div> 4641 4643 <div> 4642 <h3 class="title"><a id="id 427255"></a>5.4.2. The Lisp Menu</h3>4644 <h3 class="title"><a id="id362540"></a>5.4.2. The Lisp Menu</h3> 4643 4645 </div> 4644 4646 </div> … … 4655 4657 <p xmlns="http://www.w3.org/1999/xhtml">You can interrupt computations, trigger breaks, and select 4656 4658 restarts from the Lisp menu. You can also display a backtrace or 4657 open the <a href="#section_inspector_window">Inspector4659 open the <a class="link" href="#section_inspector_window">Inspector 4658 4660 window</a>.</p> 4659 4661 </div> … … 4662 4664 <div> 4663 4665 <div> 4664 <h3 class="title"><a id="id 495106"></a>5.4.3. The Tools Menu</h3>4666 <h3 class="title"><a id="id373691"></a>5.4.3. The Tools Menu</h3> 4665 4667 </div> 4666 4668 </div> … … 4672 4674 symbols. The Processes window lists all threads running in the 4673 4675 current Lisp session. If you double-click a process entry, Clozure CL 4674 opens an <a href="#section_inspector_window">Inspector4676 opens an <a class="link" href="#section_inspector_window">Inspector 4675 4677 window</a> on that process.</p> 4676 4678 </div> … … 4679 4681 <div> 4680 4682 <div> 4681 <h3 class="title"><a id="id 483840"></a>5.4.4. The Inspector Window</h3>4683 <h3 class="title"><a id="id373711"></a>5.4.4. The Inspector Window</h3> 4682 4684 </div> 4683 4685 </div> … … 4711 4713 <div> 4712 4714 <div> 4713 <h2 class="title" style="clear: both"><a id="id 495865"></a>5.5. IDE Sources</h2>4715 <h2 class="title" style="clear: both"><a id="id394341"></a>5.5. IDE Sources</h2> 4714 4716 </div> 4715 4717 </div> … … 4737 4739 <div> 4738 4740 <div> 4739 <h2 class="title" style="clear: both"><a id="id 464104"></a>5.6. The Application Builder</h2>4741 <h2 class="title" style="clear: both"><a id="id394374"></a>5.6. The Application Builder</h2> 4740 4742 </div> 4741 4743 </div> … … 4745 4747 interface: the application builder. The application builder 4746 4748 constructs a 4747 Cocoa <a href="#application_bundle"><em class="glossterm">application4749 Cocoa <a class="glossterm" href="#application_bundle"><em class="glossterm">application 4748 4750 bundle</em></a> that runs a Lisp image when double-clicked. You 4749 4751 can use the application builder to create Cocoa applications in … … 4755 4757 the required subsystems, if necessary.</p> 4756 4758 <p xmlns="http://www.w3.org/1999/xhtml"> 4757 <a id="id 477838" class="indexterm"></a>4758 <span ><strong class="command"><em class="varname"><a id="build-application"></a>BUILD-APPLICATION</em> <em class="varname"><em class="varname">&key</em></em>4759 <a id="id394404" class="indexterm"></a> 4760 <span class="command"><strong><em class="varname"><a id="build-application"></a>BUILD-APPLICATION</em> <em class="varname"><em class="varname">&key</em></em> 4759 4761 (<em class="parameter"><code>name</code></em> <em class="replaceable"><code>"MyApplication"</code></em>) 4760 4762 (<em class="parameter"><code>type-string</code></em> <em class="replaceable"><code>"APPL"</code></em>) … … 4810 4812 </dt> 4811 4813 <dd> 4812 <p>Specifies the <a href="#creator_code"><em class="glossterm">creator4814 <p>Specifies the <a class="glossterm" href="#creator_code"><em class="glossterm">creator 4813 4815 code</em></a>, which uniquely identifies the application 4814 4816 under Mac OS X. The default creator code is that of Clozure CL. For 4815 4817 more information about reserving and assigning creator codes, 4816 4818 see 4817 Apple's <a href="http://developer.apple.com/datatype/index.html" target="_top">developer4819 Apple's <a class="ulink" href="http://developer.apple.com/datatype/index.html" target="_top">developer 4818 4820 page</a> on the topic.</p> 4819 4821 </dd> … … 4840 4842 <dd> 4841 4843 <p>A list of pathnames, where each pathname identifies 4842 a <a href="#nibfile"><em class="glossterm">nibfile</em></a> created4844 a <a class="glossterm" href="#nibfile"><em class="glossterm">nibfile</em></a> created 4843 4845 with 4844 Apple's <a href="#InterfaceBuilder"><em class="glossterm">InterfaceBuilder</em></a>4846 Apple's <a class="glossterm" href="#InterfaceBuilder"><em class="glossterm">InterfaceBuilder</em></a> 4845 4847 application. <code class="code">BUILD-APPLICATION</code> copies each 4846 4848 nibfile into the appropriate place in the application bundle, … … 4858 4860 <dd> 4859 4861 <p>The name of 4860 the <a href="#nibfile"><em class="glossterm">nibfile</em></a> to load4862 the <a class="glossterm" href="#nibfile"><em class="glossterm">nibfile</em></a> to load 4861 4863 initially when launching. The user-interface defined in this 4862 4864 nibfile becomes the application's main interface. You must … … 5054 5056 <dt> 5055 5057 <span class="sect2"> 5056 <a href="#id 466949">7.3.2. As of August 2003:</a>5058 <a href="#id356525">7.3.2. As of August 2003:</a> 5057 5059 </span> 5058 5060 </dt> … … 5305 5307 <div> 5306 5308 <div> 5307 <h3 class="title"><a id="id 466949"></a>7.3.2. As of August 2003:</h3>5309 <h3 class="title"><a id="id356525"></a>7.3.2. As of August 2003:</h3> 5308 5310 </div> 5309 5311 </div> … … 5748 5750 <br></br> 5749 5751 <code> 5750 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">all-processes</strong></span> => result5752 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>all-processes</strong></span> => result 5751 5753 </code> 5752 5754 </div> … … 5757 5759 <div> 5758 5760 <div class="refsect1" lang="en" xml:lang="en"> 5759 <a xmlns="http://www.w3.org/1999/xhtml" id="id 442728"></a>5761 <a xmlns="http://www.w3.org/1999/xhtml" id="id399273"></a> 5760 5762 <div class="header">Values:</div> 5761 5763 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">result</span></i>---a list of all lisp processes (threads) … … 5763 5765 </div> 5764 5766 <div class="refsect1" lang="en" xml:lang="en"> 5765 <a xmlns="http://www.w3.org/1999/xhtml" id="id 425580"></a>5767 <a xmlns="http://www.w3.org/1999/xhtml" id="id399299"></a> 5766 5768 <div class="header">Description:</div> 5767 5769 <p xmlns="http://www.w3.org/1999/xhtml">Returns a list of all lisp processes (threads) known … … 5775 5777 </div> 5776 5778 <div class="refsect1" lang="en" xml:lang="en"> 5777 <a xmlns="http://www.w3.org/1999/xhtml" id="id 455035"></a>5779 <a xmlns="http://www.w3.org/1999/xhtml" id="id399314"></a> 5778 5780 <div class="header">See Also:</div> 5779 5781 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"> 5780 <a href="#v_current-process" title="Variable *CURRENT-PROCESS*">5782 <a class="xref" href="#v_current-process" title="Variable *CURRENT-PROCESS*"> 5781 5783 <b xmlns="http://www.w3.org/TR/xhtml1/transitional">*current-process*</b> 5782 5784 </a> … … 5791 5793 <br></br> 5792 5794 <code> 5793 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">make-process</strong></span>5795 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>make-process</strong></span> 5794 5796 name &key 5795 5797 persistent priority class stack-size vstack-size … … 5803 5805 <div> 5804 5806 <div class="refsect1" lang="en" xml:lang="en"> 5805 <a xmlns="http://www.w3.org/1999/xhtml" id="id 464285"></a>5807 <a xmlns="http://www.w3.org/1999/xhtml" id="id399383"></a> 5806 5808 <div class="header">Arguments and Values:</div> 5807 5809 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">name</span></i>---a string, used to identify the process.</p> … … 5842 5844 </div> 5843 5845 <div class="refsect1" lang="en" xml:lang="en"> 5844 <a xmlns="http://www.w3.org/1999/xhtml" id="id 446912"></a>5846 <a xmlns="http://www.w3.org/1999/xhtml" id="id399571"></a> 5845 5847 <div class="header">Description:</div> 5846 5848 <p xmlns="http://www.w3.org/1999/xhtml">Creates and returns a new lisp process (thread) with the … … 5849 5851 <span class="emphasis"><em>preset</em></span> (given 5850 5852 an initial function to run, as by 5851 <a href="#f_process-preset" title="Function PROCESS-PRESET"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-preset</b></a>) and5853 <a class="xref" href="#f_process-preset" title="Function PROCESS-PRESET"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-preset</b></a>) and 5852 5854 <span class="emphasis"><em>enabled</em></span> 5853 (allowed to execute, as by <a href="#f_process-enable" title="Function PROCESS-ENABLE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-enable</b></a>)5855 (allowed to execute, as by <a class="xref" href="#f_process-enable" title="Function PROCESS-ENABLE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-enable</b></a>) 5854 5856 before it's able to actually do anything.</p> 5855 5857 <p xmlns="http://www.w3.org/1999/xhtml">If <em class="varname">valueform</em> is a function, it is … … 5863 5865 </div> 5864 5866 <div class="refsect1" lang="en" xml:lang="en"> 5865 <a xmlns="http://www.w3.org/1999/xhtml" id="id 429285"></a>5867 <a xmlns="http://www.w3.org/1999/xhtml" id="id399624"></a> 5866 5868 <div class="header">See Also:</div> 5867 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#f_process-preset" title="Function PROCESS-PRESET"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-preset</b></a>, <a href="#f_process-enable" title="Function PROCESS-ENABLE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-enable</b></a>, <ahref="#f_process-run-function" title="Function PROCESS-RUN-FUNCTION"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-run-function</b></a></span>5869 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#f_process-preset" title="Function PROCESS-PRESET"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-preset</b></a>, <a class="xref" href="#f_process-enable" title="Function PROCESS-ENABLE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-enable</b></a>, <a class="xref" href="#f_process-run-function" title="Function PROCESS-RUN-FUNCTION"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-run-function</b></a></span> 5868 5870 </div> 5869 5871 </div> … … 5874 5876 <strong>[Function]</strong> 5875 5877 <br></br> 5876 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">process-suspend</strong></span> process5878 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>process-suspend</strong></span> process 5877 5879 => result</code> 5878 5880 </div> … … 5882 5884 <div> 5883 5885 <div class="refsect1" lang="en" xml:lang="en"> 5884 <a xmlns="http://www.w3.org/1999/xhtml" id="id 426934"></a>5886 <a xmlns="http://www.w3.org/1999/xhtml" id="id399702"></a> 5885 5887 <div class="header">Arguments and Values:</div> 5886 5888 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">process</span></i>---a lisp process (thread).</p> … … 5888 5890 and is now suspended; NIL otherwise. That is, T if 5889 5891 <em xmlns="http://www.w3.org/1999/xhtml" class="varname">process</em>'s 5890 <a xmlns="http://www.w3.org/1999/xhtml" href="#f_process-suspend-count" title="Function PROCESS-SUSPEND-COUNT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-suspend-count</b></a>5892 <a xmlns="http://www.w3.org/1999/xhtml" class="xref" href="#f_process-suspend-count" title="Function PROCESS-SUSPEND-COUNT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-suspend-count</b></a> 5891 5893 transitioned from 0 to 1.</p> 5892 5894 </div> 5893 5895 <div class="refsect1" lang="en" xml:lang="en"> 5894 <a xmlns="http://www.w3.org/1999/xhtml" id="id 482610"></a>5896 <a xmlns="http://www.w3.org/1999/xhtml" id="id399756"></a> 5895 5897 <div class="header">Description:</div> 5896 5898 <p xmlns="http://www.w3.org/1999/xhtml">Suspends <em class="varname">process</em>, preventing it from … … 5902 5904 <p xmlns="http://www.w3.org/1999/xhtml"> 5903 5905 Each 5904 call to <span ><strong class="function">process-suspend</strong></span> must be reversed by5905 a matching call to <a href="#f_process-resume" title="Function PROCESS-RESUME"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-resume</b></a>5906 call to <span class="function"><strong>process-suspend</strong></span> must be reversed by 5907 a matching call to <a class="xref" href="#f_process-resume" title="Function PROCESS-RESUME"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-resume</b></a> 5906 5908 before <em class="varname">process</em> is able to run. What 5907 <span ><strong class="function">process-suspend</strong></span> actually does is increment5908 the <a href="#f_process-suspend-count" title="Function PROCESS-SUSPEND-COUNT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-suspend-count</b></a> of5909 <span class="function"><strong>process-suspend</strong></span> actually does is increment 5910 the <a class="xref" href="#f_process-suspend-count" title="Function PROCESS-SUSPEND-COUNT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-suspend-count</b></a> of 5909 5911 <em class="varname">process</em>. 5910 5912 </p> … … 5914 5916 </div> 5915 5917 <div class="refsect1" lang="en" xml:lang="en"> 5916 <a xmlns="http://www.w3.org/1999/xhtml" id="id 439814"></a>5918 <a xmlns="http://www.w3.org/1999/xhtml" id="id399812"></a> 5917 5919 <div class="header">See Also:</div> 5918 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#f_process-resume" title="Function PROCESS-RESUME"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-resume</b></a>, <ahref="#f_process-suspend-count" title="Function PROCESS-SUSPEND-COUNT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-suspend-count</b></a></span>5919 </div> 5920 <div class="refsect1" lang="en" xml:lang="en"> 5921 <a xmlns="http://www.w3.org/1999/xhtml" id="id 463502"></a>5920 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#f_process-resume" title="Function PROCESS-RESUME"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-resume</b></a>, <a class="xref" href="#f_process-suspend-count" title="Function PROCESS-SUSPEND-COUNT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-suspend-count</b></a></span> 5921 </div> 5922 <div class="refsect1" lang="en" xml:lang="en"> 5923 <a xmlns="http://www.w3.org/1999/xhtml" id="id399837"></a> 5922 5924 <div class="header">Notes:</div> 5923 <p xmlns="http://www.w3.org/1999/xhtml"><span ><strong class="function">process-suspend</strong></span> was previously called5924 <span ><strong class="function">process-disable</strong></span>.5925 <a href="#f_process-enable" title="Function PROCESS-ENABLE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-enable</b></a>5925 <p xmlns="http://www.w3.org/1999/xhtml"><span class="function"><strong>process-suspend</strong></span> was previously called 5926 <span class="function"><strong>process-disable</strong></span>. 5927 <a class="xref" href="#f_process-enable" title="Function PROCESS-ENABLE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-enable</b></a> 5926 5928 now names a function for which there is no 5927 obvious inverse, so <span ><strong class="function">process-disable</strong></span>5929 obvious inverse, so <span class="function"><strong>process-disable</strong></span> 5928 5930 is no longer 5929 5931 defined.</p> … … 5936 5938 <strong>[Function]</strong> 5937 5939 <br></br> 5938 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">process-resume</strong></span> process5940 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>process-resume</strong></span> process 5939 5941 => result</code> 5940 5942 </div> … … 5945 5947 <div> 5946 5948 <div class="refsect1" lang="en" xml:lang="en"> 5947 <a xmlns="http://www.w3.org/1999/xhtml" id="id 451272"></a>5949 <a xmlns="http://www.w3.org/1999/xhtml" id="id399918"></a> 5948 5950 <div class="header">Arguments and Values:</div> 5949 5951 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">process</span></i>---a lisp process (thread).</p> … … 5951 5953 and is now runnable; NIL otherwise. That is, T if 5952 5954 <em xmlns="http://www.w3.org/1999/xhtml" class="varname">process</em>'s 5953 <a xmlns="http://www.w3.org/1999/xhtml" href="#f_process-suspend-count" title="Function PROCESS-SUSPEND-COUNT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-suspend-count</b></a>5955 <a xmlns="http://www.w3.org/1999/xhtml" class="xref" href="#f_process-suspend-count" title="Function PROCESS-SUSPEND-COUNT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-suspend-count</b></a> 5954 5956 transitioned from to 0. 5955 5957 </p> 5956 5958 </div> 5957 5959 <div class="refsect1" lang="en" xml:lang="en"> 5958 <a xmlns="http://www.w3.org/1999/xhtml" id="id 504118"></a>5960 <a xmlns="http://www.w3.org/1999/xhtml" id="id399972"></a> 5959 5961 <div class="header">Description:</div> 5960 5962 <p xmlns="http://www.w3.org/1999/xhtml">Undoes the effect of a previous call to 5961 <a href="#f_process-suspend" title="Function PROCESS-SUSPEND"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-suspend</b></a>; if5963 <a class="xref" href="#f_process-suspend" title="Function PROCESS-SUSPEND"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-suspend</b></a>; if 5962 5964 all such calls are undone, makes the process runnable. Has no 5963 5965 effect if the process is not suspended. What 5964 <span ><strong class="function">process-resume</strong></span> actually does is decrement5965 the <a href="#f_process-suspend-count" title="Function PROCESS-SUSPEND-COUNT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-suspend-count</b></a> of5966 <span class="function"><strong>process-resume</strong></span> actually does is decrement 5967 the <a class="xref" href="#f_process-suspend-count" title="Function PROCESS-SUSPEND-COUNT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-suspend-count</b></a> of 5966 5968 <em class="varname">process</em>, to a minimum of 0.</p> 5967 5969 </div> 5968 5970 <div class="refsect1" lang="en" xml:lang="en"> 5969 <a xmlns="http://www.w3.org/1999/xhtml" id="id 504143"></a>5971 <a xmlns="http://www.w3.org/1999/xhtml" id="id400003"></a> 5970 5972 <div class="header">See Also:</div> 5971 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#f_process-suspend" title="Function PROCESS-SUSPEND"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-suspend</b></a>, <ahref="#f_process-suspend-count" title="Function PROCESS-SUSPEND-COUNT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-suspend-count</b></a></span>5972 </div> 5973 <div class="refsect1" lang="en" xml:lang="en"> 5974 <a xmlns="http://www.w3.org/1999/xhtml" id="id 504162"></a>5973 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#f_process-suspend" title="Function PROCESS-SUSPEND"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-suspend</b></a>, <a class="xref" href="#f_process-suspend-count" title="Function PROCESS-SUSPEND-COUNT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-suspend-count</b></a></span> 5974 </div> 5975 <div class="refsect1" lang="en" xml:lang="en"> 5976 <a xmlns="http://www.w3.org/1999/xhtml" id="id400028"></a> 5975 5977 <div class="header">Notes:</div> 5976 5978 <p xmlns="http://www.w3.org/1999/xhtml"> 5977 5979 This was previously called PROCESS-ENABLE; 5978 <a href="#f_process-enable" title="Function PROCESS-ENABLE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-enable</b></a> now does something slightly5980 <a class="xref" href="#f_process-enable" title="Function PROCESS-ENABLE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-enable</b></a> now does something slightly 5979 5981 different. 5980 5982 </p> … … 5988 5990 <br></br> 5989 5991 <code> 5990 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">process-suspend-count</strong></span>5992 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>process-suspend-count</strong></span> 5991 5993 process => result 5992 5994 </code> … … 5998 6000 <div> 5999 6001 <div class="refsect1" lang="en" xml:lang="en"> 6000 <a xmlns="http://www.w3.org/1999/xhtml" id="id 504213"></a>6002 <a xmlns="http://www.w3.org/1999/xhtml" id="id400093"></a> 6001 6003 <div class="header">Arguments and Values:</div> 6002 6004 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">process</span></i>---a lisp process (thread).</p> 6003 6005 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">result</span></i>---The number of "outstanding" 6004 <a xmlns="http://www.w3.org/1999/xhtml" href="#f_process-suspend" title="Function PROCESS-SUSPEND"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-suspend</b></a> calls on6006 <a xmlns="http://www.w3.org/1999/xhtml" class="xref" href="#f_process-suspend" title="Function PROCESS-SUSPEND"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-suspend</b></a> calls on 6005 6007 <em xmlns="http://www.w3.org/1999/xhtml" class="varname">process</em>, or NIL if 6006 6008 <em xmlns="http://www.w3.org/1999/xhtml" class="varname">process</em> has expired. … … 6008 6010 </div> 6009 6011 <div class="refsect1" lang="en" xml:lang="en"> 6010 <a xmlns="http://www.w3.org/1999/xhtml" id="id 504257"></a>6012 <a xmlns="http://www.w3.org/1999/xhtml" id="id400147"></a> 6011 6013 <div class="header">Description:</div> 6012 <p xmlns="http://www.w3.org/1999/xhtml">An "outstanding" <a href="#f_process-suspend" title="Function PROCESS-SUSPEND"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-suspend</b></a> call6014 <p xmlns="http://www.w3.org/1999/xhtml">An "outstanding" <a class="xref" href="#f_process-suspend" title="Function PROCESS-SUSPEND"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-suspend</b></a> call 6013 6015 is one which has not yet been reversed by a call to 6014 <a href="#f_process-resume" title="Function PROCESS-RESUME"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-resume</b></a>. A process expires when6016 <a class="xref" href="#f_process-resume" title="Function PROCESS-RESUME"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-resume</b></a>. A process expires when 6015 6017 its initial function returns, although it may later be 6016 6018 reset.</p> 6017 6019 <p xmlns="http://www.w3.org/1999/xhtml">A process is <span class="emphasis"><em>runnable</em></span> when it has a 6018 <span ><strong class="function">process-suspend-count</strong></span> of 0, has been6019 preset as by <a href="#f_process-preset" title="Function PROCESS-PRESET"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-preset</b></a>, and has been6020 enabled as by <a href="#f_process-enable" title="Function PROCESS-ENABLE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-enable</b></a>. Newly-created6021 processes have a <span ><strong class="function">process-suspend-count</strong></span> of6020 <span class="function"><strong>process-suspend-count</strong></span> of 0, has been 6021 preset as by <a class="xref" href="#f_process-preset" title="Function PROCESS-PRESET"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-preset</b></a>, and has been 6022 enabled as by <a class="xref" href="#f_process-enable" title="Function PROCESS-ENABLE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-enable</b></a>. Newly-created 6023 processes have a <span class="function"><strong>process-suspend-count</strong></span> of 6022 6024 0.</p> 6023 6025 </div> 6024 6026 <div class="refsect1" lang="en" xml:lang="en"> 6025 <a xmlns="http://www.w3.org/1999/xhtml" id="id 504296"></a>6027 <a xmlns="http://www.w3.org/1999/xhtml" id="id400197"></a> 6026 6028 <div class="header">See Also:</div> 6027 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#f_process-suspend" title="Function PROCESS-SUSPEND"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-suspend</b></a>, <ahref="#f_process-resume" title="Function PROCESS-RESUME"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-resume</b></a></span>6029 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#f_process-suspend" title="Function PROCESS-SUSPEND"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-suspend</b></a>, <a class="xref" href="#f_process-resume" title="Function PROCESS-RESUME"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-resume</b></a></span> 6028 6030 </div> 6029 6031 </div> … … 6034 6036 <strong>[Function]</strong> 6035 6037 <br></br> 6036 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">process-preset</strong></span>6038 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>process-preset</strong></span> 6037 6039 process function <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&rest</em> args 6038 6040 => result</code> … … 6044 6046 <div> 6045 6047 <div class="refsect1" lang="en" xml:lang="en"> 6046 <a xmlns="http://www.w3.org/1999/xhtml" id="id 504353"></a>6048 <a xmlns="http://www.w3.org/1999/xhtml" id="id400273"></a> 6047 6049 <div class="header">Arguments and Values:</div> 6048 6050 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">process</span></i>---a lisp process (thread).</p> … … 6055 6057 </div> 6056 6058 <div class="refsect1" lang="en" xml:lang="en"> 6057 <a xmlns="http://www.w3.org/1999/xhtml" id="id 504419"></a>6059 <a xmlns="http://www.w3.org/1999/xhtml" id="id400348"></a> 6058 6060 <div class="header">Description:</div> 6059 6061 <p xmlns="http://www.w3.org/1999/xhtml">Typically used to initialize a newly-created or newly-reset … … 6061 6063 becomes enabled, it will begin execution by 6062 6064 applying <em class="varname">function</em> to <em class="varname">args</em>. 6063 <span ><strong class="function">process-preset</strong></span> does not enable6065 <span class="function"><strong>process-preset</strong></span> does not enable 6064 6066 <em class="varname">process</em>, 6065 although a process must be <span ><strong class="function">process-preset</strong></span>6067 although a process must be <span class="function"><strong>process-preset</strong></span> 6066 6068 before it can be enabled. Processes are normally enabled by 6067 <a href="#f_process-enable" title="Function PROCESS-ENABLE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-enable</b></a>.6069 <a class="xref" href="#f_process-enable" title="Function PROCESS-ENABLE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-enable</b></a>. 6068 6070 </p> 6069 6071 </div> 6070 6072 <div class="refsect1" lang="en" xml:lang="en"> 6071 <a xmlns="http://www.w3.org/1999/xhtml" id="id 504456"></a>6073 <a xmlns="http://www.w3.org/1999/xhtml" id="id400392"></a> 6072 6074 <div class="header">See Also:</div> 6073 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#f_make-process" title="Function MAKE-PROCESS"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-process</b></a>, <a href="#f_process-enable" title="Function PROCESS-ENABLE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-enable</b></a>, <ahref="#f_process-run-function" title="Function PROCESS-RUN-FUNCTION"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-run-function</b></a></span>6075 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#f_make-process" title="Function MAKE-PROCESS"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-process</b></a>, <a class="xref" href="#f_process-enable" title="Function PROCESS-ENABLE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-enable</b></a>, <a class="xref" href="#f_process-run-function" title="Function PROCESS-RUN-FUNCTION"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-run-function</b></a></span> 6074 6076 </div> 6075 6077 </div> … … 6080 6082 <strong>[Function]</strong> 6081 6083 <br></br> 6082 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">process-enable</strong></span>6084 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>process-enable</strong></span> 6083 6085 process <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&optional</em> timeout 6084 6086 </code> … … 6090 6092 <div> 6091 6093 <div class="refsect1" lang="en" xml:lang="en"> 6092 <a xmlns="http://www.w3.org/1999/xhtml" id="id 504517"></a>6094 <a xmlns="http://www.w3.org/1999/xhtml" id="id400474"></a> 6093 6095 <div class="header">Arguments and Values:</div> 6094 6096 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">process</span></i>---a lisp process (thread).</p> 6095 6097 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">timeout</span></i>---a time interval in seconds. May be any 6096 non-negative real number the <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">floor</strong></span> of6098 non-negative real number the <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>floor</strong></span> of 6097 6099 which fits in 32 bits. The default is 1.</p> 6098 6100 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">result</span></i>---undefined.</p> 6099 6101 </div> 6100 6102 <div class="refsect1" lang="en" xml:lang="en"> 6101 <a xmlns="http://www.w3.org/1999/xhtml" id="id 504570"></a>6103 <a xmlns="http://www.w3.org/1999/xhtml" id="id400537"></a> 6102 6104 <div class="header">Description:</div> 6103 6105 <p xmlns="http://www.w3.org/1999/xhtml">Tries to begin the execution of <em class="varname">process</em>. 6104 6106 An error is signaled if <em class="varname">process</em> has never 6105 been <a href="#f_process-preset" title="Function PROCESS-PRESET"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-preset</b></a>. Otherwise,6107 been <a class="xref" href="#f_process-preset" title="Function PROCESS-PRESET"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-preset</b></a>. Otherwise, 6106 6108 <em class="varname">process</em> invokes its initial function. 6107 6109 </p> 6108 <p xmlns="http://www.w3.org/1999/xhtml"><span ><strong class="function">process-enable</strong></span> attempts to6110 <p xmlns="http://www.w3.org/1999/xhtml"><span class="function"><strong>process-enable</strong></span> attempts to 6109 6111 synchronize with <em class="varname">process</em>, which is presumed 6110 6112 to be reset or in the act of resetting itself. If this attempt … … 6116 6118 </div> 6117 6119 <div class="refsect1" lang="en" xml:lang="en"> 6118 <a xmlns="http://www.w3.org/1999/xhtml" id="id 504614"></a>6120 <a xmlns="http://www.w3.org/1999/xhtml" id="id400585"></a> 6119 6121 <div class="header">See Also:</div> 6120 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#f_make-process" title="Function MAKE-PROCESS"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-process</b></a>, <a href="#f_process-preset" title="Function PROCESS-PRESET"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-preset</b></a>, <ahref="#f_process-run-function" title="Function PROCESS-RUN-FUNCTION"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-run-function</b></a></span>6121 </div> 6122 <div class="refsect1" lang="en" xml:lang="en"> 6123 <a xmlns="http://www.w3.org/1999/xhtml" id="id 504637"></a>6122 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#f_make-process" title="Function MAKE-PROCESS"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-process</b></a>, <a class="xref" href="#f_process-preset" title="Function PROCESS-PRESET"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-preset</b></a>, <a class="xref" href="#f_process-run-function" title="Function PROCESS-RUN-FUNCTION"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-run-function</b></a></span> 6123 </div> 6124 <div class="refsect1" lang="en" xml:lang="en"> 6125 <a xmlns="http://www.w3.org/1999/xhtml" id="id400616"></a> 6124 6126 <div class="header">Notes:</div> 6125 6127 <p xmlns="http://www.w3.org/1999/xhtml">It would be nice to have more discussion of what it means … … 6133 6135 <strong>[Function]</strong> 6134 6136 <br></br> 6135 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">process-run-function</strong></span>6137 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>process-run-function</strong></span> 6136 6138 process-specifier function <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&rest</em> args => process</code> 6137 6139 </div> … … 6142 6144 <div> 6143 6145 <div class="refsect1" lang="en" xml:lang="en"> 6144 <a xmlns="http://www.w3.org/1999/xhtml" id="id 504731"></a>6146 <a xmlns="http://www.w3.org/1999/xhtml" id="id400731"></a> 6145 6147 <div class="header">Arguments and Values:</div> 6146 6148 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">name</span></i>---a string, used to identify the process. 6147 Passed to <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">make-process</strong></span>.</p>6149 Passed to <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>make-process</strong></span>.</p> 6148 6150 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">function</span></i>---a function, designated by itself or by a symbol 6149 6151 which names it. Passed to 6150 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">preset-process</strong></span>.6152 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>preset-process</strong></span>. 6151 6153 </p> 6152 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">persistent</span></i>---a boolean, passed to <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">make-process</strong></span>.6154 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">persistent</span></i>---a boolean, passed to <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>make-process</strong></span>. 6153 6155 </p> 6154 6156 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">priority</span></i>---ignored.</p> 6155 6157 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">class</span></i>---a subclass of CCL:PROCESS. Passed to 6156 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">make-process</strong></span>.</p>6158 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>make-process</strong></span>.</p> 6157 6159 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">stack-size</span></i>---a size, in bytes. Passed to 6158 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">make-process</strong></span>.</p>6160 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>make-process</strong></span>.</p> 6159 6161 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">vstack-size</span></i>---a size, in bytes. Passed to 6160 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">make-process</strong></span>.</p>6162 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>make-process</strong></span>.</p> 6161 6163 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">tstack-size</span></i>---a size, in bytes. Passed to 6162 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">make-process</strong></span>.</p>6164 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>make-process</strong></span>.</p> 6163 6165 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">process</span></i>---the newly-created process.</p> 6164 6166 </div> 6165 6167 <div class="refsect1" lang="en" xml:lang="en"> 6166 <a xmlns="http://www.w3.org/1999/xhtml" id="id 504882"></a>6168 <a xmlns="http://www.w3.org/1999/xhtml" id="id400920"></a> 6167 6169 <div class="header">Description:</div> 6168 6170 <p xmlns="http://www.w3.org/1999/xhtml">Creates a lisp process (thread) via 6169 <a href="#f_make-process" title="Function MAKE-PROCESS"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-process</b></a>,6170 presets it via <a href="#f_process-preset" title="Function PROCESS-PRESET"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-preset</b></a>, and6171 enables it via <a href="#f_process-enable" title="Function PROCESS-ENABLE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-enable</b></a>. This means6171 <a class="xref" href="#f_make-process" title="Function MAKE-PROCESS"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-process</b></a>, 6172 presets it via <a class="xref" href="#f_process-preset" title="Function PROCESS-PRESET"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-preset</b></a>, and 6173 enables it via <a class="xref" href="#f_process-enable" title="Function PROCESS-ENABLE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-enable</b></a>. This means 6172 6174 that <em class="varname">process</em> will immediately begin to 6173 6175 execute. 6174 <span ><strong class="function">process-run-function</strong></span> is6176 <span class="function"><strong>process-run-function</strong></span> is 6175 6177 the simplest way to create and run a process. 6176 6178 </p> 6177 6179 </div> 6178 6180 <div class="refsect1" lang="en" xml:lang="en"> 6179 <a xmlns="http://www.w3.org/1999/xhtml" id="id 504909"></a>6181 <a xmlns="http://www.w3.org/1999/xhtml" id="id400955"></a> 6180 6182 <div class="header">See Also:</div> 6181 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#f_make-process" title="Function MAKE-PROCESS"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-process</b></a>, <a href="#f_process-preset" title="Function PROCESS-PRESET"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-preset</b></a>, <ahref="#f_process-enable" title="Function PROCESS-ENABLE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-enable</b></a></span>6183 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#f_make-process" title="Function MAKE-PROCESS"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-process</b></a>, <a class="xref" href="#f_process-preset" title="Function PROCESS-PRESET"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-preset</b></a>, <a class="xref" href="#f_process-enable" title="Function PROCESS-ENABLE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-enable</b></a></span> 6182 6184 </div> 6183 6185 </div> … … 6188 6190 <strong>[Function]</strong> 6189 6191 <br></br> 6190 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">process-interrupt</strong></span>6192 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>process-interrupt</strong></span> 6191 6193 process function <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&rest</em> args => result</code> 6192 6194 </div> … … 6198 6200 <div> 6199 6201 <div class="refsect1" lang="en" xml:lang="en"> 6200 <a xmlns="http://www.w3.org/1999/xhtml" id="id 504972"></a>6202 <a xmlns="http://www.w3.org/1999/xhtml" id="id412921"></a> 6201 6203 <div class="header">Arguments and Values:</div> 6202 6204 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">process</span></i>---a lisp process (thread).</p> … … 6207 6209 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">result</span></i>---the result of applying <em xmlns="http://www.w3.org/1999/xhtml" class="varname">function</em> 6208 6210 to <em xmlns="http://www.w3.org/1999/xhtml" class="varname">args</em> if <em xmlns="http://www.w3.org/1999/xhtml" class="varname">process</em> 6209 is the <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">current-process</strong></span>, otherwise6211 is the <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>current-process</strong></span>, otherwise 6210 6212 NIL.</p> 6211 6213 </div> 6212 6214 <div class="refsect1" lang="en" xml:lang="en"> 6213 <a xmlns="http://www.w3.org/1999/xhtml" id="id 505050"></a>6215 <a xmlns="http://www.w3.org/1999/xhtml" id="id413000"></a> 6214 6216 <div class="header">Description:</div> 6215 6217 <p xmlns="http://www.w3.org/1999/xhtml">Arranges for <em class="varname">process</em> … … 6222 6224 <p xmlns="http://www.w3.org/1999/xhtml"><em class="varname">process</em> must be in an enabled state in 6223 6225 order to respond 6224 to a <span ><strong class="function">process-interrupt</strong></span> request. It's6226 to a <span class="function"><strong>process-interrupt</strong></span> request. It's 6225 6227 perfectly legal for a process to call 6226 <span ><strong class="function">process-interrupt</strong></span> on itself.</p>6227 <p xmlns="http://www.w3.org/1999/xhtml"><span ><strong class="function">process-interrupt</strong></span>6228 <span class="function"><strong>process-interrupt</strong></span> on itself.</p> 6229 <p xmlns="http://www.w3.org/1999/xhtml"><span class="function"><strong>process-interrupt</strong></span> 6228 6230 uses asynchronous POSIX signals to interrupt threads. If the 6229 6231 thread being interrupted is executing lisp code, it can … … 6242 6244 </div> 6243 6245 <div class="refsect1" lang="en" xml:lang="en"> 6244 <a xmlns="http://www.w3.org/1999/xhtml" id="id 505119"></a>6246 <a xmlns="http://www.w3.org/1999/xhtml" id="id413067"></a> 6245 6247 <div class="header">See Also:</div> 6246 6248 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"> 6247 <a href="#m_without-interrupts" title="Macro WITHOUT-INTERRUPTS">6249 <a class="xref" href="#m_without-interrupts" title="Macro WITHOUT-INTERRUPTS"> 6248 6250 <b xmlns="http://www.w3.org/TR/xhtml1/transitional">without-interrupts</b> 6249 6251 </a> … … 6251 6253 </div> 6252 6254 <div class="refsect1" lang="en" xml:lang="en"> 6253 <a xmlns="http://www.w3.org/1999/xhtml" id="id 505134"></a>6255 <a xmlns="http://www.w3.org/1999/xhtml" id="id413084"></a> 6254 6256 <div class="header">Notes:</div> 6255 6257 <p xmlns="http://www.w3.org/1999/xhtml">It would probably be better for <em class="varname">result</em> … … 6257 6259 </p> 6258 6260 <p xmlns="http://www.w3.org/1999/xhtml"> 6259 <span ><strong class="function">Process-interrupt</strong></span> works by sending signals6261 <span class="function"><strong>Process-interrupt</strong></span> works by sending signals 6260 6262 between threads, via the C function 6261 <span ><strong class="function">#_pthread_signal</strong></span>. It could be argued6263 <span class="function"><strong>#_pthread_signal</strong></span>. It could be argued 6262 6264 that it should be done in one of several possible other ways 6263 6265 under … … 6281 6283 <div> 6282 6284 <div class="refsect1" lang="en" xml:lang="en"> 6283 <a xmlns="http://www.w3.org/1999/xhtml" id="id 505189"></a>6285 <a xmlns="http://www.w3.org/1999/xhtml" id="id413143"></a> 6284 6286 <div class="header">Value Type:</div> 6285 6287 <p xmlns="http://www.w3.org/1999/xhtml">A lisp process (thread).</p> 6286 6288 </div> 6287 6289 <div class="refsect1" lang="en" xml:lang="en"> 6288 <a xmlns="http://www.w3.org/1999/xhtml" id="id 505198"></a>6290 <a xmlns="http://www.w3.org/1999/xhtml" id="id413152"></a> 6289 6291 <div class="header">Initial Value:</div> 6290 6292 <p xmlns="http://www.w3.org/1999/xhtml">Bound separately in each process, to that process itself. … … 6292 6294 </div> 6293 6295 <div class="refsect1" lang="en" xml:lang="en"> 6294 <a xmlns="http://www.w3.org/1999/xhtml" id="id 505209"></a>6296 <a xmlns="http://www.w3.org/1999/xhtml" id="id413162"></a> 6295 6297 <div class="header">Description:</div> 6296 6298 <p xmlns="http://www.w3.org/1999/xhtml">Used when lisp code needs to find out what process it is … … 6298 6300 </div> 6299 6301 <div class="refsect1" lang="en" xml:lang="en"> 6300 <a xmlns="http://www.w3.org/1999/xhtml" id="id 505220"></a>6302 <a xmlns="http://www.w3.org/1999/xhtml" id="id413173"></a> 6301 6303 <div class="header">See Also:</div> 6302 6304 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"> 6303 <a href="#f_all-processes" title="Function ALL-PROCESSES">6305 <a class="xref" href="#f_all-processes" title="Function ALL-PROCESSES"> 6304 6306 <b xmlns="http://www.w3.org/TR/xhtml1/transitional">all-processes</b> 6305 6307 </a> … … 6313 6315 <strong>[Function]</strong> 6314 6316 <br></br> 6315 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">process-reset</strong></span>6317 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>process-reset</strong></span> 6316 6318 process <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&optional</em> kill-option => result</code> 6317 6319 </div> … … 6322 6324 <div> 6323 6325 <div class="refsect1" lang="en" xml:lang="en"> 6324 <a xmlns="http://www.w3.org/1999/xhtml" id="id 505273"></a>6326 <a xmlns="http://www.w3.org/1999/xhtml" id="id413235"></a> 6325 6327 <div class="header">Arguments and Values:</div> 6326 6328 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">process</span></i>---a lisp process (thread).</p> … … 6329 6331 </div> 6330 6332 <div class="refsect1" lang="en" xml:lang="en"> 6331 <a xmlns="http://www.w3.org/1999/xhtml" id="id 505321"></a>6333 <a xmlns="http://www.w3.org/1999/xhtml" id="id413283"></a> 6332 6334 <div class="header">Description:</div> 6333 6335 <p xmlns="http://www.w3.org/1999/xhtml">Causes <em class="varname">process</em> to cleanly exit … … 6335 6337 is true, <em class="varname">process</em> then exits. Otherwise, it 6336 6338 enters a state where it can be 6337 <a href="#f_process-preset" title="Function PROCESS-PRESET"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-preset</b></a>. This6339 <a class="xref" href="#f_process-preset" title="Function PROCESS-PRESET"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-preset</b></a>. This 6338 6340 is implemented by signaling a condition of type PROCESS-RESET; 6339 6341 user-defined condition handlers should generally refrain from … … 6345 6347 which has either entered the limbo of the reset state or exited 6346 6348 has few ways of communicating either fact. 6347 <a href="#f_process-enable" title="Function PROCESS-ENABLE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-enable</b></a>6349 <a class="xref" href="#f_process-enable" title="Function PROCESS-ENABLE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-enable</b></a> 6348 6350 can reliably determine when a process has entered 6349 6351 the "limbo of the reset state", but can't predict how long the 6350 6352 clean exit from ongoing computation might take: that depends on 6351 the behavior of <span ><strong class="function">unwind-protect</strong></span> cleanup6353 the behavior of <span class="function"><strong>unwind-protect</strong></span> cleanup 6352 6354 forms, and of the OS scheduler.</p> 6353 6355 <p xmlns="http://www.w3.org/1999/xhtml">Resetting a process other than 6354 <a href="#v_current-process" title="Variable *CURRENT-PROCESS*"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">*current-process*</b></a> involves the6355 use of <a href="#f_process-interrupt" title="Function PROCESS-INTERRUPT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-interrupt</b></a>.</p>6356 </div> 6357 <div class="refsect1" lang="en" xml:lang="en"> 6358 <a xmlns="http://www.w3.org/1999/xhtml" id="id 505383"></a>6356 <a class="xref" href="#v_current-process" title="Variable *CURRENT-PROCESS*"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">*current-process*</b></a> involves the 6357 use of <a class="xref" href="#f_process-interrupt" title="Function PROCESS-INTERRUPT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-interrupt</b></a>.</p> 6358 </div> 6359 <div class="refsect1" lang="en" xml:lang="en"> 6360 <a xmlns="http://www.w3.org/1999/xhtml" id="id413344"></a> 6359 6361 <div class="header">See Also:</div> 6360 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#f_process-kill" title="Function PROCESS-KILL"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-kill</b></a>, <ahref="#f_process-abort" title="Function PROCESS-ABORT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-abort</b></a></span>6362 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#f_process-kill" title="Function PROCESS-KILL"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-kill</b></a>, <a class="xref" href="#f_process-abort" title="Function PROCESS-ABORT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-abort</b></a></span> 6361 6363 </div> 6362 6364 </div> … … 6367 6369 <strong>[Function]</strong> 6368 6370 <br></br> 6369 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">process-kill</strong></span> process6371 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>process-kill</strong></span> process 6370 6372 => result</code> 6371 6373 </div> … … 6376 6378 <div> 6377 6379 <div class="refsect1" lang="en" xml:lang="en"> 6378 <a xmlns="http://www.w3.org/1999/xhtml" id="id 505437"></a>6380 <a xmlns="http://www.w3.org/1999/xhtml" id="id413408"></a> 6379 6381 <div class="header">Arguments and Values:</div> 6380 6382 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">process</span></i>---a lisp process (thread).</p> … … 6382 6384 </div> 6383 6385 <div class="refsect1" lang="en" xml:lang="en"> 6384 <a xmlns="http://www.w3.org/1999/xhtml" id="id 505472"></a>6386 <a xmlns="http://www.w3.org/1999/xhtml" id="id413443"></a> 6385 6387 <div class="header">Description:</div> 6386 6388 <p xmlns="http://www.w3.org/1999/xhtml">Entirely equivalent to calling … … 6389 6391 </div> 6390 6392 <div class="refsect1" lang="en" xml:lang="en"> 6391 <a xmlns="http://www.w3.org/1999/xhtml" id="id 505488"></a>6393 <a xmlns="http://www.w3.org/1999/xhtml" id="id413458"></a> 6392 6394 <div class="header">See Also:</div> 6393 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#f_process-reset" title="Function PROCESS-RESET"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-reset</b></a>, <ahref="#f_process-abort" title="Function PROCESS-ABORT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-abort</b></a></span>6395 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#f_process-reset" title="Function PROCESS-RESET"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-reset</b></a>, <a class="xref" href="#f_process-abort" title="Function PROCESS-ABORT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-abort</b></a></span> 6394 6396 </div> 6395 6397 </div> … … 6400 6402 <strong>[Function]</strong> 6401 6403 <br></br> 6402 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">process-abort</strong></span> process6404 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>process-abort</strong></span> process 6403 6405 <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&optional</em> condition 6404 6406 => NIL</code> … … 6411 6413 <div> 6412 6414 <div class="refsect1" lang="en" xml:lang="en"> 6413 <a xmlns="http://www.w3.org/1999/xhtml" id="id 505548"></a>6415 <a xmlns="http://www.w3.org/1999/xhtml" id="id413530"></a> 6414 6416 <div class="header">Arguments and Values:</div> 6415 6417 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">process</span></i>---a lisp process (thread).</p> … … 6417 6419 </div> 6418 6420 <div class="refsect1" lang="en" xml:lang="en"> 6419 <a xmlns="http://www.w3.org/1999/xhtml" id="id 505583"></a>6421 <a xmlns="http://www.w3.org/1999/xhtml" id="id413565"></a> 6420 6422 <div class="header">Description:</div> 6421 6423 <p xmlns="http://www.w3.org/1999/xhtml">Entirely equivalent to calling 6422 (<a href="#f_process-interrupt" title="Function PROCESS-INTERRUPT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-interrupt</b></a> <em class="varname">process</em>6423 (<span ><strong class="function">lambda</strong></span> ()6424 (<span ><strong class="function">abort</strong></span> <em class="varname">condition</em>))).6424 (<a class="xref" href="#f_process-interrupt" title="Function PROCESS-INTERRUPT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-interrupt</b></a> <em class="varname">process</em> 6425 (<span class="function"><strong>lambda</strong></span> () 6426 (<span class="function"><strong>abort</strong></span> <em class="varname">condition</em>))). 6425 6427 Causes <em class="varname">process</em> to transfer control to the 6426 applicable handler or restart for <span ><strong class="function">abort</strong></span>.</p>6428 applicable handler or restart for <span class="function"><strong>abort</strong></span>.</p> 6427 6429 <p xmlns="http://www.w3.org/1999/xhtml">If <em class="varname">condition</em> is non-NIL, 6428 <span ><strong class="function">process-abort</strong></span> does not consider any6430 <span class="function"><strong>process-abort</strong></span> does not consider any 6429 6431 handlers which are explicitly bound to conditions other than 6430 6432 <em class="varname">condition</em>.</p> 6431 6433 </div> 6432 6434 <div class="refsect1" lang="en" xml:lang="en"> 6433 <a xmlns="http://www.w3.org/1999/xhtml" id="id 505631"></a>6435 <a xmlns="http://www.w3.org/1999/xhtml" id="id413620"></a> 6434 6436 <div class="header">See Also:</div> 6435 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#f_process-reset" title="Function PROCESS-RESET"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-reset</b></a>, <ahref="#f_process-kill" title="Function PROCESS-KILL"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-kill</b></a></span>6437 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#f_process-reset" title="Function PROCESS-RESET"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-reset</b></a>, <a class="xref" href="#f_process-kill" title="Function PROCESS-KILL"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-kill</b></a></span> 6436 6438 </div> 6437 6439 </div> … … 6450 6452 <div> 6451 6453 <div class="refsect1" lang="en" xml:lang="en"> 6452 <a xmlns="http://www.w3.org/1999/xhtml" id="id 505676"></a>6454 <a xmlns="http://www.w3.org/1999/xhtml" id="id413672"></a> 6453 6455 <div class="header">Value Type:</div> 6454 6456 <p xmlns="http://www.w3.org/1999/xhtml">A positive integer.</p> 6455 6457 </div> 6456 6458 <div class="refsect1" lang="en" xml:lang="en"> 6457 <a xmlns="http://www.w3.org/1999/xhtml" id="id 505685"></a>6459 <a xmlns="http://www.w3.org/1999/xhtml" id="id413681"></a> 6458 6460 <div class="header">Initial Value:</div> 6459 6461 <p xmlns="http://www.w3.org/1999/xhtml">The clock resolution of the OS scheduler. Currently, … … 6462 6464 </div> 6463 6465 <div class="refsect1" lang="en" xml:lang="en"> 6464 <a xmlns="http://www.w3.org/1999/xhtml" id="id 505697"></a>6466 <a xmlns="http://www.w3.org/1999/xhtml" id="id413692"></a> 6465 6467 <div class="header">Description:</div> 6466 6468 <p xmlns="http://www.w3.org/1999/xhtml">This value is ordinarily of marginal interest at best, … … 6470 6472 </div> 6471 6473 <div class="refsect1" lang="en" xml:lang="en"> 6472 <a xmlns="http://www.w3.org/1999/xhtml" id="id 505710"></a>6474 <a xmlns="http://www.w3.org/1999/xhtml" id="id413704"></a> 6473 6475 <div class="header">See Also:</div> 6474 6476 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"> 6475 <a href="#f_process-wait-with-timeout" title="Function PROCESS-WAIT-WITH-TIMEOUT">6477 <a class="xref" href="#f_process-wait-with-timeout" title="Function PROCESS-WAIT-WITH-TIMEOUT"> 6476 6478 <b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-wait-with-timeout</b> 6477 6479 </a> … … 6485 6487 <strong>[Function]</strong> 6486 6488 <br></br> 6487 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">process-whostate</strong></span> process6489 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>process-whostate</strong></span> process 6488 6490 => whostate</code> 6489 6491 </div> … … 6494 6496 <div> 6495 6497 <div class="refsect1" lang="en" xml:lang="en"> 6496 <a xmlns="http://www.w3.org/1999/xhtml" id="id 505793"></a>6498 <a xmlns="http://www.w3.org/1999/xhtml" id="id413794"></a> 6497 6499 <div class="header">Description:</div> 6498 6500 <p xmlns="http://www.w3.org/1999/xhtml">This information is primarily for the benefit of … … 6501 6503 and why.</p> 6502 6504 <p xmlns="http://www.w3.org/1999/xhtml">If the process is currently waiting in a call to 6503 <a href="#f_process-wait" title="Function PROCESS-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-wait</b></a> or6504 <a href="#f_process-wait-with-timeout" title="Function PROCESS-WAIT-WITH-TIMEOUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-wait-with-timeout</b></a>, its6505 <span ><strong class="function">process-whostate</strong></span> will be the value6505 <a class="xref" href="#f_process-wait" title="Function PROCESS-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-wait</b></a> or 6506 <a class="xref" href="#f_process-wait-with-timeout" title="Function PROCESS-WAIT-WITH-TIMEOUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-wait-with-timeout</b></a>, its 6507 <span class="function"><strong>process-whostate</strong></span> will be the value 6506 6508 which was passed to that function as <em class="varname">whostate</em>. 6507 6509 </p> 6508 6510 </div> 6509 6511 <div class="refsect1" lang="en" xml:lang="en"> 6510 <a xmlns="http://www.w3.org/1999/xhtml" id="id 505828"></a>6512 <a xmlns="http://www.w3.org/1999/xhtml" id="id413832"></a> 6511 6513 <div class="header">See Also:</div> 6512 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#f_process-wait" title="Function PROCESS-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-wait</b></a>, <a href="#f_process-wait-with-timeout" title="Function PROCESS-WAIT-WITH-TIMEOUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-wait-with-timeout</b></a>, <ahref="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span>6513 </div> 6514 <div class="refsect1" lang="en" xml:lang="en"> 6515 <a xmlns="http://www.w3.org/1999/xhtml" id="id 505852"></a>6514 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#f_process-wait" title="Function PROCESS-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-wait</b></a>, <a class="xref" href="#f_process-wait-with-timeout" title="Function PROCESS-WAIT-WITH-TIMEOUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-wait-with-timeout</b></a>, <a class="xref" href="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span> 6515 </div> 6516 <div class="refsect1" lang="en" xml:lang="en"> 6517 <a xmlns="http://www.w3.org/1999/xhtml" id="id413859"></a> 6516 6518 <div class="header">Notes:</div> 6517 6519 <p xmlns="http://www.w3.org/1999/xhtml">This should arguably be SETFable, but doesn't seem to … … 6526 6528 <br></br> 6527 6529 <code> 6528 <span xmlns="http://www.w3.org/1999/xhtml" >6529 <strong class="function">process-allow-schedule</strong>6530 <span xmlns="http://www.w3.org/1999/xhtml" class="function"> 6531 <strong>process-allow-schedule</strong> 6530 6532 </span> 6531 6533 </code> … … 6537 6539 <div> 6538 6540 <div class="refsect1" lang="en" xml:lang="en"> 6539 <a xmlns="http://www.w3.org/1999/xhtml" id="id 505896"></a>6541 <a xmlns="http://www.w3.org/1999/xhtml" id="id413910"></a> 6540 6542 <div class="header">Description:</div> 6541 6543 <p xmlns="http://www.w3.org/1999/xhtml">Advises the OS scheduler that the current thread has nothing … … 6546 6548 </div> 6547 6549 <div class="refsect1" lang="en" xml:lang="en"> 6548 <a xmlns="http://www.w3.org/1999/xhtml" id="id 505911"></a>6550 <a xmlns="http://www.w3.org/1999/xhtml" id="id413923"></a> 6549 6551 <div class="header">See Also:</div> 6550 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <ahref="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span>6551 </div> 6552 <div class="refsect1" lang="en" xml:lang="en"> 6553 <a xmlns="http://www.w3.org/1999/xhtml" id="id 505947"></a>6552 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a class="xref" href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a class="xref" href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a class="xref" href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a class="xref" href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <a class="xref" href="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span> 6553 </div> 6554 <div class="refsect1" lang="en" xml:lang="en"> 6555 <a xmlns="http://www.w3.org/1999/xhtml" id="id413965"></a> 6554 6556 <div class="header">Notes:</div> 6555 6557 <p xmlns="http://www.w3.org/1999/xhtml">This is a holdover from the days of cooperative … … 6564 6566 <strong>[Function]</strong> 6565 6567 <br></br> 6566 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">process-wait</strong></span>6568 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>process-wait</strong></span> 6567 6569 whostate function <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&rest</em> args => result</code> 6568 6570 </div> … … 6574 6576 <div> 6575 6577 <div class="refsect1" lang="en" xml:lang="en"> 6576 <a xmlns="http://www.w3.org/1999/xhtml" id="id 505998"></a>6578 <a xmlns="http://www.w3.org/1999/xhtml" id="id414021"></a> 6577 6579 <div class="header">Arguments and Values:</div> 6578 6580 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">whostate</span></i>---a string, which will be the value of 6579 <a xmlns="http://www.w3.org/1999/xhtml" href="#f_process-whostate" title="Function PROCESS-WHOSTATE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-whostate</b></a>6581 <a xmlns="http://www.w3.org/1999/xhtml" class="xref" href="#f_process-whostate" title="Function PROCESS-WHOSTATE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-whostate</b></a> 6580 6582 while the process is waiting.</p> 6581 6583 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">function</span></i>---a function, designated by itself or by a symbol … … 6587 6589 </div> 6588 6590 <div class="refsect1" lang="en" xml:lang="en"> 6589 <a xmlns="http://www.w3.org/1999/xhtml" id="id 506068"></a>6591 <a xmlns="http://www.w3.org/1999/xhtml" id="id414091"></a> 6590 6592 <div class="header">Description:</div> 6591 6593 <p xmlns="http://www.w3.org/1999/xhtml">Causes the current lisp process (thread) to repeatedly … … 6594 6596 returns NIL. After 6595 6597 each failed call, yields the CPU as if by 6596 <a href="#f_process-allow-schedule" title="Function PROCESS-ALLOW-SCHEDULE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-allow-schedule</b></a>.</p>6598 <a class="xref" href="#f_process-allow-schedule" title="Function PROCESS-ALLOW-SCHEDULE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-allow-schedule</b></a>.</p> 6597 6599 <p xmlns="http://www.w3.org/1999/xhtml"> 6598 As with <a href="#f_process-allow-schedule" title="Function PROCESS-ALLOW-SCHEDULE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-allow-schedule</b></a>, it's almost6600 As with <a class="xref" href="#f_process-allow-schedule" title="Function PROCESS-ALLOW-SCHEDULE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-allow-schedule</b></a>, it's almost 6599 6601 always more efficient to wait for some 6600 6602 specific event to occur; this isn't exactly busy-waiting, but … … 6604 6606 </div> 6605 6607 <div class="refsect1" lang="en" xml:lang="en"> 6606 <a xmlns="http://www.w3.org/1999/xhtml" id="id 506102"></a>6608 <a xmlns="http://www.w3.org/1999/xhtml" id="id414123"></a> 6607 6609 <div class="header">See Also:</div> 6608 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#f_process-whostate" title="Function PROCESS-WHOSTATE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-whostate</b></a>, <a href="#f_process-wait-with-timeout" title="Function PROCESS-WAIT-WITH-TIMEOUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-wait-with-timeout</b></a>, <a href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <ahref="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span>6610 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#f_process-whostate" title="Function PROCESS-WHOSTATE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-whostate</b></a>, <a class="xref" href="#f_process-wait-with-timeout" title="Function PROCESS-WAIT-WITH-TIMEOUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-wait-with-timeout</b></a>, <a class="xref" href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a class="xref" href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a class="xref" href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a class="xref" href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a class="xref" href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <a class="xref" href="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span> 6609 6611 </div> 6610 6612 </div> … … 6615 6617 <strong>[Function]</strong> 6616 6618 <br></br> 6617 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">process-wait-with-timeout</strong></span>6619 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>process-wait-with-timeout</strong></span> 6618 6620 whostate ticks function args => result</code> 6619 6621 </div> … … 6624 6626 <div> 6625 6627 <div class="refsect1" lang="en" xml:lang="en"> 6626 <a xmlns="http://www.w3.org/1999/xhtml" id="id 506181"></a>6628 <a xmlns="http://www.w3.org/1999/xhtml" id="id414218"></a> 6627 6629 <div class="header">Arguments and Values:</div> 6628 6630 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">whostate</span></i>---a string, which will be the value of 6629 <a xmlns="http://www.w3.org/1999/xhtml" href="#f_process-whostate" title="Function PROCESS-WHOSTATE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-whostate</b></a>6631 <a xmlns="http://www.w3.org/1999/xhtml" class="xref" href="#f_process-whostate" title="Function PROCESS-WHOSTATE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-whostate</b></a> 6630 6632 while the process is waiting.</p> 6631 6633 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">ticks</span></i>---either a positive integer expressing a duration 6632 in "ticks" (see <a xmlns="http://www.w3.org/1999/xhtml" href="#v_ticks-per-second" title="Variable *TICKS-PER-SECOND*"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">*ticks-per-second*</b></a>),6634 in "ticks" (see <a xmlns="http://www.w3.org/1999/xhtml" class="xref" href="#v_ticks-per-second" title="Variable *TICKS-PER-SECOND*"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">*ticks-per-second*</b></a>), 6633 6635 or NIL.</p> 6634 6636 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">function</span></i>---a function, designated by itself or by a symbol … … 6636 6638 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">args</span></i>---a list of values, appropriate as arguments to 6637 6639 <em xmlns="http://www.w3.org/1999/xhtml" class="varname">function</em>.</p> 6638 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">result</span></i>---T if <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">process-wait-with-timeout</strong></span>6640 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">result</span></i>---T if <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>process-wait-with-timeout</strong></span> 6639 6641 returned because its <em xmlns="http://www.w3.org/1999/xhtml" class="varname">function</em> returned 6640 6642 true, or NIL if it returned because the duration … … 6642 6644 </div> 6643 6645 <div class="refsect1" lang="en" xml:lang="en"> 6644 <a xmlns="http://www.w3.org/1999/xhtml" id="id 506279"></a>6646 <a xmlns="http://www.w3.org/1999/xhtml" id="id414318"></a> 6645 6647 <div class="header">Description:</div> 6646 6648 <p xmlns="http://www.w3.org/1999/xhtml">If <em class="varname">ticks</em> is NIL, behaves exactly like 6647 <a href="#f_process-wait" title="Function PROCESS-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-wait</b></a>, except for returning T.6649 <a class="xref" href="#f_process-wait" title="Function PROCESS-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-wait</b></a>, except for returning T. 6648 6650 Otherwise, <em class="varname">function</em> will be tested repeatedly, 6649 6651 in the same 6650 kind of test/yield loop as in <a href="#f_process-wait" title="Function PROCESS-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-wait</b></a>>6652 kind of test/yield loop as in <a class="xref" href="#f_process-wait" title="Function PROCESS-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-wait</b></a>> 6651 6653 until either <em class="varname">function</em> returns true, 6652 6654 or the duration <em class="varname">ticks</em> has been exceeded. 6653 6655 </p> 6654 6656 <p xmlns="http://www.w3.org/1999/xhtml"> Having already read the descriptions of 6655 <a href="#f_process-allow-schedule" title="Function PROCESS-ALLOW-SCHEDULE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-allow-schedule</b></a> and6656 <a href="#f_process-wait" title="Function PROCESS-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-wait</b></a>, the6657 <a class="xref" href="#f_process-allow-schedule" title="Function PROCESS-ALLOW-SCHEDULE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-allow-schedule</b></a> and 6658 <a class="xref" href="#f_process-wait" title="Function PROCESS-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-wait</b></a>, the 6657 6659 astute reader has no doubt anticipated the observation that 6658 6660 better alternatives should be used whenever possible.</p> 6659 6661 </div> 6660 6662 <div class="refsect1" lang="en" xml:lang="en"> 6661 <a xmlns="http://www.w3.org/1999/xhtml" id="id 506323"></a>6663 <a xmlns="http://www.w3.org/1999/xhtml" id="id414362"></a> 6662 6664 <div class="header">See Also:</div> 6663 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#v_ticks-per-second" title="Variable *TICKS-PER-SECOND*"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">*ticks-per-second*</b></a>, <a href="#f_process-whostate" title="Function PROCESS-WHOSTATE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-whostate</b></a>, <a href="#f_process-wait" title="Function PROCESS-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-wait</b></a>, <a href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <ahref="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span>6665 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#v_ticks-per-second" title="Variable *TICKS-PER-SECOND*"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">*ticks-per-second*</b></a>, <a class="xref" href="#f_process-whostate" title="Function PROCESS-WHOSTATE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-whostate</b></a>, <a class="xref" href="#f_process-wait" title="Function PROCESS-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-wait</b></a>, <a class="xref" href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a class="xref" href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a class="xref" href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a class="xref" href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a class="xref" href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <a class="xref" href="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span> 6664 6666 </div> 6665 6667 </div> … … 6670 6672 <strong>[Macro]</strong> 6671 6673 <br></br> 6672 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">without-interrupts</strong></span>6674 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>without-interrupts</strong></span> 6673 6675 <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&body</em> body => result</code> 6674 6676 </div> … … 6679 6681 <div> 6680 6682 <div class="refsect1" lang="en" xml:lang="en"> 6681 <a xmlns="http://www.w3.org/1999/xhtml" id="id 506410"></a>6683 <a xmlns="http://www.w3.org/1999/xhtml" id="id414465"></a> 6682 6684 <div class="header">Arguments and Values:</div> 6683 6685 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">body</span></i>---an implicit progn.</p> … … 6686 6688 </div> 6687 6689 <div class="refsect1" lang="en" xml:lang="en"> 6688 <a xmlns="http://www.w3.org/1999/xhtml" id="id 506448"></a>6690 <a xmlns="http://www.w3.org/1999/xhtml" id="id414504"></a> 6689 6691 <div class="header">Description:</div> 6690 6692 <p xmlns="http://www.w3.org/1999/xhtml">Executes <em class="varname">body</em> 6691 in an environment in which <a href="#f_process-interrupt" title="Function PROCESS-INTERRUPT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-interrupt</b></a>6693 in an environment in which <a class="xref" href="#f_process-interrupt" title="Function PROCESS-INTERRUPT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-interrupt</b></a> 6692 6694 requests are 6693 6695 deferred. As noted in the description of 6694 <a href="#f_process-interrupt" title="Function PROCESS-INTERRUPT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-interrupt</b></a>, this has nothing to do6696 <a class="xref" href="#f_process-interrupt" title="Function PROCESS-INTERRUPT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-interrupt</b></a>, this has nothing to do 6695 6697 with the 6696 6698 scheduling of other threads; it may be necessary to inhibit 6697 <a href="#f_process-interrupt" title="Function PROCESS-INTERRUPT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-interrupt</b></a> handling when6699 <a class="xref" href="#f_process-interrupt" title="Function PROCESS-INTERRUPT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-interrupt</b></a> handling when 6698 6700 (for instance) modifying some data 6699 6701 structure (for which the current thread holds an appropriate lock) … … 6701 6703 </div> 6702 6704 <div class="refsect1" lang="en" xml:lang="en"> 6703 <a xmlns="http://www.w3.org/1999/xhtml" id="id 506477"></a>6705 <a xmlns="http://www.w3.org/1999/xhtml" id="id414532"></a> 6704 6706 <div class="header">See Also:</div> 6705 6707 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"> 6706 <a href="#f_process-interrupt" title="Function PROCESS-INTERRUPT">6708 <a class="xref" href="#f_process-interrupt" title="Function PROCESS-INTERRUPT"> 6707 6709 <b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-interrupt</b> 6708 6710 </a> … … 6716 6718 <strong>[Function]</strong> 6717 6719 <br></br> 6718 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">make-lock</strong></span> <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&optional</em>6720 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>make-lock</strong></span> <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&optional</em> 6719 6721 name => lock</code> 6720 6722 </div> … … 6725 6727 <div> 6726 6728 <div class="refsect1" lang="en" xml:lang="en"> 6727 <a xmlns="http://www.w3.org/1999/xhtml" id="id 506530"></a>6729 <a xmlns="http://www.w3.org/1999/xhtml" id="id414594"></a> 6728 6730 <div class="header">Arguments and Values:</div> 6729 6731 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">name</span></i>---any lisp object; saved as part of 6730 6732 <em xmlns="http://www.w3.org/1999/xhtml" class="varname">lock</em>. Typically a string or symbol 6731 which may appear in the <a xmlns="http://www.w3.org/1999/xhtml" href="#f_process-whostate" title="Function PROCESS-WHOSTATE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-whostate</b></a>s6733 which may appear in the <a xmlns="http://www.w3.org/1999/xhtml" class="xref" href="#f_process-whostate" title="Function PROCESS-WHOSTATE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-whostate</b></a>s 6732 6734 of threads which are waiting for <em xmlns="http://www.w3.org/1999/xhtml" class="varname">lock</em>. 6733 6735 </p> … … 6735 6737 </div> 6736 6738 <div class="refsect1" lang="en" xml:lang="en"> 6737 <a xmlns="http://www.w3.org/1999/xhtml" id="id 506848"></a>6739 <a xmlns="http://www.w3.org/1999/xhtml" id="id414641"></a> 6738 6740 <div class="header">Description:</div> 6739 6741 <p xmlns="http://www.w3.org/1999/xhtml">Creates and returns a lock object, which can … … 6745 6747 </div> 6746 6748 <div class="refsect1" lang="en" xml:lang="en"> 6747 <a xmlns="http://www.w3.org/1999/xhtml" id="id 506864"></a>6749 <a xmlns="http://www.w3.org/1999/xhtml" id="id414656"></a> 6748 6750 <div class="header">See Also:</div> 6749 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#m_with-lock-grabbed" title="Macro WITH-LOCK-GRABBED"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-lock-grabbed</b></a>, <a href="#f_grab-lock" title="Function GRAB-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">grab-lock</b></a>, <a href="#f_release-lock" title="Function RELEASE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">release-lock</b></a>, <a href="#f_try-lock" title="Function TRY-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">try-lock</b></a>, <a href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <ahref="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span>6751 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#m_with-lock-grabbed" title="Macro WITH-LOCK-GRABBED"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-lock-grabbed</b></a>, <a class="xref" href="#f_grab-lock" title="Function GRAB-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">grab-lock</b></a>, <a class="xref" href="#f_release-lock" title="Function RELEASE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">release-lock</b></a>, <a class="xref" href="#f_try-lock" title="Function TRY-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">try-lock</b></a>, <a class="xref" href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a class="xref" href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a class="xref" href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a class="xref" href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <a class="xref" href="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span> 6750 6752 </div> 6751 6753 </div> … … 6756 6758 <strong>[Macro]</strong> 6757 6759 <br></br> 6758 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">with-lock-grabbed</strong></span>6760 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>with-lock-grabbed</strong></span> 6759 6761 (lock) <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&body</em> body</code> 6760 6762 </div> … … 6765 6767 <div> 6766 6768 <div class="refsect1" lang="en" xml:lang="en"> 6767 <a xmlns="http://www.w3.org/1999/xhtml" id="id 506951"></a>6769 <a xmlns="http://www.w3.org/1999/xhtml" id="id414759"></a> 6768 6770 <div class="header">Arguments and Values:</div> 6769 6771 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">lock</span></i>---an object of type CCL:LOCK.</p> … … 6773 6775 </div> 6774 6776 <div class="refsect1" lang="en" xml:lang="en"> 6775 <a xmlns="http://www.w3.org/1999/xhtml" id="id 507002"></a>6777 <a xmlns="http://www.w3.org/1999/xhtml" id="id414810"></a> 6776 6778 <div class="header">Description:</div> 6777 6779 <p xmlns="http://www.w3.org/1999/xhtml">Waits until <em class="varname">lock</em> is either free or … … 6779 6781 thread, then executes <em class="varname">body</em> with the 6780 6782 lock owned by the calling thread. If <em class="varname">lock</em> 6781 was free when <span ><strong class="function">with-lock-grabbed</strong></span> was called,6783 was free when <span class="function"><strong>with-lock-grabbed</strong></span> was called, 6782 6784 it is restored to a free state after <em class="varname">body</em> 6783 6785 is executed.</p> 6784 6786 </div> 6785 6787 <div class="refsect1" lang="en" xml:lang="en"> 6786 <a xmlns="http://www.w3.org/1999/xhtml" id="id 507032"></a>6788 <a xmlns="http://www.w3.org/1999/xhtml" id="id414839"></a> 6787 6789 <div class="header">See Also:</div> 6788 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a href="#f_grab-lock" title="Function GRAB-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">grab-lock</b></a>, <a href="#f_release-lock" title="Function RELEASE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">release-lock</b></a>, <a href="#f_try-lock" title="Function TRY-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">try-lock</b></a>, <a href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <ahref="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span>6790 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a class="xref" href="#f_grab-lock" title="Function GRAB-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">grab-lock</b></a>, <a class="xref" href="#f_release-lock" title="Function RELEASE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">release-lock</b></a>, <a class="xref" href="#f_try-lock" title="Function TRY-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">try-lock</b></a>, <a class="xref" href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a class="xref" href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a class="xref" href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a class="xref" href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <a class="xref" href="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span> 6789 6791 </div> 6790 6792 </div> … … 6795 6797 <strong>[Function]</strong> 6796 6798 <br></br> 6797 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">grab-lock</strong></span> lock</code>6799 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>grab-lock</strong></span> lock</code> 6798 6800 </div> 6799 6801 <div class="refentrytitle">Waits until a given lock can be obtained, then … … 6803 6805 <div> 6804 6806 <div class="refsect1" lang="en" xml:lang="en"> 6805 <a xmlns="http://www.w3.org/1999/xhtml" id="id 507115"></a>6807 <a xmlns="http://www.w3.org/1999/xhtml" id="id414939"></a> 6806 6808 <div class="header">Arguments and Values:</div> 6807 6809 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">lock</span></i>---an object of type CCL:LOCK.</p> 6808 6810 </div> 6809 6811 <div class="refsect1" lang="en" xml:lang="en"> 6810 <a xmlns="http://www.w3.org/1999/xhtml" id="id 507137"></a>6812 <a xmlns="http://www.w3.org/1999/xhtml" id="id414962"></a> 6811 6813 <div class="header">Description:</div> 6812 6814 <p xmlns="http://www.w3.org/1999/xhtml">Blocks until <em class="varname">lock</em> is owned by the 6813 6815 calling thread.</p> 6814 <p xmlns="http://www.w3.org/1999/xhtml">The macro <a href="#m_with-lock-grabbed" title="Macro WITH-LOCK-GRABBED"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-lock-grabbed</b></a>6816 <p xmlns="http://www.w3.org/1999/xhtml">The macro <a class="xref" href="#m_with-lock-grabbed" title="Macro WITH-LOCK-GRABBED"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-lock-grabbed</b></a> 6815 6817 <span class="emphasis"><em>could</em></span> be defined in 6816 terms of <span ><strong class="function">grab-lock</strong></span> and6817 <a href="#f_release-lock" title="Function RELEASE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">release-lock</b></a>, but it is actually6818 terms of <span class="function"><strong>grab-lock</strong></span> and 6819 <a class="xref" href="#f_release-lock" title="Function RELEASE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">release-lock</b></a>, but it is actually 6818 6820 implemented at a slightly lower level.</p> 6819 6821 </div> 6820 6822 <div class="refsect1" lang="en" xml:lang="en"> 6821 <a xmlns="http://www.w3.org/1999/xhtml" id="id 507168"></a>6823 <a xmlns="http://www.w3.org/1999/xhtml" id="id414995"></a> 6822 6824 <div class="header">See Also:</div> 6823 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a href="#m_with-lock-grabbed" title="Macro WITH-LOCK-GRABBED"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-lock-grabbed</b></a>, <a href="#f_release-lock" title="Function RELEASE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">release-lock</b></a>, <a href="#f_try-lock" title="Function TRY-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">try-lock</b></a>, <a href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <ahref="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span>6825 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a class="xref" href="#m_with-lock-grabbed" title="Macro WITH-LOCK-GRABBED"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-lock-grabbed</b></a>, <a class="xref" href="#f_release-lock" title="Function RELEASE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">release-lock</b></a>, <a class="xref" href="#f_try-lock" title="Function TRY-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">try-lock</b></a>, <a class="xref" href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a class="xref" href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a class="xref" href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a class="xref" href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <a class="xref" href="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span> 6824 6826 </div> 6825 6827 </div> … … 6830 6832 <strong>[Function]</strong> 6831 6833 <br></br> 6832 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">release-lock</strong></span> lock</code>6834 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>release-lock</strong></span> lock</code> 6833 6835 </div> 6834 6836 <div class="refentrytitle">Relinquishes ownership of a given lock.</div> … … 6837 6839 <div> 6838 6840 <div class="refsect1" lang="en" xml:lang="en"> 6839 <a xmlns="http://www.w3.org/1999/xhtml" id="id 507250"></a>6841 <a xmlns="http://www.w3.org/1999/xhtml" id="id415094"></a> 6840 6842 <div class="header">Arguments and Values:</div> 6841 6843 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">lock</span></i>---an object of type CCL:LOCK.</p> 6842 6844 </div> 6843 6845 <div class="refsect1" lang="en" xml:lang="en"> 6844 <a xmlns="http://www.w3.org/1999/xhtml" id="id 507272"></a>6846 <a xmlns="http://www.w3.org/1999/xhtml" id="id415117"></a> 6845 6847 <div class="header">Description:</div> 6846 6848 <p xmlns="http://www.w3.org/1999/xhtml">Signals an error of type CCL:LOCK-NOT-OWNER if … … 6848 6850 is not already owned by the calling thread; otherwise, undoes the 6849 6851 effect of one previous 6850 <a href="#f_grab-lock" title="Function GRAB-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">grab-lock</b></a>. If this means that6851 <span ><strong class="function">release-lock</strong></span> has now been called on6852 <a class="xref" href="#f_grab-lock" title="Function GRAB-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">grab-lock</b></a>. If this means that 6853 <span class="function"><strong>release-lock</strong></span> has now been called on 6852 6854 <em class="varname">lock</em> the same number of times as 6853 <a href="#f_grab-lock" title="Function GRAB-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">grab-lock</b></a> has, <em class="varname">lock</em>6855 <a class="xref" href="#f_grab-lock" title="Function GRAB-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">grab-lock</b></a> has, <em class="varname">lock</em> 6854 6856 becomes free.</p> 6855 6857 </div> 6856 6858 <div class="refsect1" lang="en" xml:lang="en"> 6857 <a xmlns="http://www.w3.org/1999/xhtml" id="id 507304"></a>6859 <a xmlns="http://www.w3.org/1999/xhtml" id="id415150"></a> 6858 6860 <div class="header">See Also:</div> 6859 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a href="#m_with-lock-grabbed" title="Macro WITH-LOCK-GRABBED"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-lock-grabbed</b></a>, <a href="#f_grab-lock" title="Function GRAB-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">grab-lock</b></a>, <a href="#f_try-lock" title="Function TRY-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">try-lock</b></a>, <a href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <ahref="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span>6861 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a class="xref" href="#m_with-lock-grabbed" title="Macro WITH-LOCK-GRABBED"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-lock-grabbed</b></a>, <a class="xref" href="#f_grab-lock" title="Function GRAB-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">grab-lock</b></a>, <a class="xref" href="#f_try-lock" title="Function TRY-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">try-lock</b></a>, <a class="xref" href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a class="xref" href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a class="xref" href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a class="xref" href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <a class="xref" href="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span> 6860 6862 </div> 6861 6863 </div> … … 6866 6868 <strong>[Function]</strong> 6867 6869 <br></br> 6868 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">try-lock</strong></span> lock => result</code>6870 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>try-lock</strong></span> lock => result</code> 6869 6871 </div> 6870 6872 <div class="refentrytitle">Obtains the given lock, but only if it is not … … 6874 6876 <div> 6875 6877 <div class="refsect1" lang="en" xml:lang="en"> 6876 <a xmlns="http://www.w3.org/1999/xhtml" id="id 507388"></a>6878 <a xmlns="http://www.w3.org/1999/xhtml" id="id415251"></a> 6877 6879 <div class="header">Arguments and Values:</div> 6878 6880 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">lock</span></i>---an object of type CCL:LOCK.</p> … … 6881 6883 </div> 6882 6884 <div class="refsect1" lang="en" xml:lang="en"> 6883 <a xmlns="http://www.w3.org/1999/xhtml" id="id 507427"></a>6885 <a xmlns="http://www.w3.org/1999/xhtml" id="id415289"></a> 6884 6886 <div class="header">Description:</div> 6885 6887 <p xmlns="http://www.w3.org/1999/xhtml">Tests whether <em class="varname">lock</em> 6886 6888 can be obtained without blocking - that is, either 6887 6889 <em class="varname">lock</em> is already free, or it is already owned 6888 by <a href="#v_current-process" title="Variable *CURRENT-PROCESS*"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">*current-process*</b></a>. If it can,6890 by <a class="xref" href="#v_current-process" title="Variable *CURRENT-PROCESS*"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">*current-process*</b></a>. If it can, 6889 6891 causes it to 6890 6892 be owned by the calling lisp process (thread) and returns T. … … 6894 6896 </div> 6895 6897 <div class="refsect1" lang="en" xml:lang="en"> 6896 <a xmlns="http://www.w3.org/1999/xhtml" id="id 507453"></a>6898 <a xmlns="http://www.w3.org/1999/xhtml" id="id415312"></a> 6897 6899 <div class="header">See Also:</div> 6898 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a href="#m_with-lock-grabbed" title="Macro WITH-LOCK-GRABBED"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-lock-grabbed</b></a>, <a href="#f_grab-lock" title="Function GRAB-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">grab-lock</b></a>, <a href="#f_release-lock" title="Function RELEASE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">release-lock</b></a>, <a href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <ahref="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span>6900 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a class="xref" href="#m_with-lock-grabbed" title="Macro WITH-LOCK-GRABBED"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-lock-grabbed</b></a>, <a class="xref" href="#f_grab-lock" title="Function GRAB-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">grab-lock</b></a>, <a class="xref" href="#f_release-lock" title="Function RELEASE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">release-lock</b></a>, <a class="xref" href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a class="xref" href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a class="xref" href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a class="xref" href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <a class="xref" href="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span> 6899 6901 </div> 6900 6902 </div> … … 6905 6907 <strong>[Function]</strong> 6906 6908 <br></br> 6907 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">make-read-write-lock</strong></span>6909 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>make-read-write-lock</strong></span> 6908 6910 => read-write-lock</code> 6909 6911 </div> … … 6914 6916 <div> 6915 6917 <div class="refsect1" lang="en" xml:lang="en"> 6916 <a xmlns="http://www.w3.org/1999/xhtml" id="id 507537"></a>6918 <a xmlns="http://www.w3.org/1999/xhtml" id="id415412"></a> 6917 6919 <div class="header">Arguments and Values:</div> 6918 6920 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">read-write-lock</span></i>---a newly-allocated object of type … … 6920 6922 </div> 6921 6923 <div class="refsect1" lang="en" xml:lang="en"> 6922 <a xmlns="http://www.w3.org/1999/xhtml" id="id 507560"></a>6924 <a xmlns="http://www.w3.org/1999/xhtml" id="id415435"></a> 6923 6925 <div class="header">Description:</div> 6924 6926 <p xmlns="http://www.w3.org/1999/xhtml">Creates and returns an object of type CCL::READ-WRITE-LOCK. … … 6931 6933 </div> 6932 6934 <div class="refsect1" lang="en" xml:lang="en"> 6933 <a xmlns="http://www.w3.org/1999/xhtml" id="id 507580"></a>6935 <a xmlns="http://www.w3.org/1999/xhtml" id="id415451"></a> 6934 6936 <div class="header">See Also:</div> 6935 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#m_with-read-lock" title="Macro WITH-READ-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-read-lock</b></a>, <a href="#m_with-write-lock" title="Macro WITH-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-write-lock</b></a>, <a href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <ahref="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span>6936 </div> 6937 <div class="refsect1" lang="en" xml:lang="en"> 6938 <a xmlns="http://www.w3.org/1999/xhtml" id="id 507620"></a>6937 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#m_with-read-lock" title="Macro WITH-READ-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-read-lock</b></a>, <a class="xref" href="#m_with-write-lock" title="Macro WITH-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-write-lock</b></a>, <a class="xref" href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a class="xref" href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a class="xref" href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a class="xref" href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <a class="xref" href="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span> 6938 </div> 6939 <div class="refsect1" lang="en" xml:lang="en"> 6940 <a xmlns="http://www.w3.org/1999/xhtml" id="id415499"></a> 6939 6941 <div class="header">Notes:</div> 6940 6942 <p xmlns="http://www.w3.org/1999/xhtml">There probably should be some way to … … 6949 6951 <strong>[Macro]</strong> 6950 6952 <br></br> 6951 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">with-read-lock</strong></span>6953 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>with-read-lock</strong></span> 6952 6954 (read-write-lock) <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&body</em> body => result</code> 6953 6955 </div> … … 6959 6961 <div> 6960 6962 <div class="refsect1" lang="en" xml:lang="en"> 6961 <a xmlns="http://www.w3.org/1999/xhtml" id="id 507671"></a>6963 <a xmlns="http://www.w3.org/1999/xhtml" id="id415556"></a> 6962 6964 <div class="header">Arguments and Values:</div> 6963 6965 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">read-write-lock</span></i>---an object of type … … 6968 6970 </div> 6969 6971 <div class="refsect1" lang="en" xml:lang="en"> 6970 <a xmlns="http://www.w3.org/1999/xhtml" id="id 507723"></a>6972 <a xmlns="http://www.w3.org/1999/xhtml" id="id415607"></a> 6971 6973 <div class="header">Description:</div> 6972 6974 <p xmlns="http://www.w3.org/1999/xhtml">Waits until <em class="varname">read-write-lock</em> has no 6973 6975 writer, 6974 ensures that <a href="#v_current-process" title="Variable *CURRENT-PROCESS*"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">*current-process*</b></a> is a6976 ensures that <a class="xref" href="#v_current-process" title="Variable *CURRENT-PROCESS*"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">*current-process*</b></a> is a 6975 6977 reader of it, then executes <em class="varname">body</em>. 6976 6978 </p> 6977 6979 <p xmlns="http://www.w3.org/1999/xhtml">After executing <em class="varname">body</em>, if 6978 <a href="#v_current-process" title="Variable *CURRENT-PROCESS*"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">*current-process*</b></a> was not a reader of6980 <a class="xref" href="#v_current-process" title="Variable *CURRENT-PROCESS*"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">*current-process*</b></a> was not a reader of 6979 6981 <em class="varname">read-write-lock</em> before 6980 <span ><strong class="function">with-read-lock</strong></span> was called, the lock is6982 <span class="function"><strong>with-read-lock</strong></span> was called, the lock is 6981 6983 released. If it was already a reader, it remains one.</p> 6982 6984 </div> 6983 6985 <div class="refsect1" lang="en" xml:lang="en"> 6984 <a xmlns="http://www.w3.org/1999/xhtml" id="id 507760"></a>6986 <a xmlns="http://www.w3.org/1999/xhtml" id="id415647"></a> 6985 6987 <div class="header">See Also:</div> 6986 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a href="#m_with-write-lock" title="Macro WITH-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-write-lock</b></a>, <a href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <ahref="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span>6988 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a class="xref" href="#m_with-write-lock" title="Macro WITH-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-write-lock</b></a>, <a class="xref" href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a class="xref" href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a class="xref" href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a class="xref" href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <a class="xref" href="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span> 6987 6989 </div> 6988 6990 </div> … … 6993 6995 <strong>[Macro]</strong> 6994 6996 <br></br> 6995 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">with-write-lock</strong></span>6997 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>with-write-lock</strong></span> 6996 6998 (read-write-lock) <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&body</em> body</code> 6997 6999 </div> … … 7002 7004 <div> 7003 7005 <div class="refsect1" lang="en" xml:lang="en"> 7004 <a xmlns="http://www.w3.org/1999/xhtml" id="id 507839"></a>7006 <a xmlns="http://www.w3.org/1999/xhtml" id="id415740"></a> 7005 7007 <div class="header">Arguments and Values:</div> 7006 7008 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">read-write-lock</span></i>---an object of type … … 7011 7013 </div> 7012 7014 <div class="refsect1" lang="en" xml:lang="en"> 7013 <a xmlns="http://www.w3.org/1999/xhtml" id="id 507891"></a>7015 <a xmlns="http://www.w3.org/1999/xhtml" id="id415791"></a> 7014 7016 <div class="header">Description:</div> 7015 7017 <p xmlns="http://www.w3.org/1999/xhtml">Waits until <em class="varname">read-write-lock</em> has no 7016 readers and no writer other than <a href="#v_current-process" title="Variable *CURRENT-PROCESS*"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">*current-process*</b></a>,7017 then ensures that <a href="#v_current-process" title="Variable *CURRENT-PROCESS*"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">*current-process*</b></a> is the7018 readers and no writer other than <a class="xref" href="#v_current-process" title="Variable *CURRENT-PROCESS*"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">*current-process*</b></a>, 7019 then ensures that <a class="xref" href="#v_current-process" title="Variable *CURRENT-PROCESS*"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">*current-process*</b></a> is the 7018 7020 writer of it. With the lock held, executes <em class="varname">body</em>. 7019 7021 </p> 7020 7022 <p xmlns="http://www.w3.org/1999/xhtml">After executing <em class="varname">body</em>, if 7021 <a href="#v_current-process" title="Variable *CURRENT-PROCESS*"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">*current-process*</b></a> was not the writer of7023 <a class="xref" href="#v_current-process" title="Variable *CURRENT-PROCESS*"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">*current-process*</b></a> was not the writer of 7022 7024 <em class="varname">read-write-lock</em> before 7023 <span ><strong class="function">with-write-lock</strong></span> was called, the lock is7025 <span class="function"><strong>with-write-lock</strong></span> was called, the lock is 7024 7026 released. If it was already the writer, it remains the 7025 7027 writer.</p> 7026 7028 </div> 7027 7029 <div class="refsect1" lang="en" xml:lang="en"> 7028 <a xmlns="http://www.w3.org/1999/xhtml" id="id 507933"></a>7030 <a xmlns="http://www.w3.org/1999/xhtml" id="id415836"></a> 7029 7031 <div class="header">See Also:</div> 7030 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a href="#m_with-read-lock" title="Macro WITH-READ-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-read-lock</b></a>, <a href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <ahref="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span>7032 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a class="xref" href="#m_with-read-lock" title="Macro WITH-READ-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-read-lock</b></a>, <a class="xref" href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a class="xref" href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a class="xref" href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a class="xref" href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <a class="xref" href="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span> 7031 7033 </div> 7032 7034 </div> … … 7037 7039 <strong>[Function]</strong> 7038 7040 <br></br> 7039 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">make-semaphore</strong></span>7041 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>make-semaphore</strong></span> 7040 7042 => semaphore</code> 7041 7043 </div> … … 7046 7048 <div> 7047 7049 <div class="refsect1" lang="en" xml:lang="en"> 7048 <a xmlns="http://www.w3.org/1999/xhtml" id="id 508009"></a>7050 <a xmlns="http://www.w3.org/1999/xhtml" id="id415926"></a> 7049 7051 <div class="header">Arguments and Values:</div> 7050 7052 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">semaphore</span></i>---a newly-allocated object of type CCL:SEMAPHORE.</p> 7051 7053 </div> 7052 7054 <div class="refsect1" lang="en" xml:lang="en"> 7053 <a xmlns="http://www.w3.org/1999/xhtml" id="id 508031"></a>7055 <a xmlns="http://www.w3.org/1999/xhtml" id="id415948"></a> 7054 7056 <div class="header">Description:</div> 7055 7057 <p xmlns="http://www.w3.org/1999/xhtml">Creates and returns an object of type CCL:SEMAPHORE. … … 7060 7062 </div> 7061 7063 <div class="refsect1" lang="en" xml:lang="en"> 7062 <a xmlns="http://www.w3.org/1999/xhtml" id="id 508048"></a>7064 <a xmlns="http://www.w3.org/1999/xhtml" id="id415963"></a> 7063 7065 <div class="header">See Also:</div> 7064 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#f_signal-semaphore" title="Function SIGNAL-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">signal-semaphore</b></a>, <a href="#f_wait-on-semaphore" title="Function WAIT-ON-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">wait-on-semaphore</b></a>, <a href="#f_timed-wait-on-semaphore" title="Function TIMED-WAIT-ON-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">timed-wait-on-semaphore</b></a>, <a href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <ahref="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span>7066 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#f_signal-semaphore" title="Function SIGNAL-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">signal-semaphore</b></a>, <a class="xref" href="#f_wait-on-semaphore" title="Function WAIT-ON-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">wait-on-semaphore</b></a>, <a class="xref" href="#f_timed-wait-on-semaphore" title="Function TIMED-WAIT-ON-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">timed-wait-on-semaphore</b></a>, <a class="xref" href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a class="xref" href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a class="xref" href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a class="xref" href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <a class="xref" href="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span> 7065 7067 </div> 7066 7068 </div> … … 7071 7073 <strong>[Function]</strong> 7072 7074 <br></br> 7073 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">signal-semaphore</strong></span>7075 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>signal-semaphore</strong></span> 7074 7076 semaphore => result</code> 7075 7077 </div> … … 7080 7082 <div> 7081 7083 <div class="refsect1" lang="en" xml:lang="en"> 7082 <a xmlns="http://www.w3.org/1999/xhtml" id="id 508127"></a>7084 <a xmlns="http://www.w3.org/1999/xhtml" id="id416058"></a> 7083 7085 <div class="header">Arguments and Values:</div> 7084 7086 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">semaphore</span></i>---an object of type CCL:SEMAPHORE.</p> … … 7087 7089 </div> 7088 7090 <div class="refsect1" lang="en" xml:lang="en"> 7089 <a xmlns="http://www.w3.org/1999/xhtml" id="id 508164"></a>7091 <a xmlns="http://www.w3.org/1999/xhtml" id="id416094"></a> 7090 7092 <div class="header">Description:</div> 7091 7093 <p xmlns="http://www.w3.org/1999/xhtml">Atomically increments <em class="varname">semaphore</em>'s … … 7094 7096 </div> 7095 7097 <div class="refsect1" lang="en" xml:lang="en"> 7096 <a xmlns="http://www.w3.org/1999/xhtml" id="id 508179"></a>7098 <a xmlns="http://www.w3.org/1999/xhtml" id="id416108"></a> 7097 7099 <div class="header">See Also:</div> 7098 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a href="#f_wait-on-semaphore" title="Function WAIT-ON-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">wait-on-semaphore</b></a>, <a href="#f_timed-wait-on-semaphore" title="Function TIMED-WAIT-ON-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">timed-wait-on-semaphore</b></a>, <a href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <ahref="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span>7099 </div> 7100 <div class="refsect1" lang="en" xml:lang="en"> 7101 <a xmlns="http://www.w3.org/1999/xhtml" id="id 508226"></a>7100 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a class="xref" href="#f_wait-on-semaphore" title="Function WAIT-ON-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">wait-on-semaphore</b></a>, <a class="xref" href="#f_timed-wait-on-semaphore" title="Function TIMED-WAIT-ON-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">timed-wait-on-semaphore</b></a>, <a class="xref" href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a class="xref" href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a class="xref" href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a class="xref" href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <a class="xref" href="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span> 7101 </div> 7102 <div class="refsect1" lang="en" xml:lang="en"> 7103 <a xmlns="http://www.w3.org/1999/xhtml" id="id416161"></a> 7102 7104 <div class="header">Notes:</div> 7103 7105 <p xmlns="http://www.w3.org/1999/xhtml"><em class="varname">result</em> should probably be interpreted 7104 and acted on by <span ><strong class="function">signal-semaphore</strong></span>, because7106 and acted on by <span class="function"><strong>signal-semaphore</strong></span>, because 7105 7107 it is not likely to be meaningful to a lisp program, and the 7106 7108 most common cause of failure is a type error.</p> … … 7113 7115 <strong>[Function]</strong> 7114 7116 <br></br> 7115 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">wait-on-semaphore</strong></span>7117 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>wait-on-semaphore</strong></span> 7116 7118 semaphore => result</code> 7117 7119 </div> … … 7122 7124 <div> 7123 7125 <div class="refsect1" lang="en" xml:lang="en"> 7124 <a xmlns="http://www.w3.org/1999/xhtml" id="id 508281"></a>7126 <a xmlns="http://www.w3.org/1999/xhtml" id="id416221"></a> 7125 7127 <div class="header">Arguments and Values:</div> 7126 7128 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">semaphore</span></i>---an object of type CCL:SEMAPHORE.</p> … … 7129 7131 </div> 7130 7132 <div class="refsect1" lang="en" xml:lang="en"> 7131 <a xmlns="http://www.w3.org/1999/xhtml" id="id 508319"></a>7133 <a xmlns="http://www.w3.org/1999/xhtml" id="id416257"></a> 7132 7134 <div class="header">Description:</div> 7133 7135 <p xmlns="http://www.w3.org/1999/xhtml">Waits until <em class="varname">semaphore</em> … … 7137 7139 </div> 7138 7140 <div class="refsect1" lang="en" xml:lang="en"> 7139 <a xmlns="http://www.w3.org/1999/xhtml" id="id 508334"></a>7141 <a xmlns="http://www.w3.org/1999/xhtml" id="id416272"></a> 7140 7142 <div class="header">See Also:</div> 7141 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a href="#f_signal-semaphore" title="Function SIGNAL-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">signal-semaphore</b></a>, <a href="#f_timed-wait-on-semaphore" title="Function TIMED-WAIT-ON-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">timed-wait-on-semaphore</b></a>, <a href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <ahref="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span>7142 </div> 7143 <div class="refsect1" lang="en" xml:lang="en"> 7144 <a xmlns="http://www.w3.org/1999/xhtml" id="id 508386"></a>7143 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a class="xref" href="#f_signal-semaphore" title="Function SIGNAL-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">signal-semaphore</b></a>, <a class="xref" href="#f_timed-wait-on-semaphore" title="Function TIMED-WAIT-ON-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">timed-wait-on-semaphore</b></a>, <a class="xref" href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a class="xref" href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a class="xref" href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a class="xref" href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <a class="xref" href="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span> 7144 </div> 7145 <div class="refsect1" lang="en" xml:lang="en"> 7146 <a xmlns="http://www.w3.org/1999/xhtml" id="id416325"></a> 7145 7147 <div class="header">Notes:</div> 7146 7148 <p xmlns="http://www.w3.org/1999/xhtml"><em class="varname">result</em> should probably be interpreted 7147 and acted on by <span ><strong class="function">wait-on-semaphore</strong></span>, because7149 and acted on by <span class="function"><strong>wait-on-semaphore</strong></span>, because 7148 7150 it is not likely to be meaningful to a lisp program, and the 7149 7151 most common cause of failure is a type error.</p> … … 7156 7158 <strong>[Function]</strong> 7157 7159 <br></br> 7158 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">timed-wait-on-semaphore</strong></span>7160 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>timed-wait-on-semaphore</strong></span> 7159 7161 semaphore timeout => result</code> 7160 7162 </div> … … 7166 7168 <div> 7167 7169 <div class="refsect1" lang="en" xml:lang="en"> 7168 <a xmlns="http://www.w3.org/1999/xhtml" id="id 508442"></a>7170 <a xmlns="http://www.w3.org/1999/xhtml" id="id416385"></a> 7169 7171 <div class="header">Arguments and Values:</div> 7170 7172 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">semaphore</span></i>---An object of type CCL:SEMAPHORE.</p> 7171 7173 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">timeout</span></i>---a time interval in seconds. May be any 7172 non-negative real number the <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">floor</strong></span> of7174 non-negative real number the <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>floor</strong></span> of 7173 7175 which fits in 32 bits. The default is 1.</p> 7174 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">result</span></i>---T if <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">timed-wait-on-semaphore</strong></span>7176 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">result</span></i>---T if <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>timed-wait-on-semaphore</strong></span> 7175 7177 returned because it was able to decrement the count of 7176 7178 <em xmlns="http://www.w3.org/1999/xhtml" class="varname">semaphore</em>; NIL if it returned because … … 7179 7181 </div> 7180 7182 <div class="refsect1" lang="en" xml:lang="en"> 7181 <a xmlns="http://www.w3.org/1999/xhtml" id="id 508509"></a>7183 <a xmlns="http://www.w3.org/1999/xhtml" id="id416451"></a> 7182 7184 <div class="header">Description:</div> 7183 7185 <p xmlns="http://www.w3.org/1999/xhtml">Waits until <em class="varname">semaphore</em> … … 7188 7190 </div> 7189 7191 <div class="refsect1" lang="en" xml:lang="en"> 7190 <a xmlns="http://www.w3.org/1999/xhtml" id="id 508527"></a>7192 <a xmlns="http://www.w3.org/1999/xhtml" id="id416468"></a> 7191 7193 <div class="header">See Also:</div> 7192 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a href="#f_wait-on-semaphore" title="Function WAIT-ON-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">wait-on-semaphore</b></a>, <a href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <ahref="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span>7194 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a class="xref" href="#f_wait-on-semaphore" title="Function WAIT-ON-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">wait-on-semaphore</b></a>, <a class="xref" href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a class="xref" href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a class="xref" href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a class="xref" href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <a class="xref" href="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span> 7193 7195 </div> 7194 7196 </div> … … 7199 7201 <strong>[Function]</strong> 7200 7202 <br></br> 7201 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">process-input-wait</strong></span>7203 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>process-input-wait</strong></span> 7202 7204 fd <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&optional</em> timeout</code> 7203 7205 </div> … … 7208 7210 <div> 7209 7211 <div class="refsect1" lang="en" xml:lang="en"> 7210 <a xmlns="http://www.w3.org/1999/xhtml" id="id 508613"></a>7212 <a xmlns="http://www.w3.org/1999/xhtml" id="id416561"></a> 7211 7213 <div class="header">Arguments and Values:</div> 7212 7214 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">fd</span></i>---a file descriptor, which is a non-negative integer 7213 7215 used by the OS to refer to an open file, socket, or similar 7214 I/O connection. See <a xmlns="http://www.w3.org/1999/xhtml" href="#f_stream-device" title="Generic Function CCL::STREAM-DEVICE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">ccl::stream-device</b></a>.</p>7216 I/O connection. See <a xmlns="http://www.w3.org/1999/xhtml" class="xref" href="#f_stream-device" title="Generic Function CCL::STREAM-DEVICE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">ccl::stream-device</b></a>.</p> 7215 7217 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">timeout</span></i>---either NIL or a time interval in milliseconds. Must be a non-negative integer. The default is NIL.</p> 7216 7218 </div> 7217 7219 <div class="refsect1" lang="en" xml:lang="en"> 7218 <a xmlns="http://www.w3.org/1999/xhtml" id="id 508657"></a>7220 <a xmlns="http://www.w3.org/1999/xhtml" id="id416603"></a> 7219 7221 <div class="header">Description:</div> 7220 7222 <p xmlns="http://www.w3.org/1999/xhtml">Wait until input is available on <em class="varname">fd</em>. 7221 This uses the <span ><strong class="function">select()</strong></span> system call, and is7223 This uses the <span class="function"><strong>select()</strong></span> system call, and is 7222 7224 generally a fairly 7223 7225 efficient way of blocking while waiting for input. More 7224 accurately, <span ><strong class="function">process-input-wait</strong></span>7226 accurately, <span class="function"><strong>process-input-wait</strong></span> 7225 7227 waits until it's possible to read 7226 7228 from fd without blocking, or until <em class="varname">timeout</em>, if … … 7232 7234 </div> 7233 7235 <div class="refsect1" lang="en" xml:lang="en"> 7234 <a xmlns="http://www.w3.org/1999/xhtml" id="id 508690"></a>7236 <a xmlns="http://www.w3.org/1999/xhtml" id="id416636"></a> 7235 7237 <div class="header">See Also:</div> 7236 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <ahref="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span>7237 </div> 7238 <div class="refsect1" lang="en" xml:lang="en"> 7239 <a xmlns="http://www.w3.org/1999/xhtml" id="id 508727"></a>7238 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a class="xref" href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a class="xref" href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a class="xref" href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a>, <a class="xref" href="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span> 7239 </div> 7240 <div class="refsect1" lang="en" xml:lang="en"> 7241 <a xmlns="http://www.w3.org/1999/xhtml" id="id416674"></a> 7240 7242 <div class="header">Notes:</div> 7241 7243 <p xmlns="http://www.w3.org/1999/xhtml"> 7242 <span ><strong class="function">process-input-wait</strong></span> has a timeout parameter,7244 <span class="function"><strong>process-input-wait</strong></span> has a timeout parameter, 7243 7245 and 7244 <a href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a> does not. This7246 <a class="xref" href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a> does not. This 7245 7247 inconsistency should probably be corrected. 7246 7248 </p> … … 7253 7255 <strong>[Function]</strong> 7254 7256 <br></br> 7255 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">process-output-wait</strong></span>7257 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>process-output-wait</strong></span> 7256 7258 fd <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&optional</em> timeout</code> 7257 7259 </div> … … 7262 7264 <div> 7263 7265 <div class="refsect1" lang="en" xml:lang="en"> 7264 <a xmlns="http://www.w3.org/1999/xhtml" id="id 508785"></a>7266 <a xmlns="http://www.w3.org/1999/xhtml" id="id416738"></a> 7265 7267 <div class="header">Arguments and Values:</div> 7266 7268 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">fd</span></i>---a file descriptor, which is a non-negative integer 7267 7269 used by the OS to refer to an open file, socket, or similar 7268 I/O connection. See <a xmlns="http://www.w3.org/1999/xhtml" href="#f_stream-device" title="Generic Function CCL::STREAM-DEVICE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">ccl::stream-device</b></a>.</p>7270 I/O connection. See <a xmlns="http://www.w3.org/1999/xhtml" class="xref" href="#f_stream-device" title="Generic Function CCL::STREAM-DEVICE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">ccl::stream-device</b></a>.</p> 7269 7271 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">timeout</span></i>---either NIL or a time interval in milliseconds. Must be a non-negative integer. The default is NIL.</p> 7270 7272 </div> 7271 7273 <div class="refsect1" lang="en" xml:lang="en"> 7272 <a xmlns="http://www.w3.org/1999/xhtml" id="id 508829"></a>7274 <a xmlns="http://www.w3.org/1999/xhtml" id="id416780"></a> 7273 7275 <div class="header">Description:</div> 7274 7276 <p xmlns="http://www.w3.org/1999/xhtml">Wait until output is possible on <em class="varname">fd</em> or until <em class="varname">timeout</em>, if 7275 7277 it is not NIL, has been exceeded. 7276 This uses the <span ><strong class="function">select()</strong></span> system call, and is7278 This uses the <span class="function"><strong>select()</strong></span> system call, and is 7277 7279 generally a fairly 7278 7280 efficient way of blocking while waiting to output.</p> 7279 <p xmlns="http://www.w3.org/1999/xhtml">If <span ><strong class="function">process-output-wait</strong></span> is called on7281 <p xmlns="http://www.w3.org/1999/xhtml">If <span class="function"><strong>process-output-wait</strong></span> is called on 7280 7282 a network socket which has not yet established a connection, it 7281 7283 will wait until the connection is established. This is an … … 7283 7285 </div> 7284 7286 <div class="refsect1" lang="en" xml:lang="en"> 7285 <a xmlns="http://www.w3.org/1999/xhtml" id="id 508862"></a>7287 <a xmlns="http://www.w3.org/1999/xhtml" id="id416813"></a> 7286 7288 <div class="header">See Also:</div> 7287 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <ahref="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span>7288 </div> 7289 <div class="refsect1" lang="en" xml:lang="en"> 7290 <a xmlns="http://www.w3.org/1999/xhtml" id="id 508899"></a>7289 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a class="xref" href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a class="xref" href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a class="xref" href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a class="xref" href="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a></span> 7290 </div> 7291 <div class="refsect1" lang="en" xml:lang="en"> 7292 <a xmlns="http://www.w3.org/1999/xhtml" id="id416850"></a> 7291 7293 <div class="header">Notes:</div> 7292 7294 <p xmlns="http://www.w3.org/1999/xhtml"> 7293 <a href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a> has a timeout parameter,7295 <a class="xref" href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a> has a timeout parameter, 7294 7296 and 7295 <span ><strong class="function">process-output-wait</strong></span> does not. This7297 <span class="function"><strong>process-output-wait</strong></span> does not. This 7296 7298 inconsistency should probably be corrected. 7297 7299 </p> … … 7304 7306 <strong>[Macro]</strong> 7305 7307 <br></br> 7306 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">with-terminal-input</strong></span>7308 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>with-terminal-input</strong></span> 7307 7309 <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&body</em> body => result</code> 7308 7310 </div> … … 7313 7315 <div> 7314 7316 <div class="refsect1" lang="en" xml:lang="en"> 7315 <a xmlns="http://www.w3.org/1999/xhtml" id="id 508957"></a>7317 <a xmlns="http://www.w3.org/1999/xhtml" id="id416915"></a> 7316 7318 <div class="header">Arguments and Values:</div> 7317 7319 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">body</span></i>---an implicit progn.</p> … … 7320 7322 </div> 7321 7323 <div class="refsect1" lang="en" xml:lang="en"> 7322 <a xmlns="http://www.w3.org/1999/xhtml" id="id 508996"></a>7324 <a xmlns="http://www.w3.org/1999/xhtml" id="id416954"></a> 7323 7325 <div class="header">Description:</div> 7324 7326 <p xmlns="http://www.w3.org/1999/xhtml">Requests exclusive read access to the standard terminal … … 7328 7330 </div> 7329 7331 <div class="refsect1" lang="en" xml:lang="en"> 7330 <a xmlns="http://www.w3.org/1999/xhtml" id="id 509014"></a>7332 <a xmlns="http://www.w3.org/1999/xhtml" id="id416970"></a> 7331 7333 <div class="header">See Also:</div> 7332 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#v_request-terminal-input-via-break" title="Variable *REQUEST-TERMINAL-INPUT-VIA-BREAK*"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">*request-terminal-input-via-break*</b></a>, <a href="#cmd_y" title="Toplevel Command :Y"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">:y</b></a>, <a href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <ahref="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a></span>7334 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#v_request-terminal-input-via-break" title="Variable *REQUEST-TERMINAL-INPUT-VIA-BREAK*"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">*request-terminal-input-via-break*</b></a>, <a class="xref" href="#cmd_y" title="Toplevel Command :Y"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">:y</b></a>, <a class="xref" href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a class="xref" href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a class="xref" href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a class="xref" href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a class="xref" href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a></span> 7333 7335 </div> 7334 7336 </div> … … 7347 7349 <div> 7348 7350 <div class="refsect1" lang="en" xml:lang="en"> 7349 <a xmlns="http://www.w3.org/1999/xhtml" id="id 509094"></a>7351 <a xmlns="http://www.w3.org/1999/xhtml" id="id417047"></a> 7350 7352 <div class="header">Value Type:</div> 7351 7353 <p xmlns="http://www.w3.org/1999/xhtml">A boolean.</p> 7352 7354 </div> 7353 7355 <div class="refsect1" lang="en" xml:lang="en"> 7354 <a xmlns="http://www.w3.org/1999/xhtml" id="id 509104"></a>7356 <a xmlns="http://www.w3.org/1999/xhtml" id="id417057"></a> 7355 7357 <div class="header">Initial Value:</div> 7356 7358 <p xmlns="http://www.w3.org/1999/xhtml">NIL.</p> 7357 7359 </div> 7358 7360 <div class="refsect1" lang="en" xml:lang="en"> 7359 <a xmlns="http://www.w3.org/1999/xhtml" id="id 509114"></a>7361 <a xmlns="http://www.w3.org/1999/xhtml" id="id417067"></a> 7360 7362 <div class="header">Description:</div> 7361 7363 <p xmlns="http://www.w3.org/1999/xhtml">Controls how attempts to obtain ownership of terminal input … … 7369 7371 </div> 7370 7372 <div class="refsect1" lang="en" xml:lang="en"> 7371 <a xmlns="http://www.w3.org/1999/xhtml" id="id 509131"></a>7373 <a xmlns="http://www.w3.org/1999/xhtml" id="id417080"></a> 7372 7374 <div class="header">See Also:</div> 7373 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a>, <a href="#cmd_y" title="Toplevel Command :Y"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">:y</b></a>, <a href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <ahref="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a></span>7375 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a>, <a class="xref" href="#cmd_y" title="Toplevel Command :Y"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">:y</b></a>, <a class="xref" href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a class="xref" href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a class="xref" href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a class="xref" href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a class="xref" href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a></span> 7374 7376 </div> 7375 7377 </div> … … 7380 7382 <strong>[Toplevel Command]</strong> 7381 7383 <br></br> 7382 <code>(<span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">:y</strong></span> p)</code>7384 <code>(<span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>:y</strong></span> p)</code> 7383 7385 </div> 7384 7386 <div class="refentrytitle">Yields control of terminal input to a specified … … 7388 7390 <div> 7389 7391 <div class="refsect1" lang="en" xml:lang="en"> 7390 <a xmlns="http://www.w3.org/1999/xhtml" id="id 509215"></a>7392 <a xmlns="http://www.w3.org/1999/xhtml" id="id417171"></a> 7391 7393 <div class="header">Arguments and Values:</div> 7392 7394 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">p</span></i>---a lisp process (thread), designated either by 7393 7395 an integer which matches its 7394 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">process-serial-number</strong></span>,7395 or by a string which is <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">equal</strong></span> to7396 its <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">process-name</strong></span>.</p>7397 </div> 7398 <div class="refsect1" lang="en" xml:lang="en"> 7399 <a xmlns="http://www.w3.org/1999/xhtml" id="id 509250"></a>7396 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>process-serial-number</strong></span>, 7397 or by a string which is <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>equal</strong></span> to 7398 its <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>process-name</strong></span>.</p> 7399 </div> 7400 <div class="refsect1" lang="en" xml:lang="en"> 7401 <a xmlns="http://www.w3.org/1999/xhtml" id="id417210"></a> 7400 7402 <div class="header">Description:</div> 7401 7403 <p xmlns="http://www.w3.org/1999/xhtml">:Y is a toplevel command, not a function. As such, it … … 7404 7406 <p xmlns="http://www.w3.org/1999/xhtml">The command yields control of terminal input to the 7405 7407 process <em class="varname">p</em>, which must have used 7406 <a href="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a> to request access to the7408 <a class="xref" href="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a> to request access to the 7407 7409 terminal input stream.</p> 7408 7410 </div> 7409 7411 <div class="refsect1" lang="en" xml:lang="en"> 7410 <a xmlns="http://www.w3.org/1999/xhtml" id="id 509274"></a>7412 <a xmlns="http://www.w3.org/1999/xhtml" id="id417232"></a> 7411 7413 <div class="header">See Also:</div> 7412 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a>, <a href="#v_request-terminal-input-via-break" title="Variable *REQUEST-TERMINAL-INPUT-VIA-BREAK*"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">*request-terminal-input-via-break*</b></a>, <a href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <ahref="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a></span>7414 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#m_with-terminal-input" title="Macro WITH-TERMINAL-INPUT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-terminal-input</b></a>, <a class="xref" href="#v_request-terminal-input-via-break" title="Variable *REQUEST-TERMINAL-INPUT-VIA-BREAK*"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">*request-terminal-input-via-break*</b></a>, <a class="xref" href="#f_make-lock" title="Function MAKE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-lock</b></a>, <a class="xref" href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>, <a class="xref" href="#f_make-semaphore" title="Function MAKE-SEMAPHORE"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-semaphore</b></a>, <a class="xref" href="#f_process-input-wait" title="Function PROCESS-INPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-input-wait</b></a>, <a class="xref" href="#f_process-output-wait" title="Function PROCESS-OUTPUT-WAIT"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">process-output-wait</b></a></span> 7413 7415 </div> 7414 7416 </div> … … 7457 7459 sockets, and Unix-domain sockets. This should be enough for all 7458 7460 but the most esoteric network situations. All sockets are 7459 created by <a href="#f_make-socket" title="Function MAKE-SOCKET"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-socket</b></a>. The type of socket7461 created by <a class="xref" href="#f_make-socket" title="Function MAKE-SOCKET"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-socket</b></a>. The type of socket 7460 7462 depends on the arguments to it, as follows:</p> 7461 7463 <div xmlns="http://www.w3.org/1999/xhtml" class="variablelist"> … … 7527 7529 <strong>[Function]</strong> 7528 7530 <br></br> 7529 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">make-socket</strong></span> <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&key</em>7531 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>make-socket</strong></span> <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&key</em> 7530 7532 address-family type connect eol format remote-host 7531 7533 remote-port local-host local-port local-filename … … 7539 7541 <div> 7540 7542 <div class="refsect1" lang="en" xml:lang="en"> 7541 <a xmlns="http://www.w3.org/1999/xhtml" id="id 498897"></a>7543 <a xmlns="http://www.w3.org/1999/xhtml" id="id372876"></a> 7542 7544 <div class="header">Arguments and Values:</div> 7543 7545 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">address-family</span></i>---The address/protocol family of this socket. Currently … … 7611 7613 specified number of seconds, an 7612 7614 <code xmlns="http://www.w3.org/1999/xhtml" class="literal">input-timeout</code> error is signalled. 7613 (see <a xmlns="http://www.w3.org/1999/xhtml" href="#Stream-Timeouts-And-Deadlines" title="10.1.4. Stream Timeouts and Deadlines">Section 10.1.4, âStream Timeouts and Deadlinesâ</a>)</p>7615 (see <a xmlns="http://www.w3.org/1999/xhtml" class="xref" href="#Stream-Timeouts-And-Deadlines" title="10.1.4. Stream Timeouts and Deadlines">Section 10.1.4, âStream Timeouts and Deadlinesâ</a>)</p> 7614 7616 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">output-timeout</span></i>---The number of seconds before an output operation 7615 7617 times out. Must be a real number between zero and one … … 7617 7619 specified number of seconds, an 7618 7620 <code xmlns="http://www.w3.org/1999/xhtml" class="literal">output-timeout</code> error is signalled. 7619 (see <a xmlns="http://www.w3.org/1999/xhtml" href="#Stream-Timeouts-And-Deadlines" title="10.1.4. Stream Timeouts and Deadlines">Section 10.1.4, âStream Timeouts and Deadlinesâ</a>)</p>7621 (see <a xmlns="http://www.w3.org/1999/xhtml" class="xref" href="#Stream-Timeouts-And-Deadlines" title="10.1.4. Stream Timeouts and Deadlines">Section 10.1.4, âStream Timeouts and Deadlinesâ</a>)</p> 7620 7622 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">connect-timeout</span></i>---The number of seconds before a connection 7621 7623 attempt times out. [TODO: what are acceptable values?] … … 7635 7637 <code xmlns="http://www.w3.org/1999/xhtml" class="literal">COMMUNICATION-DEADLINE-EXPIRED</code> 7636 7638 error is signalled. A deadline takes precedence over 7637 any input/output timeouts that may be set. (see <a xmlns="http://www.w3.org/1999/xhtml" href="#Stream-Timeouts-And-Deadlines" title="10.1.4. Stream Timeouts and Deadlines">Section 10.1.4, âStream Timeouts and Deadlinesâ</a>)</p>7638 </div> 7639 <div class="refsect1" lang="en" xml:lang="en"> 7640 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 58069"></a>7639 any input/output timeouts that may be set. (see <a xmlns="http://www.w3.org/1999/xhtml" class="xref" href="#Stream-Timeouts-And-Deadlines" title="10.1.4. Stream Timeouts and Deadlines">Section 10.1.4, âStream Timeouts and Deadlinesâ</a>)</p> 7640 </div> 7641 <div class="refsect1" lang="en" xml:lang="en"> 7642 <a xmlns="http://www.w3.org/1999/xhtml" id="id404926"></a> 7641 7643 <div class="header">Description:</div> 7642 7644 <p xmlns="http://www.w3.org/1999/xhtml">Creates and returns a new socket</p> … … 7649 7651 <strong>[Function]</strong> 7650 7652 <br></br> 7651 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">accept-connection</strong></span>7653 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>accept-connection</strong></span> 7652 7654 (socket listener-socket) <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&key</em> wait</code> 7653 7655 </div> … … 7657 7659 <div> 7658 7660 <div class="refsect1" lang="en" xml:lang="en"> 7659 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 30857"></a>7661 <a xmlns="http://www.w3.org/1999/xhtml" id="id404987"></a> 7660 7662 <div class="header">Arguments and Values:</div> 7661 7663 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">socket</span></i>---The listener-socket to listen on.</p> … … 7665 7667 </div> 7666 7668 <div class="refsect1" lang="en" xml:lang="en"> 7667 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 73045"></a>7669 <a xmlns="http://www.w3.org/1999/xhtml" id="id405030"></a> 7668 7670 <div class="header">Description:</div> 7669 7671 <p xmlns="http://www.w3.org/1999/xhtml">Extracts the first connection on the queue of pending … … 7683 7685 <strong>[Function]</strong> 7684 7686 <br></br> 7685 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">dotted-to-ipaddr</strong></span>7687 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>dotted-to-ipaddr</strong></span> 7686 7688 dotted <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&key</em> errorp</code> 7687 7689 </div> … … 7691 7693 <div> 7692 7694 <div class="refsect1" lang="en" xml:lang="en"> 7693 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 95522"></a>7695 <a xmlns="http://www.w3.org/1999/xhtml" id="id405095"></a> 7694 7696 <div class="header">Arguments and Values:</div> 7695 7697 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">dotted</span></i>---A string representing an IP address in the … … 7699 7701 </div> 7700 7702 <div class="refsect1" lang="en" xml:lang="en"> 7701 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 82782"></a>7703 <a xmlns="http://www.w3.org/1999/xhtml" id="id405136"></a> 7702 7704 <div class="header">Description:</div> 7703 7705 <p xmlns="http://www.w3.org/1999/xhtml">Converts a dotted-string representation of a host address to … … 7711 7713 <strong>[Function]</strong> 7712 7714 <br></br> 7713 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">ipaddr-to-dotted</strong></span>7715 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>ipaddr-to-dotted</strong></span> 7714 7716 ipaddr <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&key</em> values</code> 7715 7717 </div> … … 7719 7721 <div> 7720 7722 <div class="refsect1" lang="en" xml:lang="en"> 7721 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 59506"></a>7723 <a xmlns="http://www.w3.org/1999/xhtml" id="id405198"></a> 7722 7724 <div class="header">Arguments and Values:</div> 7723 7725 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">ipaddr</span></i>---A 32-bit integer representing an internet host address</p> … … 7728 7730 </div> 7729 7731 <div class="refsect1" lang="en" xml:lang="en"> 7730 <a xmlns="http://www.w3.org/1999/xhtml" id="id 502645"></a>7732 <a xmlns="http://www.w3.org/1999/xhtml" id="id403555"></a> 7731 7733 <div class="header">Description:</div> 7732 7734 <p xmlns="http://www.w3.org/1999/xhtml">Converts a 32-bit unsigned IP address into octets.</p> … … 7739 7741 <strong>[Function]</strong> 7740 7742 <br></br> 7741 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">ipaddr-to-hostname</strong></span>7743 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>ipaddr-to-hostname</strong></span> 7742 7744 ipaddr <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&key</em> ignore-cache</code> 7743 7745 </div> … … 7747 7749 <div> 7748 7750 <div class="refsect1" lang="en" xml:lang="en"> 7749 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 51113"></a>7751 <a xmlns="http://www.w3.org/1999/xhtml" id="id403616"></a> 7750 7752 <div class="header">Arguments and Values:</div> 7751 7753 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">ipaddr</span></i>---a 32-bit integer representing an internet host address</p> … … 7754 7756 </div> 7755 7757 <div class="refsect1" lang="en" xml:lang="en"> 7756 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 70273"></a>7758 <a xmlns="http://www.w3.org/1999/xhtml" id="id403657"></a> 7757 7759 <div class="header">Description:</div> 7758 7760 <p xmlns="http://www.w3.org/1999/xhtml">Converts a 32-bit unsigned IP address into a host name … … 7766 7768 <strong>[Function]</strong> 7767 7769 <br></br> 7768 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">lookup-hostname</strong></span>7770 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>lookup-hostname</strong></span> 7769 7771 host</code> 7770 7772 </div> … … 7774 7776 <div> 7775 7777 <div class="refsect1" lang="en" xml:lang="en"> 7776 <a xmlns="http://www.w3.org/1999/xhtml" id="id 501148"></a>7778 <a xmlns="http://www.w3.org/1999/xhtml" id="id403714"></a> 7777 7779 <div class="header">Arguments and Values:</div> 7778 7780 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">host</span></i>---Specifies the host. It can be either a host name … … 7782 7784 </div> 7783 7785 <div class="refsect1" lang="en" xml:lang="en"> 7784 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 33781"></a>7786 <a xmlns="http://www.w3.org/1999/xhtml" id="id403742"></a> 7785 7787 <div class="header">Description:</div> 7786 7788 <p xmlns="http://www.w3.org/1999/xhtml">Converts a host spec in any of the acceptable formats into a … … 7794 7796 <strong>[Function]</strong> 7795 7797 <br></br> 7796 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">lookup-port</strong></span>7798 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>lookup-port</strong></span> 7797 7799 port protocol</code> 7798 7800 </div> … … 7802 7804 <div> 7803 7805 <div class="refsect1" lang="en" xml:lang="en"> 7804 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 75043"></a>7806 <a xmlns="http://www.w3.org/1999/xhtml" id="id403800"></a> 7805 7807 <div class="header">Arguments and Values:</div> 7806 7808 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">port</span></i>---Specifies the port. It can be either a string, such as … … 7811 7813 </div> 7812 7814 <div class="refsect1" lang="en" xml:lang="en"> 7813 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 88453"></a>7815 <a xmlns="http://www.w3.org/1999/xhtml" id="id403842"></a> 7814 7816 <div class="header">Description:</div> 7815 7817 <p xmlns="http://www.w3.org/1999/xhtml">Finds the port number for the specified port and protocol</p> … … 7822 7824 <strong>[Function]</strong> 7823 7825 <br></br> 7824 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">receive-from</strong></span>7826 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>receive-from</strong></span> 7825 7827 (socket udp-socket) size <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&key</em> buffer 7826 7828 extract offset</code> … … 7831 7833 <div> 7832 7834 <div class="refsect1" lang="en" xml:lang="en"> 7833 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 28852"></a>7835 <a xmlns="http://www.w3.org/1999/xhtml" id="id403904"></a> 7834 7836 <div class="header">Arguments and Values:</div> 7835 7837 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">socket</span></i>---The socket to read from</p> … … 7848 7850 </div> 7849 7851 <div class="refsect1" lang="en" xml:lang="en"> 7850 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 46788"></a>7852 <a xmlns="http://www.w3.org/1999/xhtml" id="id403994"></a> 7851 7853 <div class="header">Description:</div> 7852 7854 <p xmlns="http://www.w3.org/1999/xhtml">Reads a UDP packet from a socket. If no packets are … … 7876 7878 <strong>[Function]</strong> 7877 7879 <br></br> 7878 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">send-to</strong></span>7880 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>send-to</strong></span> 7879 7881 (socket udp-socket) buffer size <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&key</em> remote-host 7880 7882 remote-port offset</code> … … 7885 7887 <div> 7886 7888 <div class="refsect1" lang="en" xml:lang="en"> 7887 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 35843"></a>7889 <a xmlns="http://www.w3.org/1999/xhtml" id="id404109"></a> 7888 7890 <div class="header">Arguments and Values:</div> 7889 7891 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">socket</span></i>---The socket to write to</p> … … 7901 7903 </div> 7902 7904 <div class="refsect1" lang="en" xml:lang="en"> 7903 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 74272"></a>7905 <a xmlns="http://www.w3.org/1999/xhtml" id="id404213"></a> 7904 7906 <div class="header">Description:</div> 7905 7907 <p xmlns="http://www.w3.org/1999/xhtml">Send a UDP packet over a socket.</p> … … 7912 7914 <strong>[Function]</strong> 7913 7915 <br></br> 7914 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">shutdown</strong></span>7916 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>shutdown</strong></span> 7915 7917 socket <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&key</em> direction</code> 7916 7918 </div> … … 7920 7922 <div> 7921 7923 <div class="refsect1" lang="en" xml:lang="en"> 7922 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 62324"></a>7924 <a xmlns="http://www.w3.org/1999/xhtml" id="id404274"></a> 7923 7925 <div class="header">Arguments and Values:</div> 7924 7926 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">socket</span></i>---The socket to shut down (typically a tcp-stream)</p> … … 7927 7929 </div> 7928 7930 <div class="refsect1" lang="en" xml:lang="en"> 7929 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 62135"></a>7931 <a xmlns="http://www.w3.org/1999/xhtml" id="id404315"></a> 7930 7932 <div class="header">Description:</div> 7931 7933 <p xmlns="http://www.w3.org/1999/xhtml">Shuts down part of a bidirectional connection. This is … … 7940 7942 <strong>[Function]</strong> 7941 7943 <br></br> 7942 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">socket-os-fd</strong></span>7944 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>socket-os-fd</strong></span> 7943 7945 socket</code> 7944 7946 </div> … … 7948 7950 <div> 7949 7951 <div class="refsect1" lang="en" xml:lang="en"> 7950 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 48673"></a>7952 <a xmlns="http://www.w3.org/1999/xhtml" id="id404374"></a> 7951 7953 <div class="header">Arguments and Values:</div> 7952 7954 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">socket</span></i>---The socket</p> 7953 7955 </div> 7954 7956 <div class="refsect1" lang="en" xml:lang="en"> 7955 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 63587"></a>7957 <a xmlns="http://www.w3.org/1999/xhtml" id="id404400"></a> 7956 7958 <div class="header">Description:</div> 7957 7959 <p xmlns="http://www.w3.org/1999/xhtml">Returns the native OS's representation of the socket, or … … 7970 7972 <strong>[Function]</strong> 7971 7973 <br></br> 7972 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">remote-host</strong></span>7974 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>remote-host</strong></span> 7973 7975 socket</code> 7974 7976 </div> … … 7978 7980 <div> 7979 7981 <div class="refsect1" lang="en" xml:lang="en"> 7980 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 43064"></a>7982 <a xmlns="http://www.w3.org/1999/xhtml" id="id404461"></a> 7981 7983 <div class="header">Arguments and Values:</div> 7982 7984 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">socket</span></i>---The socket</p> 7983 7985 </div> 7984 7986 <div class="refsect1" lang="en" xml:lang="en"> 7985 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 61811"></a>7987 <a xmlns="http://www.w3.org/1999/xhtml" id="id404487"></a> 7986 7988 <div class="header">Description:</div> 7987 7989 <p xmlns="http://www.w3.org/1999/xhtml">Returns the 32-bit unsigned IP address of the remote host, … … 7995 7997 <strong>[Function]</strong> 7996 7998 <br></br> 7997 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">remote-port</strong></span>7999 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>remote-port</strong></span> 7998 8000 socket</code> 7999 8001 </div> … … 8003 8005 <div> 8004 8006 <div class="refsect1" lang="en" xml:lang="en"> 8005 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 34816"></a>8007 <a xmlns="http://www.w3.org/1999/xhtml" id="id404545"></a> 8006 8008 <div class="header">Arguments and Values:</div> 8007 8009 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">socket</span></i>---The socket</p> 8008 8010 </div> 8009 8011 <div class="refsect1" lang="en" xml:lang="en"> 8010 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 30162"></a>8012 <a xmlns="http://www.w3.org/1999/xhtml" id="id404571"></a> 8011 8013 <div class="header">Description:</div> 8012 8014 <p xmlns="http://www.w3.org/1999/xhtml">Returns the remote port number, or NIL if the socket is not … … 8020 8022 <strong>[Function]</strong> 8021 8023 <br></br> 8022 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">local-host</strong></span>8024 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>local-host</strong></span> 8023 8025 socket</code> 8024 8026 </div> … … 8028 8030 <div> 8029 8031 <div class="refsect1" lang="en" xml:lang="en"> 8030 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 83432"></a>8032 <a xmlns="http://www.w3.org/1999/xhtml" id="id404629"></a> 8031 8033 <div class="header">Arguments and Values:</div> 8032 8034 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">socket</span></i>---The socket</p> 8033 8035 </div> 8034 8036 <div class="refsect1" lang="en" xml:lang="en"> 8035 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 33176"></a>8037 <a xmlns="http://www.w3.org/1999/xhtml" id="id404655"></a> 8036 8038 <div class="header">Description:</div> 8037 8039 <p xmlns="http://www.w3.org/1999/xhtml">Returns 32-bit unsigned IP address of the local host.</p> … … 8044 8046 <strong>[Function]</strong> 8045 8047 <br></br> 8046 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">local-port</strong></span>8048 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>local-port</strong></span> 8047 8049 socket</code> 8048 8050 </div> … … 8052 8054 <div> 8053 8055 <div class="refsect1" lang="en" xml:lang="en"> 8054 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 33219"></a>8056 <a xmlns="http://www.w3.org/1999/xhtml" id="id404712"></a> 8055 8057 <div class="header">Arguments and Values:</div> 8056 8058 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">socket</span></i>---The socket</p> 8057 8059 </div> 8058 8060 <div class="refsect1" lang="en" xml:lang="en"> 8059 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 55761"></a>8061 <a xmlns="http://www.w3.org/1999/xhtml" id="id404738"></a> 8060 8062 <div class="header">Description:</div> 8061 8063 <p xmlns="http://www.w3.org/1999/xhtml">Returns the local port number</p> … … 8068 8070 <strong>[Function]</strong> 8069 8071 <br></br> 8070 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">socket-address-family</strong></span>8072 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>socket-address-family</strong></span> 8071 8073 socket</code> 8072 8074 </div> … … 8076 8078 <div> 8077 8079 <div class="refsect1" lang="en" xml:lang="en"> 8078 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 85427"></a>8080 <a xmlns="http://www.w3.org/1999/xhtml" id="id401876"></a> 8079 8081 <div class="header">Arguments and Values:</div> 8080 8082 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">socket</span></i>---The socket</p> 8081 8083 </div> 8082 8084 <div class="refsect1" lang="en" xml:lang="en"> 8083 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 33435"></a>8085 <a xmlns="http://www.w3.org/1999/xhtml" id="id401902"></a> 8084 8086 <div class="header">Description:</div> 8085 8087 <p xmlns="http://www.w3.org/1999/xhtml">Returns :internet or :file, as appropriate.</p> … … 8092 8094 <strong>[Function]</strong> 8093 8095 <br></br> 8094 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">socket-connect</strong></span>8096 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>socket-connect</strong></span> 8095 8097 socket</code> 8096 8098 </div> … … 8100 8102 <div> 8101 8103 <div class="refsect1" lang="en" xml:lang="en"> 8102 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 50826"></a>8104 <a xmlns="http://www.w3.org/1999/xhtml" id="id401959"></a> 8103 8105 <div class="header">Arguments and Values:</div> 8104 8106 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">socket</span></i>---The socket</p> 8105 8107 </div> 8106 8108 <div class="refsect1" lang="en" xml:lang="en"> 8107 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 50849"></a>8109 <a xmlns="http://www.w3.org/1999/xhtml" id="id401985"></a> 8108 8110 <div class="header">Description:</div> 8109 8111 <p xmlns="http://www.w3.org/1999/xhtml">Returns :active for tcp-stream, :passive for … … 8117 8119 <strong>[Function]</strong> 8118 8120 <br></br> 8119 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">socket-format</strong></span>8121 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>socket-format</strong></span> 8120 8122 socket</code> 8121 8123 </div> … … 8125 8127 <div> 8126 8128 <div class="refsect1" lang="en" xml:lang="en"> 8127 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 53854"></a>8129 <a xmlns="http://www.w3.org/1999/xhtml" id="id402042"></a> 8128 8130 <div class="header">Arguments and Values:</div> 8129 8131 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">socket</span></i>---The socket</p> 8130 8132 </div> 8131 8133 <div class="refsect1" lang="en" xml:lang="en"> 8132 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 59449"></a>8134 <a xmlns="http://www.w3.org/1999/xhtml" id="id402069"></a> 8133 8135 <div class="header">Description:</div> 8134 8136 <p xmlns="http://www.w3.org/1999/xhtml">Returns the socket format as specified by the :format … … 8142 8144 <strong>[Function]</strong> 8143 8145 <br></br> 8144 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">socket-type</strong></span>8146 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>socket-type</strong></span> 8145 8147 socket</code> 8146 8148 </div> … … 8150 8152 <div> 8151 8153 <div class="refsect1" lang="en" xml:lang="en"> 8152 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 40524"></a>8154 <a xmlns="http://www.w3.org/1999/xhtml" id="id402127"></a> 8153 8155 <div class="header">Arguments and Values:</div> 8154 8156 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">socket</span></i>---The socket</p> 8155 8157 </div> 8156 8158 <div class="refsect1" lang="en" xml:lang="en"> 8157 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 40547"></a>8159 <a xmlns="http://www.w3.org/1999/xhtml" id="id402153"></a> 8158 8160 <div class="header">Description:</div> 8159 8161 <p xmlns="http://www.w3.org/1999/xhtml">returns :stream for tcp-stream and listener-socket, and … … 8174 8176 <div> 8175 8177 <div class="refsect1" lang="en" xml:lang="en"> 8176 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 87264"></a>8178 <a xmlns="http://www.w3.org/1999/xhtml" id="id402196"></a> 8177 8179 <div class="header">Description:</div> 8178 8180 <p xmlns="http://www.w3.org/1999/xhtml">The class of OS errors signaled by socket functions</p> 8179 8181 </div> 8180 8182 <div class="refsect1" lang="en" xml:lang="en"> 8181 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 92064"></a>8183 <a xmlns="http://www.w3.org/1999/xhtml" id="id402207"></a> 8182 8184 <div class="header">Superclasses:</div> 8183 8185 <p xmlns="http://www.w3.org/1999/xhtml">simple-error</p> … … 8190 8192 <strong>[Function]</strong> 8191 8193 <br></br> 8192 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">socket-error-code</strong></span>8194 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>socket-error-code</strong></span> 8193 8195 socket-error</code> 8194 8196 </div> … … 8198 8200 <div> 8199 8201 <div class="refsect1" lang="en" xml:lang="en"> 8200 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 68134"></a>8202 <a xmlns="http://www.w3.org/1999/xhtml" id="id402265"></a> 8201 8203 <div class="header">Arguments and Values:</div> 8202 8204 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">socket-error</span></i>---the condition</p> 8203 8205 </div> 8204 8206 <div class="refsect1" lang="en" xml:lang="en"> 8205 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 33013"></a>8207 <a xmlns="http://www.w3.org/1999/xhtml" id="id402291"></a> 8206 8208 <div class="header">Description:</div> 8207 8209 <p xmlns="http://www.w3.org/1999/xhtml">The OS error code of the error</p> … … 8214 8216 <strong>[Function]</strong> 8215 8217 <br></br> 8216 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">socket-error-identifier</strong></span>8218 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>socket-error-identifier</strong></span> 8217 8219 socket-error</code> 8218 8220 </div> … … 8222 8224 <div> 8223 8225 <div class="refsect1" lang="en" xml:lang="en"> 8224 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 51001"></a>8226 <a xmlns="http://www.w3.org/1999/xhtml" id="id402349"></a> 8225 8227 <div class="header">Arguments and Values:</div> 8226 8228 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">socket-error</span></i>---the condition</p> 8227 8229 </div> 8228 8230 <div class="refsect1" lang="en" xml:lang="en"> 8229 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 66905"></a>8231 <a xmlns="http://www.w3.org/1999/xhtml" id="id402375"></a> 8230 8232 <div class="header">Description:</div> 8231 8233 <p xmlns="http://www.w3.org/1999/xhtml">A symbol representing the error code in a more … … 8243 8245 <strong>[Function]</strong> 8244 8246 <br></br> 8245 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">socket-error-situation</strong></span>8247 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>socket-error-situation</strong></span> 8246 8248 socket-error</code> 8247 8249 </div> … … 8251 8253 <div> 8252 8254 <div class="refsect1" lang="en" xml:lang="en"> 8253 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 41085"></a>8255 <a xmlns="http://www.w3.org/1999/xhtml" id="id402438"></a> 8254 8256 <div class="header">Arguments and Values:</div> 8255 8257 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">socket-error</span></i>---the condition</p> 8256 8258 </div> 8257 8259 <div class="refsect1" lang="en" xml:lang="en"> 8258 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 59794"></a>8260 <a xmlns="http://www.w3.org/1999/xhtml" id="id402464"></a> 8259 8261 <div class="header">Description:</div> 8260 8262 <p xmlns="http://www.w3.org/1999/xhtml">A string describing the context where the error happened. On … … 8269 8271 <strong>[Method]</strong> 8270 8272 <br></br> 8271 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">close</strong></span>8273 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>close</strong></span> 8272 8274 (socket socket) <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&key</em> abort</code> 8273 8275 </div> … … 8277 8279 <div> 8278 8280 <div class="refsect1" lang="en" xml:lang="en"> 8279 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 74919"></a>8281 <a xmlns="http://www.w3.org/1999/xhtml" id="id402527"></a> 8280 8282 <div class="header">Arguments and Values:</div> 8281 8283 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">socket</span></i>---The socket to close</p> … … 8288 8290 </div> 8289 8291 <div class="refsect1" lang="en" xml:lang="en"> 8290 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 48866"></a>8292 <a xmlns="http://www.w3.org/1999/xhtml" id="id402570"></a> 8291 8293 <div class="header">Description:</div> 8292 8294 <p xmlns="http://www.w3.org/1999/xhtml">The close generic function can be applied to sockets. It … … 8301 8303 <strong>[Macro]</strong> 8302 8304 <br></br> 8303 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">with-open-socket</strong></span>8305 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>with-open-socket</strong></span> 8304 8306 (var . make-socket-args) <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&body</em> body</code> 8305 8307 </div> … … 8309 8311 <div> 8310 8312 <div class="refsect1" lang="en" xml:lang="en"> 8311 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 58864"></a>8313 <a xmlns="http://www.w3.org/1999/xhtml" id="id402655"></a> 8312 8314 <div class="header">Arguments and Values:</div> 8313 8315 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">var</span></i>---variable to bind</p> … … 8316 8318 </div> 8317 8319 <div class="refsect1" lang="en" xml:lang="en"> 8318 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 69415"></a>8320 <a xmlns="http://www.w3.org/1999/xhtml" id="id402710"></a> 8319 8321 <div class="header">Description:</div> 8320 8322 <p xmlns="http://www.w3.org/1999/xhtml">executes body with var bound to the result of applying … … 8436 8438 <strong>[Function]</strong> 8437 8439 <br></br> 8438 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">run-program</strong></span>8440 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>run-program</strong></span> 8439 8441 program args <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&key</em> (wait t) pty input 8440 8442 if-input-does-not-exist output (if-output-exists :error) (error … … 8447 8449 <div> 8448 8450 <div class="refsect1" lang="en" xml:lang="en"> 8449 <a xmlns="http://www.w3.org/1999/xhtml" id="id 481469"></a>8451 <a xmlns="http://www.w3.org/1999/xhtml" id="id368679"></a> 8450 8452 <div class="header">Arguments and Values:</div> 8451 8453 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">program</span></i>---A string or pathname which denotes an executable file. … … 8489 8491 </div> 8490 8492 <div class="refsect1" lang="en" xml:lang="en"> 8491 <a xmlns="http://www.w3.org/1999/xhtml" id="id 461423"></a>8493 <a xmlns="http://www.w3.org/1999/xhtml" id="id354820"></a> 8492 8494 <div class="header">Description:</div> 8493 8495 <p xmlns="http://www.w3.org/1999/xhtml">Runs the specified program in an external (Unix) process, … … 8501 8503 <strong>[Function]</strong> 8502 8504 <br></br> 8503 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">signal-external-process</strong></span>8505 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>signal-external-process</strong></span> 8504 8506 proc signal-number</code> 8505 8507 </div> … … 8509 8511 <div> 8510 8512 <div class="refsect1" lang="en" xml:lang="en"> 8511 <a xmlns="http://www.w3.org/1999/xhtml" id="id 431361"></a>8513 <a xmlns="http://www.w3.org/1999/xhtml" id="id354877"></a> 8512 8514 <div class="header">Arguments and Values:</div> 8513 8515 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">proc</span></i>---An EXTERNAL-PROCESS, as returned by RUN-PROGRAM.</p> … … 8515 8517 </div> 8516 8518 <div class="refsect1" lang="en" xml:lang="en"> 8517 <a xmlns="http://www.w3.org/1999/xhtml" id="id 457362"></a>8519 <a xmlns="http://www.w3.org/1999/xhtml" id="id354917"></a> 8518 8520 <div class="header">Description:</div> 8519 8521 <p xmlns="http://www.w3.org/1999/xhtml">Sends the specified "signal" to the specified … … 8529 8531 <strong>[Function]</strong> 8530 8532 <br></br> 8531 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">external-process-id</strong></span>8533 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>external-process-id</strong></span> 8532 8534 proc</code> 8533 8535 </div> … … 8538 8540 <div> 8539 8541 <div class="refsect1" lang="en" xml:lang="en"> 8540 <a xmlns="http://www.w3.org/1999/xhtml" id="id 470325"></a>8542 <a xmlns="http://www.w3.org/1999/xhtml" id="id386150"></a> 8541 8543 <div class="header">Arguments and Values:</div> 8542 8544 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">proc</span></i>---An EXTERNAL-PROCESS, as returned by RUN-PROGRAM.</p> 8543 8545 </div> 8544 8546 <div class="refsect1" lang="en" xml:lang="en"> 8545 <a xmlns="http://www.w3.org/1999/xhtml" id="id 442573"></a>8547 <a xmlns="http://www.w3.org/1999/xhtml" id="id386176"></a> 8546 8548 <div class="header">Description:</div> 8547 8549 <p xmlns="http://www.w3.org/1999/xhtml">Returns the <span class="emphasis"><em>process id</em></span> assigned to … … 8556 8558 <strong>[Function]</strong> 8557 8559 <br></br> 8558 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">external-process-input-stream</strong></span>8560 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>external-process-input-stream</strong></span> 8559 8561 proc</code> 8560 8562 </div> … … 8565 8567 <div> 8566 8568 <div class="refsect1" lang="en" xml:lang="en"> 8567 <a xmlns="http://www.w3.org/1999/xhtml" id="id 472686"></a>8569 <a xmlns="http://www.w3.org/1999/xhtml" id="id369560"></a> 8568 8570 <div class="header">Arguments and Values:</div> 8569 8571 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">proc</span></i>---An EXTERNAL-PROCESS, as returned by RUN-PROGRAM.</p> 8570 8572 </div> 8571 8573 <div class="refsect1" lang="en" xml:lang="en"> 8572 <a xmlns="http://www.w3.org/1999/xhtml" id="id 480066"></a>8574 <a xmlns="http://www.w3.org/1999/xhtml" id="id369586"></a> 8573 8575 <div class="header">Description:</div> 8574 8576 <p xmlns="http://www.w3.org/1999/xhtml">Returns the stream created when the input argument to … … 8582 8584 <strong>[Function]</strong> 8583 8585 <br></br> 8584 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">external-process-output-stream</strong></span>8586 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>external-process-output-stream</strong></span> 8585 8587 proc</code> 8586 8588 </div> … … 8591 8593 <div> 8592 8594 <div class="refsect1" lang="en" xml:lang="en"> 8593 <a xmlns="http://www.w3.org/1999/xhtml" id="id 468658"></a>8595 <a xmlns="http://www.w3.org/1999/xhtml" id="id369647"></a> 8594 8596 <div class="header">Arguments and Values:</div> 8595 8597 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">proc</span></i>---An EXTERNAL-PROCESS, as returned by RUN-PROGRAM.</p> 8596 8598 </div> 8597 8599 <div class="refsect1" lang="en" xml:lang="en"> 8598 <a xmlns="http://www.w3.org/1999/xhtml" id="id 434953"></a>8600 <a xmlns="http://www.w3.org/1999/xhtml" id="id379281"></a> 8599 8601 <div class="header">Description:</div> 8600 8602 <p xmlns="http://www.w3.org/1999/xhtml">Returns the stream created when the output argument to … … 8608 8610 <strong>[Function]</strong> 8609 8611 <br></br> 8610 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">external-process-error-stream</strong></span>8612 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>external-process-error-stream</strong></span> 8611 8613 proc</code> 8612 8614 </div> … … 8618 8620 <div> 8619 8621 <div class="refsect1" lang="en" xml:lang="en"> 8620 <a xmlns="http://www.w3.org/1999/xhtml" id="id 500858"></a>8622 <a xmlns="http://www.w3.org/1999/xhtml" id="id379341"></a> 8621 8623 <div class="header">Arguments and Values:</div> 8622 8624 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">proc</span></i>---An EXTERNAL-PROCESS, as returned by RUN-PROGRAM.</p> 8623 8625 </div> 8624 8626 <div class="refsect1" lang="en" xml:lang="en"> 8625 <a xmlns="http://www.w3.org/1999/xhtml" id="id 490818"></a>8627 <a xmlns="http://www.w3.org/1999/xhtml" id="id379367"></a> 8626 8628 <div class="header">Description:</div> 8627 8629 <p xmlns="http://www.w3.org/1999/xhtml">Returns the stream created when the error argument to … … 8635 8637 <strong>[Function]</strong> 8636 8638 <br></br> 8637 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">external-process-status</strong></span>8639 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>external-process-status</strong></span> 8638 8640 proc</code> 8639 8641 </div> … … 8645 8647 <div> 8646 8648 <div class="refsect1" lang="en" xml:lang="en"> 8647 <a xmlns="http://www.w3.org/1999/xhtml" id="id 461170"></a>8649 <a xmlns="http://www.w3.org/1999/xhtml" id="id367898"></a> 8648 8650 <div class="header">Arguments and Values:</div> 8649 8651 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">proc</span></i>---An EXTERNAL-PROCESS, as returned by RUN-PROGRAM.</p> 8650 8652 </div> 8651 8653 <div class="refsect1" lang="en" xml:lang="en"> 8652 <a xmlns="http://www.w3.org/1999/xhtml" id="id 434075"></a>8654 <a xmlns="http://www.w3.org/1999/xhtml" id="id367924"></a> 8653 8655 <div class="header">Description:</div> 8654 8656 <p xmlns="http://www.w3.org/1999/xhtml">Returns, as multiple values, a keyword denoting the status … … 8680 8682 <dt> 8681 8683 <span class="sect2"> 8682 <a href="#id 467737">10.1.1. Stream External Encoding</a>8684 <a href="#id380903">10.1.1. Stream External Encoding</a> 8683 8685 </span> 8684 8686 </dt> … … 8748 8750 <div> 8749 8751 <div> 8750 <h3 class="title"><a id="id 467737"></a>10.1.1. Stream External Encoding</h3>8752 <h3 class="title"><a id="id380903"></a>10.1.1. Stream External Encoding</h3> 8751 8753 </div> 8752 8754 </div> … … 8754 8756 <p xmlns="http://www.w3.org/1999/xhtml">Clozure CL streams have an external-encoding attribute that 8755 8757 may be read using 8756 <span ><strong class="function">STREAM-EXTERNAL-ENCODING</strong></span> and set using <span><strong class="function">(SETF8758 <span class="function"><strong>STREAM-EXTERNAL-ENCODING</strong></span> and set using <span class="function"><strong>(SETF 8757 8759 STREAM-EXTERNAL-ENCODING)</strong></span>. 8758 8760 </p> … … 8766 8768 </div> 8767 8769 </div> 8768 <p xmlns="http://www.w3.org/1999/xhtml"><span ><strong class="function">OPEN</strong></span> and8769 <span ><strong class="function">MAKE-SOCKET</strong></span> have each been extended to take8770 <p xmlns="http://www.w3.org/1999/xhtml"><span class="function"><strong>OPEN</strong></span> and 8771 <span class="function"><strong>MAKE-SOCKET</strong></span> have each been extended to take 8770 8772 the additional keyword arguments: <code class="literal">:CLASS</code>, 8771 8773 <code class="literal">:SHARING</code>, and … … 8782 8784 The specified class must inherit from 8783 8785 <code class="literal">FILE-STREAM</code> for 8784 <span ><strong class="function">OPEN</strong></span>.</p>8786 <span class="function"><strong>OPEN</strong></span>.</p> 8785 8787 </dd> 8786 8788 <dt> … … 8823 8825 This makes it possible for instance, for one thread to 8824 8826 read from such a stream while another thread writes to 8825 it. (see also <a href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a>8826 <a href="#m_with-read-lock" title="Macro WITH-READ-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-read-lock</b></a> <ahref="#m_with-write-lock" title="Macro WITH-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-write-lock</b></a>)</p>8827 it. (see also <a class="xref" href="#f_make-read-write-lock" title="Function MAKE-READ-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-read-write-lock</b></a> 8828 <a class="xref" href="#m_with-read-lock" title="Macro WITH-READ-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-read-lock</b></a> <a class="xref" href="#m_with-write-lock" title="Macro WITH-WRITE-LOCK"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">with-write-lock</b></a>)</p> 8827 8829 </dd> 8828 8830 <dt> … … 8853 8855 a Gray stream, i.e. whether or not the stream is an instance 8854 8856 of <code class="literal">FUNDAMENTAL-STREAM</code> or 8855 <code class="literal">CCL::BASIC-STREAM</code>(see <a href="#Basic-Versus-Fundamental-Streams" title="10.1.3. Basic Versus Fundamental Streams">Section 10.1.3, âBasic Versus Fundamental Streamsâ</a>). Defaults to8857 <code class="literal">CCL::BASIC-STREAM</code>(see <a class="xref" href="#Basic-Versus-Fundamental-Streams" title="10.1.3. Basic Versus Fundamental Streams">Section 10.1.3, âBasic Versus Fundamental Streamsâ</a>). Defaults to 8856 8858 <code class="literal">T</code>.</p> 8857 8859 </dd> … … 8867 8869 </div> 8868 8870 </div> 8869 <p xmlns="http://www.w3.org/1999/xhtml">Gray streams (see <a href="#Creating-Your-Own-Stream-Classes-with-Gray-Streams" title="10.2. Creating Your Own Stream Classes with Gray Streams">Section 10.2, âCreating Your Own Stream Classes with Gray Streamsâ</a>)8871 <p xmlns="http://www.w3.org/1999/xhtml">Gray streams (see <a class="xref" href="#Creating-Your-Own-Stream-Classes-with-Gray-Streams" title="10.2. Creating Your Own Stream Classes with Gray Streams">Section 10.2, âCreating Your Own Stream Classes with Gray Streamsâ</a>) 8870 8872 all inherit from <code class="literal">FUNDAMENTAL-STREAM</code> whereas 8871 8873 basic streams inherit from <code class="literal">CCL::BASIC-STREAM</code>. … … 8886 8888 </p> 8887 8889 <p xmlns="http://www.w3.org/1999/xhtml">The Gray stream method 8888 <span ><strong class="function">STREAM-READ-CHAR</strong></span> should work on appropriate8890 <span class="function"><strong>STREAM-READ-CHAR</strong></span> should work on appropriate 8889 8891 <code class="literal">BASIC-STREAM</code>s. (There may still be cases 8890 8892 where such methods are undefined; such cases should be … … 8908 8910 </div> 8909 8911 </div> 8910 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 27146" class="indexterm"></a>8911 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 88528" class="indexterm"></a>8912 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 84109" class="indexterm"></a>8913 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 63965" class="indexterm"></a>8914 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 33256" class="indexterm"></a>8915 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 25542" class="indexterm"></a>8912 <a xmlns="http://www.w3.org/1999/xhtml" id="id402803" class="indexterm"></a> 8913 <a xmlns="http://www.w3.org/1999/xhtml" id="id402813" class="indexterm"></a> 8914 <a xmlns="http://www.w3.org/1999/xhtml" id="id402823" class="indexterm"></a> 8915 <a xmlns="http://www.w3.org/1999/xhtml" id="id402832" class="indexterm"></a> 8916 <a xmlns="http://www.w3.org/1999/xhtml" id="id402842" class="indexterm"></a> 8917 <a xmlns="http://www.w3.org/1999/xhtml" id="id402852" class="indexterm"></a> 8916 8918 <p xmlns="http://www.w3.org/1999/xhtml">A stream that is associated with a file descriptor has 8917 8919 attributes and accessors: 8918 <span ><strong class="function">STREAM-INPUT-TIMEOUT</strong></span>,8919 <span ><strong class="function">STREAM-OUTPUT-TIMEOUT</strong></span>, and8920 <span ><strong class="function">STREAM-DEADLINE</strong></span>. All three accessors have8921 corresponding <span ><strong class="function">SETF</strong></span> methods.8922 <span ><strong class="function">STREAM-INPUT-TIMEOUT</strong></span> and8923 <span ><strong class="function">STREAM-OUTPUT-TIMEOUT</strong></span> are specified in8920 <span class="function"><strong>STREAM-INPUT-TIMEOUT</strong></span>, 8921 <span class="function"><strong>STREAM-OUTPUT-TIMEOUT</strong></span>, and 8922 <span class="function"><strong>STREAM-DEADLINE</strong></span>. All three accessors have 8923 corresponding <span class="function"><strong>SETF</strong></span> methods. 8924 <span class="function"><strong>STREAM-INPUT-TIMEOUT</strong></span> and 8925 <span class="function"><strong>STREAM-OUTPUT-TIMEOUT</strong></span> are specified in 8924 8926 seconds and can be any positive real number less than one million. 8925 8927 When a timeout is set and the corresponding I/O operation takes … … 8957 8959 <br></br> 8958 8960 <code> 8959 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">open-file-streams</strong></span>8961 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>open-file-streams</strong></span> 8960 8962 => stream-list 8961 8963 </code> … … 8966 8968 <div> 8967 8969 <div class="refsect1" lang="en" xml:lang="en"> 8968 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 69274"></a>8970 <a xmlns="http://www.w3.org/1999/xhtml" id="id406598"></a> 8969 8971 <div class="header">Values:</div> 8970 8972 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">stream-list</span></i>---A list of open file streams. This is a copy of … … 8973 8975 </div> 8974 8976 <div class="refsect1" lang="en" xml:lang="en"> 8975 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 44191"></a>8977 <a xmlns="http://www.w3.org/1999/xhtml" id="id406625"></a> 8976 8978 <div class="header">Description:</div> 8977 8979 <p xmlns="http://www.w3.org/1999/xhtml">Returns a list of open file streams.</p> 8978 8980 </div> 8979 8981 <div class="refsect1" lang="en" xml:lang="en"> 8980 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 87677"></a>8982 <a xmlns="http://www.w3.org/1999/xhtml" id="id406636"></a> 8981 8983 <div class="header">See Also:</div> 8982 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#f_note-open-file-stream" title="Function NOTE-OPEN-FILE-STREAM"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">note-open-file-stream</b></a>, <ahref="#f_remove-open-file-stream" title="Function REMOVE-OPEN-FILE-STREAM"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">remove-open-file-stream</b></a></span>8984 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#f_note-open-file-stream" title="Function NOTE-OPEN-FILE-STREAM"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">note-open-file-stream</b></a>, <a class="xref" href="#f_remove-open-file-stream" title="Function REMOVE-OPEN-FILE-STREAM"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">remove-open-file-stream</b></a></span> 8983 8985 </div> 8984 8986 </div> … … 8990 8992 <br></br> 8991 8993 <code> 8992 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">note-open-file-stream</strong></span>8994 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>note-open-file-stream</strong></span> 8993 8995 file-stream 8994 8996 </code> … … 9001 9003 <div> 9002 9004 <div class="refsect1" lang="en" xml:lang="en"> 9003 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 75844"></a>9005 <a xmlns="http://www.w3.org/1999/xhtml" id="id406717"></a> 9004 9006 <div class="header">Arguments:</div> 9005 9007 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">file-stream</span></i>---A file stream.</p> 9006 9008 </div> 9007 9009 <div class="refsect1" lang="en" xml:lang="en"> 9008 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 72282"></a>9010 <a xmlns="http://www.w3.org/1999/xhtml" id="id406743"></a> 9009 9011 <div class="header">Description:</div> 9010 9012 <p xmlns="http://www.w3.org/1999/xhtml">Adds a file stream to the internal list of open 9011 9013 file streams that is returned by 9012 <span ><strong class="function">open-file-streams</strong></span>. This function is9014 <span class="function"><strong>open-file-streams</strong></span>. This function is 9013 9015 thread-safe. It will usually only be called from custom 9014 9016 stream code when a file-stream is created.</p> 9015 9017 </div> 9016 9018 <div class="refsect1" lang="en" xml:lang="en"> 9017 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 57744"></a>9019 <a xmlns="http://www.w3.org/1999/xhtml" id="id406762"></a> 9018 9020 <div class="header">See Also:</div> 9019 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#f_open-file-streams" title="Function OPEN-FILE-STREAMS"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">open-file-streams</b></a>, <ahref="#f_remove-open-file-stream" title="Function REMOVE-OPEN-FILE-STREAM"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">remove-open-file-stream</b></a></span>9021 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#f_open-file-streams" title="Function OPEN-FILE-STREAMS"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">open-file-streams</b></a>, <a class="xref" href="#f_remove-open-file-stream" title="Function REMOVE-OPEN-FILE-STREAM"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">remove-open-file-stream</b></a></span> 9020 9022 </div> 9021 9023 </div> … … 9027 9029 <br></br> 9028 9030 <code> 9029 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">remove-open-file-stream</strong></span>9031 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>remove-open-file-stream</strong></span> 9030 9032 file-stream 9031 9033 </code> … … 9038 9040 <div> 9039 9041 <div class="refsect1" lang="en" xml:lang="en"> 9040 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 33729"></a>9042 <a xmlns="http://www.w3.org/1999/xhtml" id="id406843"></a> 9041 9043 <div class="header">Arguments:</div> 9042 9044 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">file-stream</span></i>---A file stream.</p> 9043 9045 </div> 9044 9046 <div class="refsect1" lang="en" xml:lang="en"> 9045 <a xmlns="http://www.w3.org/1999/xhtml" id="id 501400"></a>9047 <a xmlns="http://www.w3.org/1999/xhtml" id="id406869"></a> 9046 9048 <div class="header">Description:</div> 9047 9049 <p xmlns="http://www.w3.org/1999/xhtml">Remove file stream from the internal list of open file 9048 9050 streams that is returned by 9049 <span ><strong class="function">open-file-streams</strong></span>. This function is9051 <span class="function"><strong>open-file-streams</strong></span>. This function is 9050 9052 thread-safe. It will usually only be called from custom 9051 9053 stream code when a file-stream is closed.</p> 9052 9054 </div> 9053 9055 <div class="refsect1" lang="en" xml:lang="en"> 9054 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 88897"></a>9056 <a xmlns="http://www.w3.org/1999/xhtml" id="id406888"></a> 9055 9057 <div class="header">See Also:</div> 9056 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a href="#f_open-file-streams" title="Function OPEN-FILE-STREAMS"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">open-file-streams</b></a>, <ahref="#f_note-open-file-stream" title="Function NOTE-OPEN-FILE-STREAM"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">note-open-file-stream</b></a></span>9058 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"><a class="xref" href="#f_open-file-streams" title="Function OPEN-FILE-STREAMS"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">open-file-streams</b></a>, <a class="xref" href="#f_note-open-file-stream" title="Function NOTE-OPEN-FILE-STREAM"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">note-open-file-stream</b></a></span> 9057 9059 </div> 9058 9060 </div> … … 9477 9479 <strong>[Generic Function]</strong> 9478 9480 <br></br> 9479 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">stream-read-list</strong></span>9481 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>stream-read-list</strong></span> 9480 9482 stream list count</code> 9481 9483 </div> … … 9485 9487 <div> 9486 9488 <div class="refsect1" lang="en" xml:lang="en"> 9487 <a xmlns="http://www.w3.org/1999/xhtml" id="id 511284"></a>9489 <a xmlns="http://www.w3.org/1999/xhtml" id="id407475"></a> 9488 9490 <div class="header">Arguments and Values:</div> 9489 9491 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">stream</span></i>---a stream, presumably a fundamental-input-stream.</p> … … 9496 9498 </div> 9497 9499 <div class="refsect1" lang="en" xml:lang="en"> 9498 <a xmlns="http://www.w3.org/1999/xhtml" id="id 511338"></a>9500 <a xmlns="http://www.w3.org/1999/xhtml" id="id407533"></a> 9499 9501 <div class="header">Description:</div> 9500 9502 <p xmlns="http://www.w3.org/1999/xhtml">Should try to read up to count elements from stream into the … … 9509 9511 <strong>[Generic Function]</strong> 9510 9512 <br></br> 9511 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">stream-write-list</strong></span>9513 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>stream-write-list</strong></span> 9512 9514 stream list count</code> 9513 9515 </div> … … 9517 9519 <div> 9518 9520 <div class="refsect1" lang="en" xml:lang="en"> 9519 <a xmlns="http://www.w3.org/1999/xhtml" id="id 511383"></a>9521 <a xmlns="http://www.w3.org/1999/xhtml" id="id407593"></a> 9520 9522 <div class="header">Arguments and Values:</div> 9521 9523 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">stream</span></i>---a stream, presumably a fundamental-output-stream.</p> … … 9528 9530 </div> 9529 9531 <div class="refsect1" lang="en" xml:lang="en"> 9530 <a xmlns="http://www.w3.org/1999/xhtml" id="id 511438"></a>9532 <a xmlns="http://www.w3.org/1999/xhtml" id="id407651"></a> 9531 9533 <div class="header">Description:</div> 9532 9534 <p xmlns="http://www.w3.org/1999/xhtml">should try to write the first count elements of list to … … 9540 9542 <strong>[Generic Function]</strong> 9541 9543 <br></br> 9542 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">stream-read-vector</strong></span>9544 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>stream-read-vector</strong></span> 9543 9545 stream vector start end</code> 9544 9546 </div> … … 9548 9550 <div> 9549 9551 <div class="refsect1" lang="en" xml:lang="en"> 9550 <a xmlns="http://www.w3.org/1999/xhtml" id="id 511482"></a>9552 <a xmlns="http://www.w3.org/1999/xhtml" id="id407709"></a> 9551 9553 <div class="header">Arguments and Values:</div> 9552 9554 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">stream</span></i>---a stream, presumably a fundamental-input-stream</p> … … 9564 9566 </div> 9565 9567 <div class="refsect1" lang="en" xml:lang="en"> 9566 <a xmlns="http://www.w3.org/1999/xhtml" id="id 511553"></a>9568 <a xmlns="http://www.w3.org/1999/xhtml" id="id407784"></a> 9567 9569 <div class="header">Description:</div> 9568 9570 <p xmlns="http://www.w3.org/1999/xhtml">should try to read successive elements from stream into … … 9579 9581 <strong>[Generic Function]</strong> 9580 9582 <br></br> 9581 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">stream-write-vector</strong></span>9583 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>stream-write-vector</strong></span> 9582 9584 stream vector start end</code> 9583 9585 </div> … … 9587 9589 <div> 9588 9590 <div class="refsect1" lang="en" xml:lang="en"> 9589 <a xmlns="http://www.w3.org/1999/xhtml" id="id 511600"></a>9591 <a xmlns="http://www.w3.org/1999/xhtml" id="id407844"></a> 9590 9592 <div class="header">Arguments and Values:</div> 9591 9593 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">stream</span></i>---a stream, presumably a fundamental-output-stream</p> … … 9603 9605 </div> 9604 9606 <div class="refsect1" lang="en" xml:lang="en"> 9605 <a xmlns="http://www.w3.org/1999/xhtml" id="id 511672"></a>9607 <a xmlns="http://www.w3.org/1999/xhtml" id="id407920"></a> 9606 9608 <div class="header">Description:</div> 9607 9609 <p xmlns="http://www.w3.org/1999/xhtml">should try to write successive elements of vector to stream, … … 9616 9618 <strong>[Generic Function]</strong> 9617 9619 <br></br> 9618 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">ccl::stream-device</strong></span>9620 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>ccl::stream-device</strong></span> 9619 9621 s direction</code> 9620 9622 </div> … … 9625 9627 <div> 9626 9628 <div class="refsect1" lang="en" xml:lang="en"> 9627 <a xmlns="http://www.w3.org/1999/xhtml" id="id 511719"></a>9629 <a xmlns="http://www.w3.org/1999/xhtml" id="id407980"></a> 9628 9630 <div class="header">Method Signatures:</div> 9629 <div class="synopsis"><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">ccl::stream-device</strong></span> <i>9631 <div class="synopsis"><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>ccl::stream-device</strong></span> <i> 9630 9632 (s stream) direction => fd</i></div> 9631 9633 </div> 9632 9634 <div class="refsect1" lang="en" xml:lang="en"> 9633 <a xmlns="http://www.w3.org/1999/xhtml" id="id 511731"></a>9635 <a xmlns="http://www.w3.org/1999/xhtml" id="id407998"></a> 9634 9636 <div class="header">Arguments and Values:</div> 9635 9637 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">s</span></i>---a stream.</p> … … 9642 9644 </div> 9643 9645 <div class="refsect1" lang="en" xml:lang="en"> 9644 <a xmlns="http://www.w3.org/1999/xhtml" id="id 511789"></a>9646 <a xmlns="http://www.w3.org/1999/xhtml" id="id408063"></a> 9645 9647 <div class="header">Description:</div> 9646 9648 <p xmlns="http://www.w3.org/1999/xhtml">Returns the file descriptor associated with … … 9658 9660 <strong>[Generic Function]</strong> 9659 9661 <br></br> 9660 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">stream-read-ivector</strong></span>9662 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>stream-read-ivector</strong></span> 9661 9663 stream ivector start-octet max-octets</code> 9662 9664 </div> … … 9666 9668 <div> 9667 9669 <div class="refsect1" lang="en" xml:lang="en"> 9668 <a xmlns="http://www.w3.org/1999/xhtml" id="id 511844"></a>9670 <a xmlns="http://www.w3.org/1999/xhtml" id="id408133"></a> 9669 9671 <div class="header">Description:</div> 9670 9672 <p xmlns="http://www.w3.org/1999/xhtml">Reads up to max-octets octets from stream into ivector, … … 9673 9675 </div> 9674 9676 <div class="refsect1" lang="en" xml:lang="en"> 9675 <a xmlns="http://www.w3.org/1999/xhtml" id="id 511857"></a>9677 <a xmlns="http://www.w3.org/1999/xhtml" id="id408145"></a> 9676 9678 <div class="header">Arguments:</div> 9677 9679 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">stream</span></i>---An input stream. The method defined on … … 9690 9692 <strong>[Generic Function]</strong> 9691 9693 <br></br> 9692 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">stream-write-ivector stream</strong></span>9694 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>stream-write-ivector stream</strong></span> 9693 9695 ivector start-octet max-octets</code> 9694 9696 </div> … … 9698 9700 <div> 9699 9701 <div class="refsect1" lang="en" xml:lang="en"> 9700 <a xmlns="http://www.w3.org/1999/xhtml" id="id 511954"></a>9702 <a xmlns="http://www.w3.org/1999/xhtml" id="id408264"></a> 9701 9703 <div class="header">Description:</div> 9702 9704 <p xmlns="http://www.w3.org/1999/xhtml">Writes max-octets octets to stream from ivector, starting at … … 9704 9706 </div> 9705 9707 <div class="refsect1" lang="en" xml:lang="en"> 9706 <a xmlns="http://www.w3.org/1999/xhtml" id="id 511966"></a>9708 <a xmlns="http://www.w3.org/1999/xhtml" id="id408276"></a> 9707 9709 <div class="header">Arguments:</div> 9708 9710 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">stream</span></i>---An input stream. The method defined on … … 9714 9716 </div> 9715 9717 <div class="refsect1" lang="en" xml:lang="en"> 9716 <a xmlns="http://www.w3.org/1999/xhtml" id="id 512030"></a>9718 <a xmlns="http://www.w3.org/1999/xhtml" id="id408348"></a> 9717 9719 <div class="header">Examples:</div> 9718 9720 <pre xmlns="http://www.w3.org/1999/xhtml" class="programlisting"> … … 10659 10661 <dt> 10660 10662 <span class="sect1"> 10661 <a href="#id 523636">12.12. The Foreign-Function-Interface Dictionary</a>10663 <a href="#id430545">12.12. The Foreign-Function-Interface Dictionary</a> 10662 10664 </span> 10663 10665 </dt> … … 10756 10758 corresponds to <code class="code">NS:NS-RECT</code>, and you can 10757 10759 use <code class="code">:NS-RECT</code> as a type designator 10758 in <a href="#anchor_rlet"><code class="code">RLET</code></a> forms to10760 in <a class="link" href="#anchor_rlet"><code class="code">RLET</code></a> forms to 10759 10761 specify a structure of type <code class="code">NS-RECT</code>.</p> 10760 10762 </li> … … 11002 11004 <dd> 11003 11005 <p>The argument/return values 11004 is <a href="#Referencing-and-Using-Foreign-Memory-Addresses" title="12.3. Referencing and Using Foreign Memory Addresses">a MACPTR</a>.</p>11006 is <a class="link" href="#Referencing-and-Using-Foreign-Memory-Addresses" title="12.3. Referencing and Using Foreign Memory Addresses">a MACPTR</a>.</p> 11005 11007 </dd> 11006 11008 <dt> … … 11487 11489 <div> 11488 11490 <div> 11489 <h4 class="title"><a id="id 520741"></a>12.3.2.4. %int-to-ptr [Function]</h4>11491 <h4 class="title"><a id="id410723"></a>12.3.2.4. %int-to-ptr [Function]</h4> 11490 11492 </div> 11491 11493 </div> … … 11528 11530 <div> 11529 11531 <div> 11530 <h4 class="title"><a id="id 520806"></a>12.3.2.5. %inc-ptr [Function]</h4>11532 <h4 class="title"><a id="id410798"></a>12.3.2.5. %inc-ptr [Function]</h4> 11531 11533 </div> 11532 11534 </div> … … 11578 11580 <div> 11579 11581 <div> 11580 <h4 class="title"><a id="id 520887"></a>12.3.2.6. %ptr-to-int [Function]</h4>11582 <h4 class="title"><a id="id410889"></a>12.3.2.6. %ptr-to-int [Function]</h4> 11581 11583 </div> 11582 11584 </div> … … 11620 11622 <div> 11621 11623 <div> 11622 <h4 class="title"><a id="id 520952"></a>12.3.2.7. %null-ptr [Macro]</h4>11624 <h4 class="title"><a id="id410964"></a>12.3.2.7. %null-ptr [Macro]</h4> 11623 11625 </div> 11624 11626 </div> … … 11645 11647 <div> 11646 11648 <div> 11647 <h4 class="title"><a id="id 520987"></a>12.3.2.8. %null-ptr-p [Function]</h4>11649 <h4 class="title"><a id="id411006"></a>12.3.2.8. %null-ptr-p [Function]</h4> 11648 11650 </div> 11649 11651 </div> … … 11687 11689 <div> 11688 11690 <div> 11689 <h4 class="title"><a id="id 521053"></a>12.3.2.9. %setf-macptr [Function]</h4>11691 <h4 class="title"><a id="id411081"></a>12.3.2.9. %setf-macptr [Function]</h4> 11690 11692 </div> 11691 11693 </div> … … 11735 11737 <div> 11736 11738 <div> 11737 <h4 class="title"><a id="id 521132"></a>12.3.2.10. %incf-ptr [Macro]</h4>11739 <h4 class="title"><a id="id411171"></a>12.3.2.10. %incf-ptr [Macro]</h4> 11738 11740 </div> 11739 11741 </div> … … 11783 11785 <div> 11784 11786 <div> 11785 <h4 class="title"><a id="id 521210"></a>12.3.2.11. with-macptrs [Macro]</h4>11787 <h4 class="title"><a id="id411262"></a>12.3.2.11. with-macptrs [Macro]</h4> 11786 11788 </div> 11787 11789 </div> … … 11833 11835 <div> 11834 11836 <div> 11835 <h4 class="title"><a id="id 521291"></a>12.3.2.12. %stack-block [Macro]</h4>11837 <h4 class="title"><a id="id411354"></a>12.3.2.12. %stack-block [Macro]</h4> 11836 11838 </div> 11837 11839 </div> … … 11884 11886 <div> 11885 11887 <div> 11886 <h4 class="title"><a id="id 521373"></a>12.3.2.13. make-cstring [Function]</h4>11888 <h4 class="title"><a id="id411446"></a>12.3.2.13. make-cstring [Function]</h4> 11887 11889 </div> 11888 11890 </div> … … 11927 11929 <div> 11928 11930 <div> 11929 <h4 class="title"><a id="id 521441"></a>12.3.2.14. with-cstrs [Macro]</h4>11931 <h4 class="title"><a id="id411522"></a>12.3.2.14. with-cstrs [Macro]</h4> 11930 11932 </div> 11931 11933 </div> … … 11977 11979 <div> 11978 11980 <div> 11979 <h4 class="title"><a id="id 521523"></a>12.3.2.15. with-encoded-cstrs [Macro]</h4>11981 <h4 class="title"><a id="id411614"></a>12.3.2.15. with-encoded-cstrs [Macro]</h4> 11980 11982 </div> 11981 11983 </div> … … 12040 12042 <div> 12041 12043 <div> 12042 <h4 class="title"><a id="id 521635"></a>12.3.2.16. %get-cstring [Function]</h4>12044 <h4 class="title"><a id="id411737"></a>12.3.2.16. %get-cstring [Function]</h4> 12043 12045 </div> 12044 12046 </div> … … 12082 12084 <div> 12083 12085 <div> 12084 <h4 class="title"><a id="id 521700"></a>12.3.2.17. %str-from-ptr [Function]</h4>12086 <h4 class="title"><a id="id428584"></a>12.3.2.17. %str-from-ptr [Function]</h4> 12085 12087 </div> 12086 12088 </div> … … 12183 12185 reader macros (and references to foreign record types and 12184 12186 fields), compiling <code class="literal">CCL</code> from those sources depends on the 12185 ability to find and use (see <a href="#Building-the-heap-image" title="3.5. Building the heap image">Section 3.5, âBuilding the heap imageâ</a>).</p>12187 ability to find and use (see <a class="xref" href="#Building-the-heap-image" title="3.5. Building the heap image">Section 3.5, âBuilding the heap imageâ</a>).</p> 12186 12188 </div> 12187 12189 <div class="sect2" lang="en" xml:lang="en"> … … 12198 12200 <p><code class="literal">CCL</code> now preserves the case of external symbols in 12199 12201 its database 12200 files. See <a href="#Case-sensitivity-of-foreign-names-in-CCL" title="12.8. Case-sensitivity of foreign names in CCL">Case-sensitivity12202 files. See <a class="link" href="#Case-sensitivity-of-foreign-names-in-CCL" title="12.8. Case-sensitivity of foreign names in CCL">Case-sensitivity 12201 12203 of foreign names in <code class="literal">CCL</code></a> for information about 12202 12204 case in foreign symbol names.</p> … … 12213 12215 </div> 12214 12216 <p xmlns="http://www.w3.org/1999/xhtml">For information about building the database files, 12215 see <a href="#The-Interface-Translator" title="12.7. The Interface Translator">Section 12.7, âThe Interface Translatorâ</a>.</p>12217 see <a class="xref" href="#The-Interface-Translator" title="12.7. The Interface Translator">Section 12.7, âThe Interface Translatorâ</a>.</p> 12216 12218 </div> 12217 12219 </div> … … 12353 12355 </ol> 12354 12356 </div> 12355 <p xmlns="http://www.w3.org/1999/xhtml">Refer to <a href="#The-Interface-Translator" title="12.7. The Interface Translator">Section 12.7, âThe Interface Translatorâ</a> for12357 <p xmlns="http://www.w3.org/1999/xhtml">Refer to <a class="xref" href="#The-Interface-Translator" title="12.7. The Interface Translator">Section 12.7, âThe Interface Translatorâ</a> for 12356 12358 information about running the interface translator and .ffi 12357 12359 parser.</p> … … 12386 12388 <p xmlns="http://www.w3.org/1999/xhtml"><code class="literal">CCL</code> provides facilities to open and close shared 12387 12389 libraries.</p> 12388 <p xmlns="http://www.w3.org/1999/xhtml">"Opening" a shared library, which is done with <a href="#f_open-shared-library" title="Function OPEN-SHARED-LIBRARY"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">open-shared-library</b></a>, maps the library's code and12390 <p xmlns="http://www.w3.org/1999/xhtml">"Opening" a shared library, which is done with <a class="xref" href="#f_open-shared-library" title="Function OPEN-SHARED-LIBRARY"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">open-shared-library</b></a>, maps the library's code and 12389 12391 data into <code class="literal">CCL</code>'s address space and makes its exported 12390 12392 symbols accessible to <code class="literal">CCL</code>.</p> 12391 <p xmlns="http://www.w3.org/1999/xhtml">"Closing" a shared library, which is done with <a href="#f_close-shared-library" title="Function CLOSE-SHARED-LIBRARY"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">close-shared-library</b></a>, unmaps the library's code12393 <p xmlns="http://www.w3.org/1999/xhtml">"Closing" a shared library, which is done with <a class="xref" href="#f_close-shared-library" title="Function CLOSE-SHARED-LIBRARY"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">close-shared-library</b></a>, unmaps the library's code 12392 12394 and and removes the library's symbols from the global 12393 12395 namespace.</p> … … 12929 12931 functions can actually be found by the system. We don't have to 12930 12932 do this, but it helps to know how to find out whether this is 12931 the problem, when something goes wrong. We use <a href="#m_external-call" title="Macro EXTERNAL-CALL"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">external-call</b></a>:</p>12933 the problem, when something goes wrong. We use <a class="xref" href="#m_external-call" title="Macro EXTERNAL-CALL"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">external-call</b></a>:</p> 12932 12934 <pre xmlns="http://www.w3.org/1999/xhtml" class="programlisting"> 12933 12935 … … 13589 13591 <div> 13590 13592 <div> 13591 <h2 class="title" style="clear: both"><a id="id 523636"></a>12.12. The Foreign-Function-Interface Dictionary</h2>13593 <h2 class="title" style="clear: both"><a id="id430545"></a>12.12. The Foreign-Function-Interface Dictionary</h2> 13592 13594 </div> 13593 13595 </div> … … 13606 13608 <div> 13607 13609 <div class="refsect1" lang="en" xml:lang="en"> 13608 <a xmlns="http://www.w3.org/1999/xhtml" id="id 523669"></a>13610 <a xmlns="http://www.w3.org/1999/xhtml" id="id430583"></a> 13609 13611 <div class="header">Description:</div> 13610 13612 <p xmlns="http://www.w3.org/1999/xhtml">Reads a symbol from the current input stream, with *PACKAGE* 13611 13613 bound to the "OS" package and with readtable-case preserved.</p> 13612 <p xmlns="http://www.w3.org/1999/xhtml">Does a lookup on that symbol in <a href="#The-Interface-Database" title="12.4. The Interface Database">the <code class="literal">CCL</code> interface13614 <p xmlns="http://www.w3.org/1999/xhtml">Does a lookup on that symbol in <a class="link" href="#The-Interface-Database" title="12.4. The Interface Database">the <code class="literal">CCL</code> interface 13613 13615 database</a>, signalling an error if no foreign function 13614 information can be found for the symbol in any active <a href="#Using-Interface-Directories" title="12.5. Using Interface Directories">interface13616 information can be found for the symbol in any active <a class="link" href="#Using-Interface-Directories" title="12.5. Using Interface Directories">interface 13615 13617 directory</a>.</p> 13616 13618 <p xmlns="http://www.w3.org/1999/xhtml">Notes the foreign function information, including the foreign … … 13658 13660 <div> 13659 13661 <div class="refsect1" lang="en" xml:lang="en"> 13660 <a xmlns="http://www.w3.org/1999/xhtml" id="id 523776"></a>13662 <a xmlns="http://www.w3.org/1999/xhtml" id="id430689"></a> 13661 13663 <div class="header">Description:</div> 13662 13664 <p xmlns="http://www.w3.org/1999/xhtml">In <code class="literal">CCL</code> 1.2 and later, the #& reader macro can be used to … … 13717 13719 <div> 13718 13720 <div class="refsect1" lang="en" xml:lang="en"> 13719 <a xmlns="http://www.w3.org/1999/xhtml" id="id 523895"></a>13721 <a xmlns="http://www.w3.org/1999/xhtml" id="id430806"></a> 13720 13722 <div class="header">Description:</div> 13721 13723 <p xmlns="http://www.w3.org/1999/xhtml">In <code class="literal">CCL</code> 0.14.2 and later, the #? reader macro can be used … … 13764 13766 <div> 13765 13767 <div class="refsect1" lang="en" xml:lang="en"> 13766 <a xmlns="http://www.w3.org/1999/xhtml" id="id 523978"></a>13768 <a xmlns="http://www.w3.org/1999/xhtml" id="id430889"></a> 13767 13769 <div class="header">Description:</div> 13768 13770 <p xmlns="http://www.w3.org/1999/xhtml">In <code class="literal">CCL</code> 1.2 and later, the #/ reader macro can be used to … … 13867 13869 <div> 13868 13870 <div class="refsect1" lang="en" xml:lang="en"> 13869 <a xmlns="http://www.w3.org/1999/xhtml" id="id 524405"></a>13871 <a xmlns="http://www.w3.org/1999/xhtml" id="id431028"></a> 13870 13872 <div class="header">Description:</div> 13871 13873 <p xmlns="http://www.w3.org/1999/xhtml">In Clozure CL 1.2 and later, the #> reader macro reads … … 13887 13889 <br></br> 13888 13890 <code> 13889 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">close-shared-library</strong></span> library <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&key</em>13891 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>close-shared-library</strong></span> library <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&key</em> 13890 13892 completely</code> 13891 13893 </div> … … 13896 13898 <div> 13897 13899 <div class="refsect1" lang="en" xml:lang="en"> 13898 <a xmlns="http://www.w3.org/1999/xhtml" id="id 524468"></a>13900 <a xmlns="http://www.w3.org/1999/xhtml" id="id431097"></a> 13899 13901 <div class="header">Values:</div> 13900 13902 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">library</span></i>---either an object of type SHLIB, or a string which … … 13903 13905 </div> 13904 13906 <div class="refsect1" lang="en" xml:lang="en"> 13905 <a xmlns="http://www.w3.org/1999/xhtml" id="id 524505"></a>13907 <a xmlns="http://www.w3.org/1999/xhtml" id="id431134"></a> 13906 13908 <div class="header">Description:</div> 13907 13909 <p xmlns="http://www.w3.org/1999/xhtml">If <em class="varname">completely</em> is T, sets the 13908 13910 reference count of <em class="varname">library</em> to 0. Otherwise, 13909 13911 decrements it by 1. In either case, if the reference count 13910 becomes 0, <span ><strong class="function">close-shared-library</strong></span>13912 becomes 0, <span class="function"><strong>close-shared-library</strong></span> 13911 13913 frees all memory resources consumed <em class="varname">library</em> 13912 13914 and … … 13922 13924 <br></br> 13923 13925 <code> 13924 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">defcallback</strong></span> name13926 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>defcallback</strong></span> name 13925 13927 ({arg-type-specifier var}* <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&optional</em> result-type-specifier) 13926 13928 <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&body</em> body … … 13932 13934 <div> 13933 13935 <div class="refsect1" lang="en" xml:lang="en"> 13934 <a xmlns="http://www.w3.org/1999/xhtml" id="id 524573"></a>13936 <a xmlns="http://www.w3.org/1999/xhtml" id="id431210"></a> 13935 13937 <div class="header">Values:</div> 13936 13938 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">name</span></i>---A symbol which can be made into a special variable</p> 13937 13939 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">arg-type-specifer</span></i>---One of the foreign argument-type keywords, 13938 described above, or an equivalent <a xmlns="http://www.w3.org/1999/xhtml" href="#Specifying-And-Using-Foreign-Types" title="12.1. Specifying And Using Foreign Types">foreign13940 described above, or an equivalent <a xmlns="http://www.w3.org/1999/xhtml" class="link" href="#Specifying-And-Using-Foreign-Types" title="12.1. Specifying And Using Foreign Types">foreign 13939 13941 type specifier</a>. In addition, if the keyword 13940 13942 :WITHOUT-INTERRUPTS is specified, the callback will be … … 13949 13951 </div> 13950 13952 <div class="refsect1" lang="en" xml:lang="en"> 13951 <a xmlns="http://www.w3.org/1999/xhtml" id="id 524649"></a>13953 <a xmlns="http://www.w3.org/1999/xhtml" id="id431281"></a> 13952 13954 <div class="header">Description:</div> 13953 13955 <p xmlns="http://www.w3.org/1999/xhtml">Proclaims <em class="varname">name</em> … … 13965 13967 This feature allows for callback functions to be redefined 13966 13968 incrementally, just like Lisp functions are.</p> 13967 <p xmlns="http://www.w3.org/1999/xhtml"><span ><strong class="function">defcallback</strong></span>13969 <p xmlns="http://www.w3.org/1999/xhtml"><span class="function"><strong>defcallback</strong></span> 13968 13970 returns the callback pointer, e.g., the 13969 13971 value of <em class="varname">name</em>.</p> … … 13977 13979 <br></br> 13978 13980 <code> 13979 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">def-foreign-type</strong></span> name foreign-type-spec13981 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>def-foreign-type</strong></span> name foreign-type-spec 13980 13982 </code> 13981 13983 </div> … … 13985 13987 <div> 13986 13988 <div class="refsect1" lang="en" xml:lang="en"> 13987 <a xmlns="http://www.w3.org/1999/xhtml" id="id 524725"></a>13989 <a xmlns="http://www.w3.org/1999/xhtml" id="id431360"></a> 13988 13990 <div class="header">Values:</div> 13989 13991 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">name</span></i>---NIL or a keyword; the keyword may contain 13990 <a xmlns="http://www.w3.org/1999/xhtml" href="#Case-sensitivity-of-foreign-names-in-CCL" title="12.8. Case-sensitivity of foreign names in CCL">escaping constructs</a>.</p>13992 <a xmlns="http://www.w3.org/1999/xhtml" class="link" href="#Case-sensitivity-of-foreign-names-in-CCL" title="12.8. Case-sensitivity of foreign names in CCL">escaping constructs</a>.</p> 13991 13993 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">foreign-type-spec</span></i>---A foreign type specifier, whose syntax is (loosely) 13992 13994 defined above.</p> 13993 13995 </div> 13994 13996 <div class="refsect1" lang="en" xml:lang="en"> 13995 <a xmlns="http://www.w3.org/1999/xhtml" id="id 524767"></a>13997 <a xmlns="http://www.w3.org/1999/xhtml" id="id431402"></a> 13996 13998 <div class="header">Description:</div> 13997 13999 <p xmlns="http://www.w3.org/1999/xhtml">If name is non-NIL, defines name to be an alias for the … … 14018 14020 <br></br> 14019 14021 <code> 14020 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">external</strong></span> name => entry14022 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>external</strong></span> name => entry 14021 14023 </code> 14022 14024 </div> … … 14027 14029 <div> 14028 14030 <div class="refsect1" lang="en" xml:lang="en"> 14029 <a xmlns="http://www.w3.org/1999/xhtml" id="id 524838"></a>14031 <a xmlns="http://www.w3.org/1999/xhtml" id="id431474"></a> 14030 14032 <div class="header">Values:</div> 14031 14033 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">name</span></i>--- … … 14040 14042 </div> 14041 14043 <div class="refsect1" lang="en" xml:lang="en"> 14042 <a xmlns="http://www.w3.org/1999/xhtml" id="id 524880"></a>14044 <a xmlns="http://www.w3.org/1999/xhtml" id="id431515"></a> 14043 14045 <div class="header">Description:</div> 14044 14046 <p xmlns="http://www.w3.org/1999/xhtml">If there is already an EXTERNAL-ENTRY-POINT for … … 14059 14061 <br></br> 14060 14062 <code> 14061 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">external-call</strong></span> name14063 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>external-call</strong></span> name 14062 14064 {arg-type-specifier arg}* <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&optional</em> result-type-specifier 14063 14065 </code> … … 14068 14070 <div> 14069 14071 <div class="refsect1" lang="en" xml:lang="en"> 14070 <a xmlns="http://www.w3.org/1999/xhtml" id="id 524945"></a>14072 <a xmlns="http://www.w3.org/1999/xhtml" id="id431584"></a> 14071 14073 <div class="header">Values:</div> 14072 14074 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">name</span></i>---A lisp string. See external, above.</p> 14073 14075 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">arg-type-specifer</span></i>---One of the foreign argument-type keywords, described 14074 above, or an equivalent <a xmlns="http://www.w3.org/1999/xhtml" href="#Specifying-And-Using-Foreign-Types" title="12.1. Specifying And Using Foreign Types">foreign14076 above, or an equivalent <a xmlns="http://www.w3.org/1999/xhtml" class="link" href="#Specifying-And-Using-Foreign-Types" title="12.1. Specifying And Using Foreign Types">foreign 14075 14077 type specifier</a>.</p> 14076 14078 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">arg</span></i>---A lisp value of type indicated by the corresponding 14077 14079 arg-type-specifier</p> 14078 14080 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">result-type-specifier</span></i>---One of the foreign argument-type keywords, described 14079 above, or an equivalent <a xmlns="http://www.w3.org/1999/xhtml" href="#Specifying-And-Using-Foreign-Types" title="12.1. Specifying And Using Foreign Types">foreign14081 above, or an equivalent <a xmlns="http://www.w3.org/1999/xhtml" class="link" href="#Specifying-And-Using-Foreign-Types" title="12.1. Specifying And Using Foreign Types">foreign 14080 14082 type specifier</a>.</p> 14081 14083 </div> 14082 14084 <div class="refsect1" lang="en" xml:lang="en"> 14083 <a xmlns="http://www.w3.org/1999/xhtml" id="id 525019"></a>14085 <a xmlns="http://www.w3.org/1999/xhtml" id="id431657"></a> 14084 14086 <div class="header">Description:</div> 14085 14087 <p xmlns="http://www.w3.org/1999/xhtml">Calls the foreign function at the address obtained by … … 14099 14101 <br></br> 14100 14102 <code> 14101 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">%ff-call</strong></span> entrypoint14103 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>%ff-call</strong></span> entrypoint 14102 14104 {arg-type-keyword arg}* <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&optional</em> result-type-keyword 14103 14105 </code> … … 14108 14110 <div> 14109 14111 <div class="refsect1" lang="en" xml:lang="en"> 14110 <a xmlns="http://www.w3.org/1999/xhtml" id="id 525074"></a>14112 <a xmlns="http://www.w3.org/1999/xhtml" id="id431717"></a> 14111 14113 <div class="header">Values:</div> 14112 14114 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">entrypoint</span></i>---A fixnum or MACPTR</p> … … 14119 14121 </div> 14120 14122 <div class="refsect1" lang="en" xml:lang="en"> 14121 <a xmlns="http://www.w3.org/1999/xhtml" id="id 525139"></a>14123 <a xmlns="http://www.w3.org/1999/xhtml" id="id431780"></a> 14122 14124 <div class="header">Description:</div> 14123 14125 <p xmlns="http://www.w3.org/1999/xhtml">Calls the foreign function at address entrypoint passing the … … 14136 14138 <br></br> 14137 14139 <code> 14138 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">ff-call</strong></span> entrypoint14140 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>ff-call</strong></span> entrypoint 14139 14141 {arg-type-specifier arg}* <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&optional</em> result-type-specifier 14140 14142 </code> … … 14145 14147 <div> 14146 14148 <div class="refsect1" lang="en" xml:lang="en"> 14147 <a xmlns="http://www.w3.org/1999/xhtml" id="id 525193"></a>14149 <a xmlns="http://www.w3.org/1999/xhtml" id="id431839"></a> 14148 14150 <div class="header">Values:</div> 14149 14151 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">entrypoint</span></i>---A fixnum or MACPTR</p> 14150 14152 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">arg-type-specifer</span></i>---One of the foreign argument-type keywords, described 14151 above, or an equivalent <a xmlns="http://www.w3.org/1999/xhtml" href="#Specifying-And-Using-Foreign-Types" title="12.1. Specifying And Using Foreign Types">foreign14153 above, or an equivalent <a xmlns="http://www.w3.org/1999/xhtml" class="link" href="#Specifying-And-Using-Foreign-Types" title="12.1. Specifying And Using Foreign Types">foreign 14152 14154 type specifier</a>.</p> 14153 14155 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">arg</span></i>---A lisp value of type indicated by the corresponding 14154 14156 arg-type-specifier</p> 14155 14157 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">result-type-specifier</span></i>---One of the foreign argument-type keywords, described 14156 above, or an equivalent <a xmlns="http://www.w3.org/1999/xhtml" href="#Specifying-And-Using-Foreign-Types" title="12.1. Specifying And Using Foreign Types">foreign14158 above, or an equivalent <a xmlns="http://www.w3.org/1999/xhtml" class="link" href="#Specifying-And-Using-Foreign-Types" title="12.1. Specifying And Using Foreign Types">foreign 14157 14159 type specifier</a>.</p> 14158 14160 </div> 14159 14161 <div class="refsect1" lang="en" xml:lang="en"> 14160 <a xmlns="http://www.w3.org/1999/xhtml" id="id 525267"></a>14162 <a xmlns="http://www.w3.org/1999/xhtml" id="id431912"></a> 14161 14163 <div class="header">Description:</div> 14162 14164 <p xmlns="http://www.w3.org/1999/xhtml">Calls the foreign function at address entrypoint passing the … … 14175 14177 <br></br> 14176 14178 <code> 14177 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">foreign-symbol-address</strong></span> name14179 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>foreign-symbol-address</strong></span> name 14178 14180 </code> 14179 14181 </div> … … 14183 14185 <div> 14184 14186 <div class="refsect1" lang="en" xml:lang="en"> 14185 <a xmlns="http://www.w3.org/1999/xhtml" id="id 525318"></a>14187 <a xmlns="http://www.w3.org/1999/xhtml" id="id431968"></a> 14186 14188 <div class="header">Values:</div> 14187 14189 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">name</span></i>---A lisp string.</p> 14188 14190 </div> 14189 14191 <div class="refsect1" lang="en" xml:lang="en"> 14190 <a xmlns="http://www.w3.org/1999/xhtml" id="id 525340"></a>14192 <a xmlns="http://www.w3.org/1999/xhtml" id="id431990"></a> 14191 14193 <div class="header">Description:</div> 14192 14194 <p xmlns="http://www.w3.org/1999/xhtml">Tries to resolve the address of the foreign symbol 14193 14195 name. If successful, returns that address encapsulated in 14194 <a href="#Referencing-and-Using-Foreign-Memory-Addresses" title="12.3. Referencing and Using Foreign Memory Addresses">a14196 <a class="link" href="#Referencing-and-Using-Foreign-Memory-Addresses" title="12.3. Referencing and Using Foreign Memory Addresses">a 14195 14197 MACPTR</a>, else returns NIL.</p> 14196 14198 </div> … … 14203 14205 <br></br> 14204 14206 <code> 14205 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">foreign-symbol-entry</strong></span> name14207 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>foreign-symbol-entry</strong></span> name 14206 14208 </code> 14207 14209 </div> … … 14211 14213 <div> 14212 14214 <div class="refsect1" lang="en" xml:lang="en"> 14213 <a xmlns="http://www.w3.org/1999/xhtml" id="id 525392"></a>14215 <a xmlns="http://www.w3.org/1999/xhtml" id="id432050"></a> 14214 14216 <div class="header">Values:</div> 14215 14217 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">name</span></i>---A lisp string.</p> 14216 14218 </div> 14217 14219 <div class="refsect1" lang="en" xml:lang="en"> 14218 <a xmlns="http://www.w3.org/1999/xhtml" id="id 525414"></a>14220 <a xmlns="http://www.w3.org/1999/xhtml" id="id432072"></a> 14219 14221 <div class="header">Description:</div> 14220 14222 <p xmlns="http://www.w3.org/1999/xhtml">Tries to resolve the address of the foreign symbol name. If … … 14230 14232 <br></br> 14231 14233 <code> 14232 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">free</strong></span> ptr14234 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>free</strong></span> ptr 14233 14235 </code> 14234 14236 </div> … … 14238 14240 <div> 14239 14241 <div class="refsect1" lang="en" xml:lang="en"> 14240 <a xmlns="http://www.w3.org/1999/xhtml" id="id 525461"></a>14242 <a xmlns="http://www.w3.org/1999/xhtml" id="id432126"></a> 14241 14243 <div class="header">Values:</div> 14242 14244 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">ptr</span></i>---A <code xmlns="http://www.w3.org/1999/xhtml" class="code">MACPTR</code> that points to a block of … … 14244 14246 </div> 14245 14247 <div class="refsect1" lang="en" xml:lang="en"> 14246 <a xmlns="http://www.w3.org/1999/xhtml" id="id 525488"></a>14248 <a xmlns="http://www.w3.org/1999/xhtml" id="id432152"></a> 14247 14249 <div class="header">Description:</div> 14248 14250 <p xmlns="http://www.w3.org/1999/xhtml">In Clozure CL 1.2 and later, the <code class="code">CCL:FREE</code> … … 14267 14269 <br></br> 14268 14270 <code> 14269 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">make-gcable-record</strong></span> typespec14271 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>make-gcable-record</strong></span> typespec 14270 14272 <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&rest</em> initforms => result 14271 14273 </code> … … 14276 14278 <div> 14277 14279 <div class="refsect1" lang="en" xml:lang="en"> 14278 <a xmlns="http://www.w3.org/1999/xhtml" id="id 525572"></a>14280 <a xmlns="http://www.w3.org/1999/xhtml" id="id432243"></a> 14279 14281 <div class="header">Values:</div> 14280 14282 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">typespec</span></i>---A foreign type specifier, or a keyword which is used … … 14285 14287 values appropriate for the types of those fields.</p> 14286 14288 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">result</span></i>--- 14287 A <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="type">macptr</strong></span> which encapsulates the address of a14289 A <span xmlns="http://www.w3.org/1999/xhtml" class="type"><strong>macptr</strong></span> which encapsulates the address of a 14288 14290 newly-allocated record on the foreign heap. The foreign 14289 object returned by <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">make-gcable-record</strong></span>14291 object returned by <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>make-gcable-record</strong></span> 14290 14292 is freed when the garbage collector determines that 14291 14293 the <code xmlns="http://www.w3.org/1999/xhtml" class="code">MACPTR</code> object that describes it is … … 14293 14295 </div> 14294 14296 <div class="refsect1" lang="en" xml:lang="en"> 14295 <a xmlns="http://www.w3.org/1999/xhtml" id="id 525642"></a>14297 <a xmlns="http://www.w3.org/1999/xhtml" id="id432310"></a> 14296 14298 <div class="header">Description:</div> 14297 14299 <p xmlns="http://www.w3.org/1999/xhtml"> 14298 14300 Allocates a block of foreign memory suitable to hold the foreign 14299 14301 type described by <code class="code">typespec</code>, in the same manner 14300 as <a href="#anchor_make-record">MAKE-RECORD</a>. In14302 as <a class="link" href="#anchor_make-record">MAKE-RECORD</a>. In 14301 14303 addition, <code class="code">MAKE-GCABLE-RECORD</code> marks the 14302 14304 returned object gcable; in other words, it informs the garbage … … 14306 14308 <p xmlns="http://www.w3.org/1999/xhtml">In all other respects, <code class="code">MAKE-GCABLE-RECORD</code> works 14307 14309 the same way 14308 as <a href="#anchor_make-record">MAKE-RECORD</a></p>14310 as <a class="link" href="#anchor_make-record">MAKE-RECORD</a></p> 14309 14311 <p xmlns="http://www.w3.org/1999/xhtml"> When using gcable pointers, it's important to remember the 14310 14312 distinction between a <code class="code">MACPTR</code> object (which is a … … 14333 14335 <br></br> 14334 14336 <code> 14335 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">make-record</strong></span> typespec14337 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>make-record</strong></span> typespec 14336 14338 <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&rest</em> initforms => result 14337 14339 </code> … … 14342 14344 <div> 14343 14345 <div class="refsect1" lang="en" xml:lang="en"> 14344 <a xmlns="http://www.w3.org/1999/xhtml" id="id 525758"></a>14346 <a xmlns="http://www.w3.org/1999/xhtml" id="id432426"></a> 14345 14347 <div class="header">Values:</div> 14346 14348 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">typespec</span></i>---A foreign type specifier, or a keyword which is used … … 14351 14353 values appropriate for the types of those fields.</p> 14352 14354 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">result</span></i>--- 14353 A <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="type">macptr</strong></span> which encapsulates the address of a14355 A <span xmlns="http://www.w3.org/1999/xhtml" class="type"><strong>macptr</strong></span> which encapsulates the address of a 14354 14356 newly-allocated record on the foreign heap. 14355 14357 </p> 14356 14358 </div> 14357 14359 <div class="refsect1" lang="en" xml:lang="en"> 14358 <a xmlns="http://www.w3.org/1999/xhtml" id="id 525819"></a>14360 <a xmlns="http://www.w3.org/1999/xhtml" id="id432484"></a> 14359 14361 <div class="header">Description:</div> 14360 14362 <p xmlns="http://www.w3.org/1999/xhtml"> … … 14363 14365 denoted by <em class="varname">typespec</em>, on the foreign 14364 14366 heap. The record is allocated using the C function 14365 <span ><strong class="function">malloc</strong></span>, and the user of14366 <span ><strong class="function">make-record</strong></span> must explicitly call14367 the function <span ><strong class="function">CCL:FREE</strong></span> to deallocate the14367 <span class="function"><strong>malloc</strong></span>, and the user of 14368 <span class="function"><strong>make-record</strong></span> must explicitly call 14369 the function <span class="function"><strong>CCL:FREE</strong></span> to deallocate the 14368 14370 record, when it is no longer needed. 14369 14371 </p> … … 14373 14375 is a scalar, <em class="varname">initforms</em> is either a single 14374 14376 value which can be coerced to that type, or no value, in which 14375 case binary 0 is used. When the type is a <span ><strong class="type">struct</strong></span>,14377 case binary 0 is used. When the type is a <span class="type"><strong>struct</strong></span>, 14376 14378 <em class="varname">initforms</em> is a list, giving field names 14377 14379 and the values for each. Each field is treated in the same way … … 14381 14383 <p xmlns="http://www.w3.org/1999/xhtml"> 14382 14384 When the type is an array, <em class="varname">initforms</em> may 14383 not be provided, because <span ><strong class="function">make-record</strong></span>14384 cannot initialize its values. <span ><strong class="function">make-record</strong></span>14385 is also unable to initialize fields of a <span ><strong class="type">struct</strong></span>14385 not be provided, because <span class="function"><strong>make-record</strong></span> 14386 cannot initialize its values. <span class="function"><strong>make-record</strong></span> 14387 is also unable to initialize fields of a <span class="type"><strong>struct</strong></span> 14386 14388 which are themselves 14387 <span ><strong class="type">struct</strong></span>s. The user of14388 <span ><strong class="function">make-record</strong></span> should set these values14389 <span class="type"><strong>struct</strong></span>s. The user of 14390 <span class="function"><strong>make-record</strong></span> should set these values 14389 14391 by another means. 14390 14392 </p> … … 14392 14394 A possibly-significant limitation is that it must be possible to 14393 14395 find the foreign type at the time the macro is expanded; 14394 <span ><strong class="function">make-record</strong></span> signals an error if this is14396 <span class="function"><strong>make-record</strong></span> signals an error if this is 14395 14397 not the case. 14396 14398 </p> 14397 14399 </div> 14398 14400 <div class="refsect1" lang="en" xml:lang="en"> 14399 <a xmlns="http://www.w3.org/1999/xhtml" id="id 525905"></a>14401 <a xmlns="http://www.w3.org/1999/xhtml" id="id432574"></a> 14400 14402 <div class="header">Notes:</div> 14401 14403 <p xmlns="http://www.w3.org/1999/xhtml"> 14402 It is inconvenient that <span ><strong class="function">make-record</strong></span> is a14404 It is inconvenient that <span class="function"><strong>make-record</strong></span> is a 14403 14405 macro, because this means that <em class="varname">typespec</em> 14404 14406 cannot be a variable; it must be an immediate value. … … 14406 14408 <p xmlns="http://www.w3.org/1999/xhtml"> 14407 14409 If it weren't for this requirement, 14408 <span ><strong class="function">make-record</strong></span> could be a function. However,14410 <span class="function"><strong>make-record</strong></span> could be a function. However, 14409 14411 that would mean that any stand-alone application using it would 14410 14412 have to include a copy of the interface database 14411 (see <a href="#The-Interface-Database" title="12.4. The Interface Database">Section 12.4, âThe Interface Databaseâ</a>), which is undesirable14413 (see <a class="xref" href="#The-Interface-Database" title="12.4. The Interface Database">Section 12.4, âThe Interface Databaseâ</a>), which is undesirable 14412 14414 because it's large. 14413 14415 </p> … … 14421 14423 <br></br> 14422 14424 <code> 14423 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">open-shared-library</strong></span> name => library14425 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>open-shared-library</strong></span> name => library 14424 14426 </code> 14425 14427 </div> … … 14430 14432 <div> 14431 14433 <div class="refsect1" lang="en" xml:lang="en"> 14432 <a xmlns="http://www.w3.org/1999/xhtml" id="id 525978"></a>14434 <a xmlns="http://www.w3.org/1999/xhtml" id="id432657"></a> 14433 14435 <div class="header">Values:</div> 14434 14436 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">name</span></i>---A SIMPLE-STRING which is presumed to be the so-name of … … 14438 14440 </div> 14439 14441 <div class="refsect1" lang="en" xml:lang="en"> 14440 <a xmlns="http://www.w3.org/1999/xhtml" id="id 526019"></a>14442 <a xmlns="http://www.w3.org/1999/xhtml" id="id432697"></a> 14441 14443 <div class="header">Description:</div> 14442 14444 <p xmlns="http://www.w3.org/1999/xhtml">If the library denoted by <em class="varname">name</em> can … … 14449 14451 </div> 14450 14452 <div class="refsect1" lang="en" xml:lang="en"> 14451 <a xmlns="http://www.w3.org/1999/xhtml" id="id 526038"></a>14453 <a xmlns="http://www.w3.org/1999/xhtml" id="id432713"></a> 14452 14454 <div class="header">Examples:</div> 14453 14455 <pre xmlns="http://www.w3.org/1999/xhtml" class="programlisting">;;; Try to do something simple. … … 14484 14486 </div> 14485 14487 <div class="refsect1" lang="en" xml:lang="en"> 14486 <a xmlns="http://www.w3.org/1999/xhtml" id="id 526048"></a>14488 <a xmlns="http://www.w3.org/1999/xhtml" id="id432733"></a> 14487 14489 <div class="header">Notes:</div> 14488 14490 <p xmlns="http://www.w3.org/1999/xhtml">It would be helpful to describe what an soname is and give … … 14499 14501 <br></br> 14500 14502 <code> 14501 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">pref</strong></span> ptr accessor-form14503 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>pref</strong></span> ptr accessor-form 14502 14504 </code> 14503 14505 </div> … … 14507 14509 <div> 14508 14510 <div class="refsect1" lang="en" xml:lang="en"> 14509 <a xmlns="http://www.w3.org/1999/xhtml" id="id 526099"></a>14511 <a xmlns="http://www.w3.org/1999/xhtml" id="id432791"></a> 14510 14512 <div class="header">Values:</div> 14511 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">ptr</span></i>---<a xmlns="http://www.w3.org/1999/xhtml" href="#Referencing-and-Using-Foreign-Memory-Addresses" title="12.3. Referencing and Using Foreign Memory Addresses">a MACPTR</a>.</p>14513 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">ptr</span></i>---<a xmlns="http://www.w3.org/1999/xhtml" class="link" href="#Referencing-and-Using-Foreign-Memory-Addresses" title="12.3. Referencing and Using Foreign Memory Addresses">a MACPTR</a>.</p> 14512 14514 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">accessor-form</span></i>---a keyword which names a foreign type or record, as 14513 described in <a xmlns="http://www.w3.org/1999/xhtml" href="#Foreign-type--record--and-field-names" title="12.8.3. Foreign type, record, and field names">Section 12.8.3, âForeign type, record, and field namesâ</a>.14515 described in <a xmlns="http://www.w3.org/1999/xhtml" class="xref" href="#Foreign-type--record--and-field-names" title="12.8.3. Foreign type, record, and field names">Section 12.8.3, âForeign type, record, and field namesâ</a>. 14514 14516 </p> 14515 14517 </div> 14516 14518 <div class="refsect1" lang="en" xml:lang="en"> 14517 <a xmlns="http://www.w3.org/1999/xhtml" id="id 526142"></a>14519 <a xmlns="http://www.w3.org/1999/xhtml" id="id432835"></a> 14518 14520 <div class="header">Description:</div> 14519 14521 <p xmlns="http://www.w3.org/1999/xhtml">References an instance of a foreign type (or a component of … … 14533 14535 <br></br> 14534 14536 <code> 14535 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">%reference-external-entry-point</strong></span> eep14537 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>%reference-external-entry-point</strong></span> eep 14536 14538 </code> 14537 14539 </div> … … 14541 14543 <div> 14542 14544 <div class="refsect1" lang="en" xml:lang="en"> 14543 <a xmlns="http://www.w3.org/1999/xhtml" id="id 526202"></a>14545 <a xmlns="http://www.w3.org/1999/xhtml" id="id432901"></a> 14544 14546 <div class="header">Values:</div> 14545 14547 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">eep</span></i>---An EXTERNAL-ENTRY-POINT, as obtained by the EXTERNAL … … 14547 14549 </div> 14548 14550 <div class="refsect1" lang="en" xml:lang="en"> 14549 <a xmlns="http://www.w3.org/1999/xhtml" id="id 526226"></a>14551 <a xmlns="http://www.w3.org/1999/xhtml" id="id432924"></a> 14550 14552 <div class="header">Description:</div> 14551 14553 <p xmlns="http://www.w3.org/1999/xhtml">Tries to resolve the address of the EXTERNAL-ENTRY-POINT … … 14562 14564 <br></br> 14563 14565 <code> 14564 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">rlet</strong></span> (var typespec <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&rest</em> initforms)*14566 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>rlet</strong></span> (var typespec <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&rest</em> initforms)* 14565 14567 <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&body</em> body 14566 14568 </code> … … 14571 14573 <div> 14572 14574 <div class="refsect1" lang="en" xml:lang="en"> 14573 <a xmlns="http://www.w3.org/1999/xhtml" id="id 526284"></a>14575 <a xmlns="http://www.w3.org/1999/xhtml" id="id432988"></a> 14574 14576 <div class="header">Values:</div> 14575 14577 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">var</span></i>---A symbol (a lisp variable)</p> 14576 14578 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">typespec</span></i>---A foreign type specifier or foreign record name.</p> 14577 14579 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">initforms</span></i>---As described above, for 14578 <a xmlns="http://www.w3.org/1999/xhtml" href="#m_make-record" title="Macro MAKE-RECORD"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-record</b></a></p>14579 </div> 14580 <div class="refsect1" lang="en" xml:lang="en"> 14581 <a xmlns="http://www.w3.org/1999/xhtml" id="id 526335"></a>14580 <a xmlns="http://www.w3.org/1999/xhtml" class="xref" href="#m_make-record" title="Macro MAKE-RECORD"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-record</b></a></p> 14581 </div> 14582 <div class="refsect1" lang="en" xml:lang="en"> 14583 <a xmlns="http://www.w3.org/1999/xhtml" id="id433039"></a> 14582 14584 <div class="header">Description:</div> 14583 14585 <p xmlns="http://www.w3.org/1999/xhtml">Executes <em class="varname">body</em> 14584 14586 in an environment in which each var is bound 14585 to <a href="#Referencing-and-Using-Foreign-Memory-Addresses" title="12.3. Referencing and Using Foreign Memory Addresses">a MACPTR</a> encapsulating the14587 to <a class="link" href="#Referencing-and-Using-Foreign-Memory-Addresses" title="12.3. Referencing and Using Foreign Memory Addresses">a MACPTR</a> encapsulating the 14586 14588 address of a stack-allocated foreign memory block, allocated and 14587 14589 initialized from typespec and initforms as per 14588 <a href="#m_make-record" title="Macro MAKE-RECORD"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-record</b></a>.14590 <a class="xref" href="#m_make-record" title="Macro MAKE-RECORD"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">make-record</b></a>. 14589 14591 Returns whatever value(s) <em class="varname">body</em> 14590 14592 returns.</p> … … 14600 14602 <br></br> 14601 14603 <code> 14602 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">rletz</strong></span> (var typespec <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&rest</em> initforms)*14604 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>rletz</strong></span> (var typespec <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&rest</em> initforms)* 14603 14605 <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&body</em> body 14604 14606 </code> … … 14609 14611 <div> 14610 14612 <div class="refsect1" lang="en" xml:lang="en"> 14611 <a xmlns="http://www.w3.org/1999/xhtml" id="id 526408"></a>14613 <a xmlns="http://www.w3.org/1999/xhtml" id="id433120"></a> 14612 14614 <div class="header">Values:</div> 14613 14615 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">var</span></i>---A symbol (a lisp variable)</p> … … 14616 14618 </div> 14617 14619 <div class="refsect1" lang="en" xml:lang="en"> 14618 <a xmlns="http://www.w3.org/1999/xhtml" id="id 526457"></a>14620 <a xmlns="http://www.w3.org/1999/xhtml" id="id433168"></a> 14619 14621 <div class="header">Description:</div> 14620 14622 <p xmlns="http://www.w3.org/1999/xhtml">Executes body in an environment in which each var is 14621 bound to <a href="#Referencing-and-Using-Foreign-Memory-Addresses" title="12.3. Referencing and Using Foreign Memory Addresses">a14623 bound to <a class="link" href="#Referencing-and-Using-Foreign-Memory-Addresses" title="12.3. Referencing and Using Foreign Memory Addresses">a 14622 14624 MACPTR</a> encapsulating the address of a stack-allocated 14623 14625 foreign memory block, allocated and initialized from … … 14635 14637 <br></br> 14636 14638 <code> 14637 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">terminate-when-unreachable</strong></span> object14639 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>terminate-when-unreachable</strong></span> object 14638 14640 </code> 14639 14641 </div> … … 14643 14645 <div> 14644 14646 <div class="refsect1" lang="en" xml:lang="en"> 14645 <a xmlns="http://www.w3.org/1999/xhtml" id="id 526518"></a>14647 <a xmlns="http://www.w3.org/1999/xhtml" id="id433236"></a> 14646 14648 <div class="header">Values:</div> 14647 14649 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">object</span></i>---A CLOS object of a class for which there exists 14648 14650 a method of the generic function 14649 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">ccl:terminate</strong></span>.14651 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>ccl:terminate</strong></span>. 14650 14652 </p> 14651 14653 </div> 14652 14654 <div class="refsect1" lang="en" xml:lang="en"> 14653 <a xmlns="http://www.w3.org/1999/xhtml" id="id 526546"></a>14655 <a xmlns="http://www.w3.org/1999/xhtml" id="id433264"></a> 14654 14656 <div class="header">Description:</div> 14655 14657 <p xmlns="http://www.w3.org/1999/xhtml"> … … 14667 14669 longer referred to anywhere in the program, it deallocates 14668 14670 that object, freeing its memory. However, if 14669 <span ><strong class="function">ccl:terminate-when-unreachable</strong></span> has been14671 <span class="function"><strong>ccl:terminate-when-unreachable</strong></span> has been 14670 14672 called on the object at any time, the garbage collector first 14671 invokes the generic function <span ><strong class="function">ccl:terminate</strong></span>,14673 invokes the generic function <span class="function"><strong>ccl:terminate</strong></span>, 14672 14674 passing it the object as a parameter. 14673 14675 </p> 14674 14676 <p xmlns="http://www.w3.org/1999/xhtml"> 14675 14677 Therefore, to make termination do something useful, you need to 14676 define a method on <span ><strong class="function">ccl:terminate</strong></span>.14678 define a method on <span class="function"><strong>ccl:terminate</strong></span>. 14677 14679 </p> 14678 14680 <p xmlns="http://www.w3.org/1999/xhtml"> 14679 14681 Because calling 14680 <span ><strong class="function">ccl:terminate-when-unreachable</strong></span> only14682 <span class="function"><strong>ccl:terminate-when-unreachable</strong></span> only 14681 14683 affects a single object, rather than all objects of its 14682 14684 class, you 14683 14685 may wish to put a call to it in the 14684 <span ><strong class="function">initialize-instance</strong></span> method of a14686 <span class="function"><strong>initialize-instance</strong></span> method of a 14685 14687 class. Of course, this is only appropriate if you do in fact 14686 14688 want to use termination for all objects of a given class. … … 14688 14690 </div> 14689 14691 <div class="refsect1" lang="en" xml:lang="en"> 14690 <a xmlns="http://www.w3.org/1999/xhtml" id="id 526595"></a>14692 <a xmlns="http://www.w3.org/1999/xhtml" id="id433320"></a> 14691 14693 <div class="header">Example:</div> 14692 14694 <pre xmlns="http://www.w3.org/1999/xhtml" class="programlisting"> … … 14702 14704 </div> 14703 14705 <div class="refsect1" lang="en" xml:lang="en"> 14704 <a xmlns="http://www.w3.org/1999/xhtml" id="id 526612"></a>14706 <a xmlns="http://www.w3.org/1999/xhtml" id="id433335"></a> 14705 14707 <div class="header">See Also:</div> 14706 14708 <span xmlns="http://www.w3.org/1999/xhtml" class="simplelist"> 14707 <a href="#Tutorial--Allocating-Foreign-Data-on-the-Lisp-Heap" title="12.11. Tutorial: Allocating Foreign Data on the Lisp Heap">Section 12.11, âTutorial: Allocating Foreign Data on the Lisp Heap â</a>14709 <a class="xref" href="#Tutorial--Allocating-Foreign-Data-on-the-Lisp-Heap" title="12.11. Tutorial: Allocating Foreign Data on the Lisp Heap">Section 12.11, âTutorial: Allocating Foreign Data on the Lisp Heap â</a> 14708 14710 </span> 14709 14711 </div> … … 14716 14718 <br></br> 14717 14719 <code> 14718 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">unuse-interface-dir</strong></span> dir-id14720 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>unuse-interface-dir</strong></span> dir-id 14719 14721 </code> 14720 14722 </div> … … 14724 14726 <div> 14725 14727 <div class="refsect1" lang="en" xml:lang="en"> 14726 <a xmlns="http://www.w3.org/1999/xhtml" id="id 526663"></a>14728 <a xmlns="http://www.w3.org/1999/xhtml" id="id433395"></a> 14727 14729 <div class="header">Values:</div> 14728 14730 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">dir-id</span></i>---A keyword whose pname, mapped to lower case, names a … … 14731 14733 </div> 14732 14734 <div class="refsect1" lang="en" xml:lang="en"> 14733 <a xmlns="http://www.w3.org/1999/xhtml" id="id 526688"></a>14735 <a xmlns="http://www.w3.org/1999/xhtml" id="id433419"></a> 14734 14736 <div class="header">Description:</div> 14735 14737 <p xmlns="http://www.w3.org/1999/xhtml">Tells <code class="literal">CCL</code> to remove the interface directory denoted by … … 14747 14749 <br></br> 14748 14750 <code> 14749 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">use-interface-dir</strong></span> dir-id14751 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>use-interface-dir</strong></span> dir-id 14750 14752 </code> 14751 14753 </div> … … 14755 14757 <div> 14756 14758 <div class="refsect1" lang="en" xml:lang="en"> 14757 <a xmlns="http://www.w3.org/1999/xhtml" id="id 526740"></a>14759 <a xmlns="http://www.w3.org/1999/xhtml" id="id433479"></a> 14758 14760 <div class="header">Values:</div> 14759 14761 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">dir-id</span></i>---A keyword whose pname, mapped to lower case, names a … … 14762 14764 </div> 14763 14765 <div class="refsect1" lang="en" xml:lang="en"> 14764 <a xmlns="http://www.w3.org/1999/xhtml" id="id 526765"></a>14766 <a xmlns="http://www.w3.org/1999/xhtml" id="id433502"></a> 14765 14767 <div class="header">Description:</div> 14766 14768 <p xmlns="http://www.w3.org/1999/xhtml">Tells <code class="literal">CCL</code> to add the interface directory denoted by … … 14768 14770 foreign type and function information. Arranges that that 14769 14771 directory is searched before any others.</p> 14770 <p xmlns="http://www.w3.org/1999/xhtml">Note that <span ><strong class="function">use-interface-dir</strong></span>14772 <p xmlns="http://www.w3.org/1999/xhtml">Note that <span class="function"><strong>use-interface-dir</strong></span> 14771 14773 merely adds an entry 14772 14774 to a search list. … … 14779 14781 open such a database file whenever it needs to find any 14780 14782 foreign type or 14781 function information. <a href="#f_unuse-interface-dir" title="Function UNUSE-INTERFACE-DIR"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">unuse-interface-dir</b></a>14783 function information. <a class="xref" href="#f_unuse-interface-dir" title="Function UNUSE-INTERFACE-DIR"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">unuse-interface-dir</b></a> 14782 14784 may come in 14783 14785 handy in that case.</p> 14784 14786 </div> 14785 14787 <div class="refsect1" lang="en" xml:lang="en"> 14786 <a xmlns="http://www.w3.org/1999/xhtml" id="id 526801"></a>14788 <a xmlns="http://www.w3.org/1999/xhtml" id="id433541"></a> 14787 14789 <div class="header">Examples:</div> 14788 14790 <p xmlns="http://www.w3.org/1999/xhtml">One typically wants interface information to be … … 14887 14889 <dt> 14888 14890 <span class="sect2"> 14889 <a href="#id 514534">13.6.1. Using <code class="literal">define-objc-method</code></a>14891 <a href="#id412131">13.6.1. Using <code class="literal">define-objc-method</code></a> 14890 14892 </span> 14891 14893 </dt> 14892 14894 <dt> 14893 14895 <span class="sect2"> 14894 <a href="#id4 29654">13.6.2. Using <code class="literal">objc:defmethod</code></a>14896 <a href="#id412374">13.6.2. Using <code class="literal">objc:defmethod</code></a> 14895 14897 </span> 14896 14898 </dt> … … 14946 14948 with the Objective-C bridge. For a full description of these 14947 14949 reader-macros, see 14948 the <a href="#anchor_Foreign-Function-Interface-Dictionary">Foreign-Function-Interface14950 the <a class="link" href="#anchor_Foreign-Function-Interface-Dictionary">Foreign-Function-Interface 14949 14951 Dictionary</a>, especially the entries at the beginning, 14950 14952 describing reader macros.</p> … … 14970 14972 The class's Lisp name is now proclaimed to be a "static" 14971 14973 variable (as if by <code class="literal">DEFSTATIC</code>, as described in the 14972 <a href="#Static_Variables" title="4.6. Static Variables">"Static Variables"14974 <a class="link" href="#Static_Variables" title="4.6. Static Variables">"Static Variables" 14973 14975 section</a>) and given the class object as its value. In 14974 14976 other words:</p> … … 15207 15209 </pre> 15208 15210 <p xmlns="http://www.w3.org/1999/xhtml">In Lisp, we must explicitly allocate the memory, which 15209 is done most easily and safely with <a href="#m_rlet" title="Macro RLET"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">rlet</b></a>.15211 is done most easily and safely with <a class="xref" href="#m_rlet" title="Macro RLET"><b xmlns="http://www.w3.org/TR/xhtml1/transitional">rlet</b></a>. 15210 15212 We do it like this:</p> 15211 15213 <pre xmlns="http://www.w3.org/1999/xhtml" class="programlisting"> … … 15498 15500 <div> 15499 15501 <div> 15500 <h3 class="title"><a id="id 514534"></a>13.6.1. Using <code class="literal">define-objc-method</code></h3>15502 <h3 class="title"><a id="id412131"></a>13.6.1. Using <code class="literal">define-objc-method</code></h3> 15501 15503 </div> 15502 15504 </div> 15503 15505 </div> 15504 15506 <p xmlns="http://www.w3.org/1999/xhtml">As described in the 15505 section <a href="#Calling-Objective-C-Methods" title="13.4. Calling Objective-C Methods">Calling15507 section <a class="link" href="#Calling-Objective-C-Methods" title="13.4. Calling Objective-C Methods">Calling 15506 15508 Objective-C Methods</a>, the names of Objective-C methods 15507 15509 are broken into pieces, each piece followed by a parameter. … … 15615 15617 <div> 15616 15618 <div> 15617 <h3 class="title"><a id="id4 29654"></a>13.6.2. Using <code class="literal">objc:defmethod</code></h3>15619 <h3 class="title"><a id="id412374"></a>13.6.2. Using <code class="literal">objc:defmethod</code></h3> 15618 15620 </div> 15619 15621 </div> … … 15772 15774 to use, you will need to create them. For more information about 15773 15775 creating interface databases, 15774 see <a href="#Creating-new-interface-directories" title="12.5.2. Creating new interface directories">Creating15776 see <a class="link" href="#Creating-new-interface-directories" title="12.5.2. Creating new interface directories">Creating 15775 15777 new interface directories</a>.</p> 15776 15778 </div> … … 15975 15977 <p xmlns="http://www.w3.org/1999/xhtml">Fixnums on 32-bit systems use 30 bits and are in the 15976 15978 range XXX through YYY. Fixnums on 64-bit systems use 61-bits 15977 and are in the range XXX through YYY. (see <a href="#Tagging-scheme" title="16.2.4. Tagging scheme">Section 16.2.4, âTagging schemeâ</a>)</p>15979 and are in the range XXX through YYY. (see <a class="xref" href="#Tagging-scheme" title="16.2.4. Tagging scheme">Section 16.2.4, âTagging schemeâ</a>)</p> 15978 15980 <p xmlns="http://www.w3.org/1999/xhtml">Since we have much larger fixnums on 64-bit systems, 15979 15981 <em class="varname">INTERNAL-TIME-UNITS-PER-SECOND</em> is 1000000 … … 16123 16125 <p xmlns="http://www.w3.org/1999/xhtml">For the <code class="literal">system()</code> function, there is 16124 16126 CCL::OS-COMMAND. Ordinarily, it is better - both more efficient 16125 and more predictable - to use the features described in <a href="#Running-Other-Programs-as-Subprocesses" title="Chapter 9. Running Other Programs as Subprocesses">Chapter 9, <i>Running Other Programs as Subprocesses</i></a>. However,16127 and more predictable - to use the features described in <a class="xref" href="#Running-Other-Programs-as-Subprocesses" title="Chapter 9. Running Other Programs as Subprocesses">Chapter 9, <i>Running Other Programs as Subprocesses</i></a>. However, 16126 16128 sometimes you may want to specifically ask the shell to invoke a 16127 16129 command for you.</p> … … 16204 16206 <tr> 16205 16207 <td> 16206 <a href="#m_class" title="Macro CCL::@CLASS">16208 <a class="xref" href="#m_class" title="Macro CCL::@CLASS"> 16207 16209 <b xmlns="http://www.w3.org/TR/xhtml1/transitional">ccl::@class</b> 16208 16210 </a> … … 16211 16213 <tr> 16212 16214 <td> 16213 <a href="#m_selector" title="Macro CCL::@SELECTOR">16215 <a class="xref" href="#m_selector" title="Macro CCL::@SELECTOR"> 16214 16216 <b xmlns="http://www.w3.org/TR/xhtml1/transitional">ccl::@selector</b> 16215 16217 </a> … … 16218 16220 <tr> 16219 16221 <td> 16220 <a href="#m_define-objc-method" title="Macro CCL::DEFINE-OBJC-METHOD">16222 <a class="xref" href="#m_define-objc-method" title="Macro CCL::DEFINE-OBJC-METHOD"> 16221 16223 <b xmlns="http://www.w3.org/TR/xhtml1/transitional">ccl::define-objc-method</b> 16222 16224 </a> … … 16225 16227 <tr> 16226 16228 <td> 16227 <a href="#m_define-objc-class-method" title="Macro CCL::DEFINE-OBJC-CLASS-METHOD">16229 <a class="xref" href="#m_define-objc-class-method" title="Macro CCL::DEFINE-OBJC-CLASS-METHOD"> 16228 16230 <b xmlns="http://www.w3.org/TR/xhtml1/transitional">ccl::define-objc-class-method</b> 16229 16231 </a> … … 16369 16371 <dt> 16370 16372 <span class="term"> 16371 <a href="http://developer.apple.com/documentation/Cocoa/" target="_top">Cocoa Documentation</a>16373 <a class="ulink" href="http://developer.apple.com/documentation/Cocoa/" target="_top">Cocoa Documentation</a> 16372 16374 </span> 16373 16375 </dt> … … 16381 16383 <dt> 16382 16384 <span class="term"> 16383 <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/index.html" target="_top">Foundation Reference for Objective-C</a>16385 <a class="ulink" href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/index.html" target="_top">Foundation Reference for Objective-C</a> 16384 16386 </span> 16385 16387 </dt> … … 16393 16395 <dt> 16394 16396 <span class="term"> 16395 <a href="http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/ObjC_classic/index.html" target="_top">Application Kit Reference for Objective-C</a>16397 <a class="ulink" href="http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/ObjC_classic/index.html" target="_top">Application Kit Reference for Objective-C</a> 16396 16398 </span> 16397 16399 </dt> … … 16404 16406 <dt> 16405 16407 <span class="term"> 16406 <a href="http://developer.apple.com/documentation/index.html" target="_top">Apple Developer Documentation</a>16408 <a class="ulink" href="http://developer.apple.com/documentation/index.html" target="_top">Apple Developer Documentation</a> 16407 16409 </span> 16408 16410 </dt> … … 16431 16433 <strong>[Function]</strong> 16432 16434 <br></br> 16433 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">getenv</strong></span> name => value</code>16435 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>getenv</strong></span> name => value</code> 16434 16436 </div> 16435 16437 <div class="refentrytitle"></div> … … 16438 16440 <div> 16439 16441 <div class="refsect1" lang="en" xml:lang="en"> 16440 <a xmlns="http://www.w3.org/1999/xhtml" id="id 514161"></a>16442 <a xmlns="http://www.w3.org/1999/xhtml" id="id424628"></a> 16441 16443 <div class="header">Arguments and Values:</div> 16442 16444 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">name</span></i>---a string which is the name of an existing … … 16448 16450 </div> 16449 16451 <div class="refsect1" lang="en" xml:lang="en"> 16450 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 42162"></a>16452 <a xmlns="http://www.w3.org/1999/xhtml" id="id424673"></a> 16451 16453 <div class="header">Description:</div> 16452 16454 <p xmlns="http://www.w3.org/1999/xhtml"> … … 16462 16464 <strong>[Function]</strong> 16463 16465 <br></br> 16464 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">setenv</strong></span> name value => errno</code>16466 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>setenv</strong></span> name value => errno</code> 16465 16467 </div> 16466 16468 <div class="refentrytitle"></div> … … 16469 16471 <div> 16470 16472 <div class="refsect1" lang="en" xml:lang="en"> 16471 <a xmlns="http://www.w3.org/1999/xhtml" id="id42 9403"></a>16473 <a xmlns="http://www.w3.org/1999/xhtml" id="id424734"></a> 16472 16474 <div class="header">Arguments and Values:</div> 16473 16475 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">name</span></i>---a string which is the name of a new or existing … … 16482 16484 </div> 16483 16485 <div class="refsect1" lang="en" xml:lang="en"> 16484 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 57013"></a>16486 <a xmlns="http://www.w3.org/1999/xhtml" id="id424794"></a> 16485 16487 <div class="header">Description:</div> 16486 16488 <p xmlns="http://www.w3.org/1999/xhtml"> … … 16498 16500 <strong>[Function]</strong> 16499 16501 <br></br> 16500 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">current-directory-name</strong></span>16502 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>current-directory-name</strong></span> 16501 16503 => path</code> 16502 16504 </div> … … 16506 16508 <div> 16507 16509 <div class="refsect1" lang="en" xml:lang="en"> 16508 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 59722"></a>16510 <a xmlns="http://www.w3.org/1999/xhtml" id="id424856"></a> 16509 16511 <div class="header">Values:</div> 16510 16512 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">path</span></i>---a string, an absolute pathname in Posix format - with … … 16512 16514 </div> 16513 16515 <div class="refsect1" lang="en" xml:lang="en"> 16514 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 35895"></a>16516 <a xmlns="http://www.w3.org/1999/xhtml" id="id424883"></a> 16515 16517 <div class="header">Description:</div> 16516 16518 <p xmlns="http://www.w3.org/1999/xhtml"> … … 16527 16529 <strong>[Function]</strong> 16528 16530 <br></br> 16529 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">getuid</strong></span> => uid</code>16531 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>getuid</strong></span> => uid</code> 16530 16532 </div> 16531 16533 <div class="refentrytitle"></div> … … 16534 16536 <div> 16535 16537 <div class="refsect1" lang="en" xml:lang="en"> 16536 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 99197"></a>16538 <a xmlns="http://www.w3.org/1999/xhtml" id="id424942"></a> 16537 16539 <div class="header">Values:</div> 16538 16540 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">uid</span></i>---a non-negative integer, identifying a specific user … … 16540 16542 </div> 16541 16543 <div class="refsect1" lang="en" xml:lang="en"> 16542 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 53781"></a>16544 <a xmlns="http://www.w3.org/1999/xhtml" id="id424969"></a> 16543 16545 <div class="header">Description:</div> 16544 16546 <p xmlns="http://www.w3.org/1999/xhtml"> … … 16553 16555 <strong>[Function]</strong> 16554 16556 <br></br> 16555 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">setuid</strong></span> uid => errno</code>16557 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>setuid</strong></span> uid => errno</code> 16556 16558 </div> 16557 16559 <div class="refentrytitle"></div> … … 16560 16562 <div> 16561 16563 <div class="refsect1" lang="en" xml:lang="en"> 16562 <a xmlns="http://www.w3.org/1999/xhtml" id="id 518744"></a>16564 <a xmlns="http://www.w3.org/1999/xhtml" id="id425026"></a> 16563 16565 <div class="header">Arguments and Values:</div> 16564 16566 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">uid</span></i>---a non-negative integer, identifying a specific user … … 16569 16571 </div> 16570 16572 <div class="refsect1" lang="en" xml:lang="en"> 16571 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 75192"></a>16573 <a xmlns="http://www.w3.org/1999/xhtml" id="id425069"></a> 16572 16574 <div class="header">Description:</div> 16573 16575 <p xmlns="http://www.w3.org/1999/xhtml"> … … 16585 16587 <strong>[Function]</strong> 16586 16588 <br></br> 16587 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">setgid</strong></span> gid => errno</code>16589 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>setgid</strong></span> gid => errno</code> 16588 16590 </div> 16589 16591 <div class="refentrytitle"></div> … … 16592 16594 <div> 16593 16595 <div class="refsect1" lang="en" xml:lang="en"> 16594 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 89525"></a>16596 <a xmlns="http://www.w3.org/1999/xhtml" id="id425128"></a> 16595 16597 <div class="header">Arguments and Values:</div> 16596 16598 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">gid</span></i>---a non-negative integer, identifying a specific … … 16601 16603 </div> 16602 16604 <div class="refsect1" lang="en" xml:lang="en"> 16603 <a xmlns="http://www.w3.org/1999/xhtml" id="id 501016"></a>16605 <a xmlns="http://www.w3.org/1999/xhtml" id="id425171"></a> 16604 16606 <div class="header">Description:</div> 16605 16607 <p xmlns="http://www.w3.org/1999/xhtml"> … … 16617 16619 <strong>[Function]</strong> 16618 16620 <br></br> 16619 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">getpid</strong></span> => pid</code>16621 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>getpid</strong></span> => pid</code> 16620 16622 </div> 16621 16623 <div class="refentrytitle"></div> … … 16624 16626 <div> 16625 16627 <div class="refsect1" lang="en" xml:lang="en"> 16626 <a xmlns="http://www.w3.org/1999/xhtml" id="id 500633"></a>16628 <a xmlns="http://www.w3.org/1999/xhtml" id="id425230"></a> 16627 16629 <div class="header">Values:</div> 16628 16630 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">pid</span></i>---a non-negative integer, identifying an OS process</p> 16629 16631 </div> 16630 16632 <div class="refsect1" lang="en" xml:lang="en"> 16631 <a xmlns="http://www.w3.org/1999/xhtml" id="id 500657"></a>16633 <a xmlns="http://www.w3.org/1999/xhtml" id="id425256"></a> 16632 16634 <div class="header">Description:</div> 16633 16635 <p xmlns="http://www.w3.org/1999/xhtml"> … … 16642 16644 <strong>[Function]</strong> 16643 16645 <br></br> 16644 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">get-user-home-dir</strong></span>16646 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>get-user-home-dir</strong></span> 16645 16647 uid => path</code> 16646 16648 </div> … … 16650 16652 <div> 16651 16653 <div class="refsect1" lang="en" xml:lang="en"> 16652 <a xmlns="http://www.w3.org/1999/xhtml" id="id42 8957"></a>16654 <a xmlns="http://www.w3.org/1999/xhtml" id="id425590"></a> 16653 16655 <div class="header">Values:</div> 16654 16656 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">uid</span></i>---a non-negative integer, identifying a specific user … … 16658 16660 </div> 16659 16661 <div class="refsect1" lang="en" xml:lang="en"> 16660 <a xmlns="http://www.w3.org/1999/xhtml" id="id 510273"></a>16662 <a xmlns="http://www.w3.org/1999/xhtml" id="id425633"></a> 16661 16663 <div class="header">Description:</div> 16662 16664 <p xmlns="http://www.w3.org/1999/xhtml"> … … 16675 16677 <strong>[Function]</strong> 16676 16678 <br></br> 16677 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">os-command</strong></span> command-line16679 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>os-command</strong></span> command-line 16678 16680 => exit-code</code> 16679 16681 </div> … … 16683 16685 <div> 16684 16686 <div class="refsect1" lang="en" xml:lang="en"> 16685 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 99360"></a>16687 <a xmlns="http://www.w3.org/1999/xhtml" id="id425702"></a> 16686 16688 <div class="header">Values:</div> 16687 16689 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">command-line</span></i>---a string, obeying all the whitespace and … … 16692 16694 </div> 16693 16695 <div class="refsect1" lang="en" xml:lang="en"> 16694 <a xmlns="http://www.w3.org/1999/xhtml" id="id 502706"></a>16696 <a xmlns="http://www.w3.org/1999/xhtml" id="id425744"></a> 16695 16697 <div class="header">Description:</div> 16696 16698 <p xmlns="http://www.w3.org/1999/xhtml"> 16697 Invokes the Posix function <span ><strong class="function">system()</strong></span>, which16699 Invokes the Posix function <span class="function"><strong>system()</strong></span>, which 16698 16700 invokes the user's default system shell (such as 16699 16701 sh or tcsh) as a new process, and has that shell execute … … 16708 16710 </div> 16709 16711 <div class="refsect1" lang="en" xml:lang="en"> 16710 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 52659"></a>16712 <a xmlns="http://www.w3.org/1999/xhtml" id="id425778"></a> 16711 16713 <div class="header">Notes:</div> 16712 16714 <p xmlns="http://www.w3.org/1999/xhtml"> … … 16726 16728 <strong>[Macro]</strong> 16727 16729 <br></br> 16728 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">@class</strong></span> class-name</code>16730 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>@class</strong></span> class-name</code> 16729 16731 </div> 16730 16732 <div class="refentrytitle"></div> … … 16733 16735 <div> 16734 16736 <div class="refsect1" lang="en" xml:lang="en"> 16735 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 74077"></a>16737 <a xmlns="http://www.w3.org/1999/xhtml" id="id425838"></a> 16736 16738 <div class="header">Arguments and Values:</div> 16737 16739 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">class-name</span></i>---a string which denotes an existing class name, or a … … 16740 16742 </div> 16741 16743 <div class="refsect1" lang="en" xml:lang="en"> 16742 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 93721"></a>16744 <a xmlns="http://www.w3.org/1999/xhtml" id="id425866"></a> 16743 16745 <div class="header">Description:</div> 16744 16746 <p xmlns="http://www.w3.org/1999/xhtml">Used to refer to a known ObjC class by name. (Via the use … … 16746 16748 are cached.)</p> 16747 16749 <p xmlns="http://www.w3.org/1999/xhtml"> 16748 <span ><strong class="function">@class</strong></span> is obsolete as of late 2004, because16750 <span class="function"><strong>@class</strong></span> is obsolete as of late 2004, because 16749 16751 find-class now works on ObjC classes. It is described here 16750 16752 only because some old code still uses it. … … 16758 16760 <strong>[Macro]</strong> 16759 16761 <br></br> 16760 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">@selector</strong></span> string</code>16762 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>@selector</strong></span> string</code> 16761 16763 </div> 16762 16764 <div class="refentrytitle"></div> … … 16765 16767 <div> 16766 16768 <div class="refsect1" lang="en" xml:lang="en"> 16767 <a xmlns="http://www.w3.org/1999/xhtml" id="id42 7151"></a>16769 <a xmlns="http://www.w3.org/1999/xhtml" id="id425935"></a> 16768 16770 <div class="header">Arguments and Values:</div> 16769 16771 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">string</span></i>---a string constant, used to canonically refer to an … … 16771 16773 </div> 16772 16774 <div class="refsect1" lang="en" xml:lang="en"> 16773 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 92449"></a>16775 <a xmlns="http://www.w3.org/1999/xhtml" id="id425961"></a> 16774 16776 <div class="header">Description:</div> 16775 16777 <p xmlns="http://www.w3.org/1999/xhtml">Used to refer to an ObjC method selector (method name). Uses … … 16784 16786 <strong>[Macro]</strong> 16785 16787 <br></br> 16786 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">objc:defmethod</strong></span>16788 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>objc:defmethod</strong></span> 16787 16789 name-and-result-type ((receiver-arg-and-class) <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&rest</em> 16788 16790 other-args) <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&body</em> body</code> … … 16793 16795 <div> 16794 16796 <div class="refsect1" lang="en" xml:lang="en"> 16795 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 30630"></a>16797 <a xmlns="http://www.w3.org/1999/xhtml" id="id426027"></a> 16796 16798 <div class="header">Arguments and Values:</div> 16797 16799 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">name-and-result-type</span></i>---either an Objective-C message name, for methods … … 16815 16817 </div> 16816 16818 <div class="refsect1" lang="en" xml:lang="en"> 16817 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 65085"></a>16819 <a xmlns="http://www.w3.org/1999/xhtml" id="id426108"></a> 16818 16820 <div class="header">Description:</div> 16819 16821 <p xmlns="http://www.w3.org/1999/xhtml">Defines an Objective-C-callable method which implements … … 16823 16825 restrictions of the <code class="literal">OBJC:DEFMETHOD</code> macro, 16824 16826 see the 16825 section <a href="#anchor_Using-objc-defmethod">Using <code class="literal">objc:defmethod</code></a>.</p>16827 section <a class="link" href="#anchor_Using-objc-defmethod">Using <code class="literal">objc:defmethod</code></a>.</p> 16826 16828 </div> 16827 16829 </div> … … 16832 16834 <strong>[Macro]</strong> 16833 16835 <br></br> 16834 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">define-objc-method</strong></span>16836 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>define-objc-method</strong></span> 16835 16837 (selector class-name) <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&body</em> body</code> 16836 16838 </div> … … 16840 16842 <div> 16841 16843 <div class="refsect1" lang="en" xml:lang="en"> 16842 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 85793"></a>16844 <a xmlns="http://www.w3.org/1999/xhtml" id="id426191"></a> 16843 16845 <div class="header">Arguments and Values:</div> 16844 16846 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">selector</span></i>---either a string which represents the name of the … … 16855 16857 </div> 16856 16858 <div class="refsect1" lang="en" xml:lang="en"> 16857 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 74449"></a>16859 <a xmlns="http://www.w3.org/1999/xhtml" id="id426237"></a> 16858 16860 <div class="header">Description:</div> 16859 16861 <p xmlns="http://www.w3.org/1999/xhtml">Defines an ObjC-callable method which implements the … … 16868 16870 <strong>[Macro]</strong> 16869 16871 <br></br> 16870 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">define-objc-class-method</strong></span>16872 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>define-objc-class-method</strong></span> 16871 16873 (selector class-name) <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&body</em> body</code> 16872 16874 </div> … … 16876 16878 <div> 16877 16879 <div class="refsect1" lang="en" xml:lang="en"> 16878 <a xmlns="http://www.w3.org/1999/xhtml" id="id 502664"></a>16880 <a xmlns="http://www.w3.org/1999/xhtml" id="id426301"></a> 16879 16881 <div class="header">Arguments and Values:</div> 16880 16882 <p xmlns="http://www.w3.org/1999/xhtml">As per DEFINE-OBJC-METHOD</p> 16881 16883 </div> 16882 16884 <div class="refsect1" lang="en" xml:lang="en"> 16883 <a xmlns="http://www.w3.org/1999/xhtml" id="id 502674"></a>16885 <a xmlns="http://www.w3.org/1999/xhtml" id="id426312"></a> 16884 16886 <div class="header">Description:</div> 16885 16887 <p xmlns="http://www.w3.org/1999/xhtml">Like DEFINE-OBJC-METHOD, only used to define methods on the … … 16923 16925 <div> 16924 16926 <div class="refsect1" lang="en" xml:lang="en"> 16925 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 71502"></a>16927 <a xmlns="http://www.w3.org/1999/xhtml" id="id426388"></a> 16926 16928 <div class="header">Description:</div> 16927 16929 <p xmlns="http://www.w3.org/1999/xhtml">This variable is currently only used by the standard reader macro … … 16958 16960 <div> 16959 16961 <div class="refsect1" lang="en" xml:lang="en"> 16960 <a xmlns="http://www.w3.org/1999/xhtml" id="id 501658"></a>16962 <a xmlns="http://www.w3.org/1999/xhtml" id="id426446"></a> 16961 16963 <div class="header">Description:</div> 16962 16964 <p xmlns="http://www.w3.org/1999/xhtml">Per ANSI CL, Clozure CL supports the :EXTERNAL-FORMAT keyword … … 17002 17004 <div> 17003 17005 <div class="refsect1" lang="en" xml:lang="en"> 17004 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 85472"></a>17006 <a xmlns="http://www.w3.org/1999/xhtml" id="id426526"></a> 17005 17007 <div class="header">Description:</div> 17006 17008 <p xmlns="http://www.w3.org/1999/xhtml">The value of this variable is used when :EXTERNAL-FORMAT is … … 17026 17028 <div> 17027 17029 <div class="refsect1" lang="en" xml:lang="en"> 17028 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 77065"></a>17030 <a xmlns="http://www.w3.org/1999/xhtml" id="id426576"></a> 17029 17031 <div class="header">Superclasses:</div> 17030 17032 <p xmlns="http://www.w3.org/1999/xhtml">NS:NS-STRING</p> 17031 17033 </div> 17032 17034 <div class="refsect1" lang="en" xml:lang="en"> 17033 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 94573"></a>17035 <a xmlns="http://www.w3.org/1999/xhtml" id="id426587"></a> 17034 17036 <div class="header">Initargs:</div> 17035 17037 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">:string</span></i>--- … … 17039 17041 </div> 17040 17042 <div class="refsect1" lang="en" xml:lang="en"> 17041 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 85513"></a>17043 <a xmlns="http://www.w3.org/1999/xhtml" id="id426614"></a> 17042 17044 <div class="header">Description:</div> 17043 17045 <p xmlns="http://www.w3.org/1999/xhtml"> … … 17057 17059 </div> 17058 17060 <div class="refsect1" lang="en" xml:lang="en"> 17059 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 58150"></a>17061 <a xmlns="http://www.w3.org/1999/xhtml" id="id426634"></a> 17060 17062 <div class="header">Examples:</div> 17061 17063 <p xmlns="http://www.w3.org/1999/xhtml"> 17062 17064 You can create an ns-lisp-string with 17063 <span ><strong class="function">make-instance</strong></span>, just like17065 <span class="function"><strong>make-instance</strong></span>, just like 17064 17066 any normal Lisp class: 17065 17067 </p> … … 17074 17076 <pre xmlns="http://www.w3.org/1999/xhtml" class="programlisting">? (ccl::send *the-string* 'dealloc)</pre> 17075 17077 <p xmlns="http://www.w3.org/1999/xhtml"> 17076 You may wish to use an <span ><strong class="function">unwind-protect</strong></span>17078 You may wish to use an <span class="function"><strong>unwind-protect</strong></span> 17077 17079 form to ensure that this happens: 17078 17080 </p> … … 17088 17090 </div> 17089 17091 <div class="refsect1" lang="en" xml:lang="en"> 17090 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 49276"></a>17092 <a xmlns="http://www.w3.org/1999/xhtml" id="id426687"></a> 17091 17093 <div class="header">Notes:</div> 17092 17094 <p xmlns="http://www.w3.org/1999/xhtml"> … … 17430 17432 <br></br> 17431 17433 <code> 17432 <span xmlns="http://www.w3.org/1999/xhtml" >17433 <strong class="function">lisp-heap-gc-threshold</strong>17434 <span xmlns="http://www.w3.org/1999/xhtml" class="function"> 17435 <strong>lisp-heap-gc-threshold</strong> 17434 17436 </span> 17435 17437 </code> … … 17440 17442 <div> 17441 17443 <div class="refsect1" lang="en" xml:lang="en"> 17442 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 76448"></a>17444 <a xmlns="http://www.w3.org/1999/xhtml" id="id424183"></a> 17443 17445 <div class="header">Description:</div> 17444 17446 <p xmlns="http://www.w3.org/1999/xhtml">Returns the value of the kernel variable that specifies the … … 17453 17455 <br></br> 17454 17456 <code> 17455 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">lisp-heap-gc-threshold new-threshold</strong></span>17457 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>lisp-heap-gc-threshold new-threshold</strong></span> 17456 17458 </code> 17457 17459 </div> … … 17461 17463 <div> 17462 17464 <div class="refsect1" lang="en" xml:lang="en"> 17463 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 37150"></a>17465 <a xmlns="http://www.w3.org/1999/xhtml" id="id424243"></a> 17464 17466 <div class="header">Arguments and Values:</div> 17465 17467 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">new-value</span></i>---The requested new lisp-heap-gc-threshold.</p> 17466 17468 </div> 17467 17469 <div class="refsect1" lang="en" xml:lang="en"> 17468 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 95213"></a>17470 <a xmlns="http://www.w3.org/1999/xhtml" id="id427960"></a> 17469 17471 <div class="header">Description:</div> 17470 17472 <p xmlns="http://www.w3.org/1999/xhtml">Sets the value of the kernel variable that specifies the … … 17482 17484 <br></br> 17483 17485 <code> 17484 <span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">use-lisp-heap-gc-threshold</strong></span>17486 <span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>use-lisp-heap-gc-threshold</strong></span> 17485 17487 </code> 17486 17488 </div> … … 17490 17492 <div> 17491 17493 <div class="refsect1" lang="en" xml:lang="en"> 17492 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 32552"></a>17494 <a xmlns="http://www.w3.org/1999/xhtml" id="id428022"></a> 17493 17495 <div class="header">Description:</div> 17494 17496 <p xmlns="http://www.w3.org/1999/xhtml">Tries to grow or shrink lisp's heap space, so that the … … 17503 17505 <strong>[Function]</strong> 17504 17506 <br></br> 17505 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">egc</strong></span> arg</code>17507 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>egc</strong></span> arg</code> 17506 17508 </div> 17507 17509 <div class="refentrytitle"></div> … … 17510 17512 <div> 17511 17513 <div class="refsect1" lang="en" xml:lang="en"> 17512 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 82542"></a>17514 <a xmlns="http://www.w3.org/1999/xhtml" id="id428081"></a> 17513 17515 <div class="header">Arguments and Values:</div> 17514 17516 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">arg</span></i>---a generalized boolean</p> 17515 17517 </div> 17516 17518 <div class="refsect1" lang="en" xml:lang="en"> 17517 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 43639"></a>17519 <a xmlns="http://www.w3.org/1999/xhtml" id="id428107"></a> 17518 17520 <div class="header">Description:</div> 17519 17521 <p xmlns="http://www.w3.org/1999/xhtml">Enables the EGC if arg is non-nil, disables the EGC … … 17531 17533 <br></br> 17532 17534 <code> 17533 <span xmlns="http://www.w3.org/1999/xhtml" >17534 <strong class="function">egc-enabled-p</strong>17535 <span xmlns="http://www.w3.org/1999/xhtml" class="function"> 17536 <strong>egc-enabled-p</strong> 17535 17537 </span> 17536 17538 </code> … … 17541 17543 <div> 17542 17544 <div class="refsect1" lang="en" xml:lang="en"> 17543 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 40822"></a>17545 <a xmlns="http://www.w3.org/1999/xhtml" id="id428165"></a> 17544 17546 <div class="header">Description:</div> 17545 17547 <p xmlns="http://www.w3.org/1999/xhtml">Returns T if the EGC was enabled at the time of the call, … … 17554 17556 <br></br> 17555 17557 <code> 17556 <span xmlns="http://www.w3.org/1999/xhtml" >17557 <strong class="function">egc-active-p</strong>17558 <span xmlns="http://www.w3.org/1999/xhtml" class="function"> 17559 <strong>egc-active-p</strong> 17558 17560 </span> 17559 17561 </code> … … 17564 17566 <div> 17565 17567 <div class="refsect1" lang="en" xml:lang="en"> 17566 <a xmlns="http://www.w3.org/1999/xhtml" id="id 513501"></a>17568 <a xmlns="http://www.w3.org/1999/xhtml" id="id428222"></a> 17567 17569 <div class="header">Description:</div> 17568 17570 <p xmlns="http://www.w3.org/1999/xhtml">Returns T if the EGC was active at the time of the call, NIL … … 17579 17581 <br></br> 17580 17582 <code> 17581 <span xmlns="http://www.w3.org/1999/xhtml" >17582 <strong class="function">egc-configuration</strong>17583 <span xmlns="http://www.w3.org/1999/xhtml" class="function"> 17584 <strong>egc-configuration</strong> 17583 17585 </span> 17584 17586 </code> … … 17589 17591 <div> 17590 17592 <div class="refsect1" lang="en" xml:lang="en"> 17591 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 62585"></a>17593 <a xmlns="http://www.w3.org/1999/xhtml" id="id428280"></a> 17592 17594 <div class="header">Description:</div> 17593 17595 <p xmlns="http://www.w3.org/1999/xhtml">Returns, as multiple values, the sizes in kilobytes of the … … 17602 17604 <strong>[Function]</strong> 17603 17605 <br></br> 17604 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">configure-egc</strong></span>17606 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>configure-egc</strong></span> 17605 17607 generation-0-size generation-1-size 17606 17608 generation-2-size</code> … … 17611 17613 <div> 17612 17614 <div class="refsect1" lang="en" xml:lang="en"> 17613 <a xmlns="http://www.w3.org/1999/xhtml" id="id 519891"></a>17615 <a xmlns="http://www.w3.org/1999/xhtml" id="id426748"></a> 17614 17616 <div class="header">Arguments and Values:</div> 17615 17617 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">generation-0-size</span></i>---the requested threshold size of the youngest … … 17621 17623 </div> 17622 17624 <div class="refsect1" lang="en" xml:lang="en"> 17623 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 95105"></a>17625 <a xmlns="http://www.w3.org/1999/xhtml" id="id426803"></a> 17624 17626 <div class="header">Description:</div> 17625 17627 <p xmlns="http://www.w3.org/1999/xhtml">If the EGC is currently disabled, puts the indicated … … 17636 17638 <strong>[Function]</strong> 17637 17639 <br></br> 17638 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">gc-retain-pages</strong></span> arg</code>17640 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>gc-retain-pages</strong></span> arg</code> 17639 17641 </div> 17640 17642 <div class="refentrytitle"></div> … … 17643 17645 <div> 17644 17646 <div class="refsect1" lang="en" xml:lang="en"> 17645 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 56402"></a>17647 <a xmlns="http://www.w3.org/1999/xhtml" id="id426868"></a> 17646 17648 <div class="header">Arguments and Values:</div> 17647 17649 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">arg</span></i>---a generalized boolean</p> 17648 17650 </div> 17649 17651 <div class="refsect1" lang="en" xml:lang="en"> 17650 <a xmlns="http://www.w3.org/1999/xhtml" id="id 510638"></a>17652 <a xmlns="http://www.w3.org/1999/xhtml" id="id426894"></a> 17651 17653 <div class="header">Description:</div> 17652 17654 <p xmlns="http://www.w3.org/1999/xhtml">Tries to influence the GC to retain/recycle the pages … … 17663 17665 <br></br> 17664 17666 <code> 17665 <span xmlns="http://www.w3.org/1999/xhtml" >17666 <strong class="function">gc-retaining-pages</strong>17667 <span xmlns="http://www.w3.org/1999/xhtml" class="function"> 17668 <strong>gc-retaining-pages</strong> 17667 17669 </span> 17668 17670 </code> … … 17673 17675 <div> 17674 17676 <div class="refsect1" lang="en" xml:lang="en"> 17675 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 63001"></a>17677 <a xmlns="http://www.w3.org/1999/xhtml" id="id426951"></a> 17676 17678 <div class="header">Description:</div> 17677 17679 <p xmlns="http://www.w3.org/1999/xhtml">Returns T if the GC tries to retain pages between full GCs … … 17828 17830 <dt> 17829 17831 <span class="sect2"> 17830 <a href="#id 529071">16.7.2. Recommended Reading</a>17832 <a href="#id418917">16.7.2. Recommended Reading</a> 17831 17833 </span> 17832 17834 </dt> … … 17854 17856 </div> 17855 17857 <p xmlns="http://www.w3.org/1999/xhtml">Clozure CL's threads are "native" (meaning that they're 17856 scheduled and controlled by the operating system.) Most of the17857 implications of this are discussed elsewhere; this section tries17858 to describe how threads look from the lisp kernel's perspective17859 (and especially from the GC's point of view.)</p>17858 scheduled and controlled by the operating system.) Most of the 17859 implications of this are discussed elsewhere; this section tries 17860 to describe how threads look from the lisp kernel's perspective 17861 (and especially from the GC's point of view.)</p> 17860 17862 <p xmlns="http://www.w3.org/1999/xhtml">Clozure CL's runtime system tries to use machine-level 17861 exception mechanisms (conditional traps when available, illegal17862 instructions, memory access protection in some cases) to detect17863 and handle ...exceptional situations. These situations17864 include some TYPE-ERRORs and PROGRAM-ERRORS (notably17865 wrong-number-of-args errors), and also include cases like "not17866 being able to allocate memory without GCing or obtaining more17867 memory from the OS." The general idea is that it's usually17868 faster to pay (very occasional) exception-processing overhead17869 and figure out what's going on in an exception handler than it17870 is to maintain enough state and context to handle an exceptional17871 case via a lighter-weight mechanism when that exceptional case17872 (by definition) rarely occurs.</p>17863 exception mechanisms (conditional traps when available, 17864 illegal instructions, memory access protection in some cases) 17865 to detect and handle exceptional situations. These situations 17866 include some TYPE-ERRORs and PROGRAM-ERRORS (notably 17867 wrong-number-of-args errors), and also include cases like "not 17868 being able to allocate memory without GCing or obtaining more 17869 memory from the OS." The general idea is that it's usually 17870 faster to pay (very occasional) exception-processing overhead 17871 and figure out what's going on in an exception handler than it 17872 is to maintain enough state and context to handle an 17873 exceptional case via a lighter-weight mechanism when that 17874 exceptional case (by definition) rarely occurs.</p> 17873 17875 <p xmlns="http://www.w3.org/1999/xhtml">Some emulated execution environments (the Rosetta PPC 17874 emulator on x86 versions of Mac OS X) don't provide accurate17875 exception information to exception handling functions. Clozure CL17876 can't run in such environments.</p>17876 emulator on x86 versions of Mac OS X) don't provide accurate 17877 exception information to exception handling functions. Clozure CL 17878 can't run in such environments.</p> 17877 17879 <div class="sect2" lang="en" xml:lang="en"> 17878 17880 <div xmlns="http://www.w3.org/1999/xhtml" class="titlepage"> … … 17884 17886 </div> 17885 17887 <p xmlns="http://www.w3.org/1999/xhtml">When a lisp thread is first created (or when a thread 17886 created by foreign code first calls back to lisp), a data 17887 structure called a Thread Context Record (or TCR) is allocated 17888 and initialized. On modern versions of Linux and FreeBSD, the 17889 allocation actually happens via a set of thread-local-storage 17890 ABI extensions, so a thread's TCR is created when the thread 17891 is created and dies when the thread dies. (The World's Most 17892 Advanced Operating System - as Apple's marketing literature 17893 refers to Darwin - is not very advanced in this regard, and I 17894 know of no reason to assume that advances will be made in this 17895 area anytime soon.)</p> 17888 created by foreign code first calls back to lisp), a data 17889 structure called a Thread Context Record (or TCR) is 17890 allocated and initialized. On modern versions of Linux and 17891 FreeBSD, the allocation actually happens via a set of 17892 thread-local-storage ABI extensions, so a thread's TCR is 17893 created when the thread is created and dies when the thread 17894 dies. (The World's Most Advanced Operating Systemâas 17895 Apple's marketing literature refers to Darwinâis not 17896 very advanced in this regard, and I know of no reason to 17897 assume that advances will be made in this area anytime 17898 soon.)</p> 17896 17899 <p xmlns="http://www.w3.org/1999/xhtml">A TCR contains a few dozen fields (and is therefore a 17897 few hundred bytes in size.) The fields are mostly17898 thread-specific information about the thread's stacks'17899 locations and sizes, information about the underlying (POSIX)17900 thread, and information about the thread's dynamic binding17901 history and pending CATCH/UNWIND-PROTECTs. Some of this17902 information could be kept in individual machine registers17903 while the thread is running (and the PPC - which has more17904 registers available - keeps a few things in registers that the17905 X86-64 has to access via the TCR), but it's important to17906 remember that the information is thread-specific and can't17907 (for instance) be kept in a fixed global memory17908 location.</p>17900 few hundred bytes in size.) The fields are mostly 17901 thread-specific information about the thread's stacks' 17902 locations and sizes, information about the underlying (POSIX) 17903 thread, and information about the thread's dynamic binding 17904 history and pending CATCH/UNWIND-PROTECTs. Some of this 17905 information could be kept in individual machine registers 17906 while the thread is running (and the PPC - which has more 17907 registers available - keeps a few things in registers that the 17908 X86-64 has to access via the TCR), but it's important to 17909 remember that the information is thread-specific and can't 17910 (for instance) be kept in a fixed global memory 17911 location.</p> 17909 17912 <p xmlns="http://www.w3.org/1999/xhtml">When lisp code is running, the current thread's TCR is 17910 kept in a register. On PPC platforms, a general purpose17911 register is used; on x86-64, an (otherwise nearly useless)17912 segment register works well (prevents the expenditure of a17913 more generally useful general- purpose register for this17914 purpose.)</p>17913 kept in a register. On PPC platforms, a general purpose 17914 register is used; on x86-64, an (otherwise nearly useless) 17915 segment register works well (prevents the expenditure of a 17916 more generally useful general- purpose register for this 17917 purpose.)</p> 17915 17918 <p xmlns="http://www.w3.org/1999/xhtml">The address of a TCR is aligned in memory in such a way 17916 that a FIXNUM can be used to represent it. The lisp function17917 CCL::%CURRENT-TCR returns the calling thread's TCR as a17918 fixnum; actual value of the TCR's address is 4 or 8 times the17919 value of this fixnum.</p>17919 that a FIXNUM can be used to represent it. The lisp function 17920 CCL::%CURRENT-TCR returns the calling thread's TCR as a 17921 fixnum; actual value of the TCR's address is 4 or 8 times the 17922 value of this fixnum.</p> 17920 17923 <p xmlns="http://www.w3.org/1999/xhtml">When the lisp kernel initializes a new TCR, it's added 17921 to a global list maintained by the kernel; when a thread17922 exits, its TCR is removed from this list.</p>17924 to a global list maintained by the kernel; when a thread 17925 exits, its TCR is removed from this list.</p> 17923 17926 <p xmlns="http://www.w3.org/1999/xhtml">When a thread calls foreign code, lisp stack pointers 17924 are saved in its TCR, lisp registers (at least those whose17925 value should be preserved across the call) are saved on the17926 thread's value stack, and (on x86-64) RSP is switched to the17927 control stack. A field in the TCR (tcr.valence) is then set17928 to indicate that the thread is running foreign code, foreign17929 argument registers are loaded from a frame on the foreign17930 stack, and the foreign function is called. (That's a little17931 oversimplified and possibly inaccurate, but the important17932 things to note are that the thread "stops following lisp stack17933 and register usage conventions" and that it advertises the17934 fact that it's done so. Similar transitions in a thread's17935 state ("valence") occur when it enters of exits an exception17936 handler (which is sort of an OS/hardware-mandated foreign17937 function call where the OS thoughtfully saves the thread's17938 register state for it beforehand.)</p>17927 are saved in its TCR, lisp registers (at least those whose 17928 value should be preserved across the call) are saved on the 17929 thread's value stack, and (on x86-64) RSP is switched to the 17930 control stack. A field in the TCR (tcr.valence) is then set 17931 to indicate that the thread is running foreign code, foreign 17932 argument registers are loaded from a frame on the foreign 17933 stack, and the foreign function is called. (That's a little 17934 oversimplified and possibly inaccurate, but the important 17935 things to note are that the thread "stops following lisp 17936 stack and register usage conventions" and that it advertises 17937 the fact that it's done so. Similar transitions in a 17938 thread's state ("valence") occur when it enters or exits an 17939 exception handler (which is sort of an OS/hardware-mandated 17940 foreign function call where the OS thoughtfully saves the 17941 thread's register state for it beforehand.)</p> 17939 17942 </div> 17940 17943 <div class="sect2" lang="en" xml:lang="en"> … … 17947 17950 </div> 17948 17951 <p xmlns="http://www.w3.org/1999/xhtml">Unix-like OSes tend to refer to exceptions as "signals"; 17949 the same general mechanism ("signal handling") is used to17950 process both asynchronous OS-level events (such as the result17951 of the keyboard driver noticing that ^C or ^Z has been17952 pressed) and synchronous hardware-level events (like trying to17953 execute an illegal instruction or access protected memory.)17954 It makes some sense to defer ("block") handling of17955 asynchronous signals so that some critical code sequences17956 complete without interruption; since it's generally not17957 possible for a thread to proceed after a synchronous exception17958 unless and until its state is modified by an exception17959 handler, it makes no sense to talk about blocking synchronous17960 signals (though some OSes will let you do so and doing so can17961 have mysterious effects.)</p>17952 the same general mechanism ("signal handling") is used to 17953 process both asynchronous OS-level events (such as the result 17954 of the keyboard driver noticing that ^C or ^Z has been 17955 pressed) and synchronous hardware-level events (like trying to 17956 execute an illegal instruction or access protected memory.) 17957 It makes some sense to defer ("block") handling of 17958 asynchronous signals so that some critical code sequences 17959 complete without interruption; since it's generally not 17960 possible for a thread to proceed after a synchronous exception 17961 unless and until its state is modified by an exception 17962 handler, it makes no sense to talk about blocking synchronous 17963 signals (though some OSes will let you do so and doing so can 17964 have mysterious effects.)</p> 17962 17965 <p xmlns="http://www.w3.org/1999/xhtml">On OSX/Darwin, the POSIX signal handling facilities 17963 coexist with lower-level Mach-based exception handling17964 facilities. Unfortunately, the way that this is implemented17965 interacts poorly with debugging tools: GDB will generally stop17966 whenever the target program encounters a Mach-level exception17967 and offers no way to proceed from that point (and let the17968 program's POSIX signal handler try to handle the exception);17969 Apple's CrashReporter program has had a similar issue and,17970 depending on how it's configured, may bombard the user with17971 alert dialogs which falsely claim that an application has17972 crashed (when in fact the application in question has17973 routinely handled a routine exception.) On Darwin/OSX,17974 Clozure CL uses Mach thread-level exception handling facilities17975 which run before GDB or CrashReporter get a chance to confuse17976 themselves; Clozure CL's Mach exception handling tries to force17977 the thread which received a synchronous exception to invoke a17978 signal handling function ("as if" signal handling worked more17979 usefully under Darwin.) Mach exception handlers run in a17980 dedicated thread (which basically does nothing but wait for17981 exception messages from the lisp kernel, obtain and modify17982 information about the state of threads in which exceptions17983 have occurred, and reply to the exception messages with an17984 indication that the exception has been handled. The reply17985 from a thread-level exception handler keeps the exception from17986 being reported to GDB or CrashReporter and avoids the problems17987 related to those programs. Since Clozure CL's Mach exception17988 handler doesn't claim to handle debugging-related exceptions17989 (from breakpoints or single-step operations), it's possible to17990 use GDB to debug Clozure CL.</p>17966 coexist with lower-level Mach-based exception handling 17967 facilities. Unfortunately, the way that this is implemented 17968 interacts poorly with debugging tools: GDB will generally stop 17969 whenever the target program encounters a Mach-level exception 17970 and offers no way to proceed from that point (and let the 17971 program's POSIX signal handler try to handle the exception); 17972 Apple's CrashReporter program has had a similar issue and, 17973 depending on how it's configured, may bombard the user with 17974 alert dialogs which falsely claim that an application has 17975 crashed (when in fact the application in question has 17976 routinely handled a routine exception.) On Darwin/OSX, 17977 Clozure CL uses Mach thread-level exception handling facilities 17978 which run before GDB or CrashReporter get a chance to confuse 17979 themselves; Clozure CL's Mach exception handling tries to force 17980 the thread which received a synchronous exception to invoke a 17981 signal handling function ("as if" signal handling worked more 17982 usefully under Darwin.) Mach exception handlers run in a 17983 dedicated thread (which basically does nothing but wait for 17984 exception messages from the lisp kernel, obtain and modify 17985 information about the state of threads in which exceptions 17986 have occurred, and reply to the exception messages with an 17987 indication that the exception has been handled. The reply 17988 from a thread-level exception handler keeps the exception from 17989 being reported to GDB or CrashReporter and avoids the problems 17990 related to those programs. Since Clozure CL's Mach exception 17991 handler doesn't claim to handle debugging-related exceptions 17992 (from breakpoints or single-step operations), it's possible to 17993 use GDB to debug Clozure CL.</p> 17991 17994 <p xmlns="http://www.w3.org/1999/xhtml">On platforms where signal handling and debugging don't 17992 get in each other's way, a signal handler is entered with all17993 signals blocked. (This behavior is specified in the call to17994 the sigaction() function which established the signal17995 handler.) The signal handler receives three arguments from17996 the OS kernel; the first is an integer which identifies the17997 signal, the second is a pointer to an object of type17998 "siginfo_t", which may or may not contain a few fields that17999 would help to identify the cause of the exception, andthe18000 third argument is a pointer to a data structure (calleda18001 "ucontext" or something similar) which contains18002 machine-dependent information about the state of the tread at18003 the time that the exception/signal occurred. While18004 asynchronous signals are blocked, the signal handler stores18005 the pointer to its third argument (the "signal context") in a18006 field in the current thread's TCR, sets some bits in another18007 TCR field to indicate that the thread is now waiting to handle18008 an exception, unblocks asynchronous signals, and waits for a18009 global exception lock which serializes exception18010 processing.</p>17995 get in each other's way, a signal handler is entered with 17996 all signals blocked. (This behavior is specified in the 17997 call to the sigaction() function which established the 17998 signal handler.) The signal handler receives three 17999 arguments from the OS kernel; the first is an integer that 18000 identifies the signal, the second is a pointer to an object 18001 of type "siginfo_t", which may or may not contain a few 18002 fields that would help to identify the cause of the 18003 exception, and the third argument is a pointer to a data 18004 structure (called a "ucontext" or something similar), which 18005 contains machine-dependent information about the state of 18006 the thread at the time that the exception/signal occurred. 18007 While asynchronous signals are blocked, the signal handler 18008 stores the pointer to its third argument (the "signal 18009 context") in a field in the current thread's TCR, sets some 18010 bits in another TCR field to indicate that the thread is now 18011 waiting to handle an exception, unblocks asynchronous 18012 signals, and waits for a global exception lock that 18013 serializes exception processing.</p> 18011 18014 <p xmlns="http://www.w3.org/1999/xhtml">On Darwin, the Mach exception thread creates a signal 18012 context (and maybe a siginfo_t structure), stores the signal18013 context in the thread's TCR, sets the TCR field which describes18014 the thread's state, and arranges that the thread resume18015 execution at its signal handling function (with a signal18016 handler, possibly NULL siginfo_t, and signal context as18017 arguments. When the thread resumes, it waits for the global18018 exception lock.</p>18015 context (and maybe a siginfo_t structure), stores the signal 18016 context in the thread's TCR, sets the TCR field which describes 18017 the thread's state, and arranges that the thread resume 18018 execution at its signal handling function (with a signal 18019 handler, possibly NULL siginfo_t, and signal context as 18020 arguments. When the thread resumes, it waits for the global 18021 exception lock.</p> 18019 18022 <p xmlns="http://www.w3.org/1999/xhtml">On x86-64 platforms where signal handing can be used to 18020 handle synchronous exceptions, there's an additional 18021 complication: the OS kernel ordinarily allocates the signal 18022 context and siginfo structures on the stack of the thread 18023 which received the signal; in practice, that means "wherever 18024 RSP is pointing." Clozure CL's <a href="#Register-and-stack-usage-conventions" title="16.2.3. Register and stack usage conventions">Section 16.2.3, âRegister and stack usage conventionsâ</a> require that 18025 the thread's value stack - where RSP is usually pointing while 18026 lisp code is running - contain only "nodes" (properly tagged 18027 lisp objects), and scribbling a signal context all over the 18028 value stack would violate this requirement. To maintain 18029 consistency, the sigaltstack() mechanism is used to cause the 18030 signal to be delivered on (and the signal context and siginfo 18031 to be allocated on) a special stack area (the last few pages 18032 of the thread's control stack, in practice. When the signal 18033 handler runs, it (carefully) copies the signal context and 18034 siginfo to the thread's control stack and makes RSP point into 18035 that stack before invoking the "real" signal handler. (The 18036 effect of this hack is that the "real" signal handler always 18037 runs on the thread's control stack.)</p> 18023 handle synchronous exceptions, there's an additional 18024 complication: the OS kernel ordinarily allocates the signal 18025 context and siginfo structures on the stack of the thread 18026 that received the signal; in practice, that means "wherever 18027 RSP is pointing." Clozure CL's 18028 <a class="xref" href="#Register-and-stack-usage-conventions" title="16.2.3. Register and stack usage conventions">Section 16.2.3, âRegister and stack usage conventionsâ</a> 18029 require that the thread's value stackâwhere RSP is 18030 usually pointing while lisp code is runningâcontain 18031 only "nodes" (properly tagged lisp objects), and scribbling 18032 a signal context all over the value stack would violate this 18033 requirement. To maintain consistency, the sigaltstack() 18034 mechanism is used to cause the signal to be delivered on 18035 (and the signal context and siginfo to be allocated on) a 18036 special stack area (the last few pages of the thread's 18037 control stack, in practice). When the signal handler runs, 18038 it (carefully) copies the signal context and siginfo to the 18039 thread's control stack and makes RSP point into that stack 18040 before invoking the "real" signal handler. The effect of 18041 this hack is that the "real" signal handler always runs on 18042 the thread's control stack.</p> 18038 18043 <p xmlns="http://www.w3.org/1999/xhtml">Once the exception handler has obtained the global 18039 exception lock, it uses the values of the signal number,18040 siginfo_t, and signal context arguments to determine the18041 (logical) cause of the exception. Some exceptions may be18042 caused by factors that should generate lisp errors or other18043 serious conditions (stack overflow); if this is the case, the18044 kernel code may release the global exception lock and call out18045 to lisp code. (The lisp code in question may need to repeat18046 some of the exception decoding process; in particular, it18047 needs to be able to interpret register values in the signal18048 context that it receives as an argument.)</p>18044 exception lock, it uses the values of the signal number, 18045 siginfo_t, and signal context arguments to determine the 18046 (logical) cause of the exception. Some exceptions may be 18047 caused by factors that should generate lisp errors or other 18048 serious conditions (stack overflow); if this is the case, the 18049 kernel code may release the global exception lock and call out 18050 to lisp code. (The lisp code in question may need to repeat 18051 some of the exception decoding process; in particular, it 18052 needs to be able to interpret register values in the signal 18053 context that it receives as an argument.)</p> 18049 18054 <p xmlns="http://www.w3.org/1999/xhtml">In some cases, the lisp kernel exception handler may not 18050 be able to recover from the exception (this is currently true18051 of some types of memory-access fault and is also true of traps18052 or illegal instructions that occur during foreign code18053 execution. In such cases, the kernel exception handler18054 reports the exception as "unhandled", and the kernel debugger18055 is invoked.</p>18055 be able to recover from the exception (this is currently true 18056 of some types of memory-access fault and is also true of traps 18057 or illegal instructions that occur during foreign code 18058 execution. In such cases, the kernel exception handler 18059 reports the exception as "unhandled", and the kernel debugger 18060 is invoked.</p> 18056 18061 <p xmlns="http://www.w3.org/1999/xhtml">If the kernel exception handler identifies the 18057 exception's cause as being a transient out-of-memory condition18058 (indicating that the current thread needs more memory to cons18059 in), it tries to make that memory available. In some cases,18060 doing so involves invoking the GC.</p>18062 exception's cause as being a transient out-of-memory condition 18063 (indicating that the current thread needs more memory to cons 18064 in), it tries to make that memory available. In some cases, 18065 doing so involves invoking the GC.</p> 18061 18066 </div> 18062 18067 <div class="sect2" lang="en" xml:lang="en"> … … 18069 18074 </div> 18070 18075 <p xmlns="http://www.w3.org/1999/xhtml">Clozure CL's GC is not concurrent: when the GC is invoked in 18071 response to an exception in a particular thread, all other18072 lisp threads must stop until the GC's work is done. The18073 thread that triggered the GC iterates over the global TCR18074 list, sending each other thread a distinguished "suspend"18075 signal, then iterates over the list again, waiting for a18076 per-thread semaphore that indicates that the thread has18077 received the "suspend" signal and responded appropriately.18078 Once all other threads have acknowledged the request to18079 suspend themselves, the GC thread can run the GC proper (after18080 doing any necessary <ahref="#PC-lusering" title="16.1.4. PC-lusering">Section 16.1.4, âPC-luseringâ</a>.) Once the18081 GC's completed its work, the thread that invoked the GC18082 iterates over the global TCR list, raising a per-thread18083 "resume" semaphore for each other thread.</p>18076 response to an exception in a particular thread, all other 18077 lisp threads must stop until the GC's work is done. The 18078 thread that triggered the GC iterates over the global TCR 18079 list, sending each other thread a distinguished "suspend" 18080 signal, then iterates over the list again, waiting for a 18081 per-thread semaphore that indicates that the thread has 18082 received the "suspend" signal and responded appropriately. 18083 Once all other threads have acknowledged the request to 18084 suspend themselves, the GC thread can run the GC proper (after 18085 doing any necessary <a class="xref" href="#PC-lusering" title="16.1.4. PC-lusering">Section 16.1.4, âPC-luseringâ</a>.) Once the 18086 GC's completed its work, the thread that invoked the GC 18087 iterates over the global TCR list, raising a per-thread 18088 "resume" semaphore for each other thread.</p> 18084 18089 <p xmlns="http://www.w3.org/1999/xhtml">The signal handler for the asynchronous "suspend" signal 18085 is entered with all asynchronous signals blocked. It saves18086 its signal-context argument in a TCR slot, raises the tcr's18087 "suspend" semaphore, then waits on the TCR's "resume"18088 semaphore.</p>18090 is entered with all asynchronous signals blocked. It saves 18091 its signal-context argument in a TCR slot, raises the tcr's 18092 "suspend" semaphore, then waits on the TCR's "resume" 18093 semaphore.</p> 18089 18094 <p xmlns="http://www.w3.org/1999/xhtml">The GC thread has access to the signal contexts of all 18090 TCRs (including its own) at the time when the thread received18091 an exception or acknowledged a request to suspend itself.18092 This information (and information about stack areas in the TCR18093 itself) allows the GC to identify the "stack locations and18094 register contents" that are elements of the GC's root18095 set.</p>18095 TCRs (including its own) at the time when the thread received 18096 an exception or acknowledged a request to suspend itself. 18097 This information (and information about stack areas in the TCR 18098 itself) allows the GC to identify the "stack locations and 18099 register contents" that are elements of the GC's root 18100 set.</p> 18096 18101 </div> 18097 18102 <div class="sect2" lang="en" xml:lang="en"> … … 18104 18109 </div> 18105 18110 <p xmlns="http://www.w3.org/1999/xhtml">It's not quite accurate to say that Clozure CL's compiler 18106 and runtime follow precise stack and register usage18107 conventions at all times; there are a few exceptions:</p>18111 and runtime follow precise stack and register usage 18112 conventions at all times; there are a few exceptions:</p> 18108 18113 <div xmlns="http://www.w3.org/1999/xhtml" class="itemizedlist"> 18109 18114 <ul type="disc"> 18110 18115 <li> 18111 18116 <p>On both PPC and x86-64 platforms, consing isn't 18112 fully atomic.It takes at least a few instructions to18113 allocate an object in memory(and slap a header on it if18114 necessary); if a thread is interrupted in the middle of18115 that instruction sequence, the new object may or may18116 not have been created or fully initialized at the point in18117 time that the interrupt occurred. (There are actually a18118 few different states of partial initialization)</p>18117 fully atomic.It takes at least a few instructions to 18118 allocate an object in memory(and slap a header on it if 18119 necessary); if a thread is interrupted in the middle of 18120 that instruction sequence, the new object may or may 18121 not have been created or fully initialized at the point in 18122 time that the interrupt occurred. (There are actually a 18123 few different states of partial initialization)</p> 18119 18124 </li> 18120 18125 <li> 18121 18126 <p>On the PPC, the common act of building a lisp 18122 control stack frame involves allocating a four-word frame18123 and storing three register values into that frame. (The18124 fourth word - the back pointer to the previous frame - is18125 automatically set when the frame is allocated.) The18126 previous contents of those three words are unknown (there18127 might have been a foreign stack frame at the same address a18128 few instructions earlier),so interrupting a thread that's18129 in the process of initializing a PPC control stack frame18130 isn't GC-safe.</p>18127 control stack frame involves allocating a four-word frame 18128 and storing three register values into that frame. (The 18129 fourth word - the back pointer to the previous frame - is 18130 automatically set when the frame is allocated.) The 18131 previous contents of those three words are unknown (there 18132 might have been a foreign stack frame at the same address a 18133 few instructions earlier),so interrupting a thread that's 18134 in the process of initializing a PPC control stack frame 18135 isn't GC-safe.</p> 18131 18136 </li> 18132 18137 <li> 18133 18138 <p>There are similar problems with the initialization 18134 of temp stackframes on the PPC. (Allocation and18135 initialization doesn't happen atomically, and the newly18136 allocated stack memory may have undefined contents.)</p>18139 of temp stackframes on the PPC. (Allocation and 18140 initialization doesn't happen atomically, and the newly 18141 allocated stack memory may have undefined contents.)</p> 18137 18142 </li> 18138 18143 <li> 18139 <p><a href="#The-ephemeral-GC" title="16.5. The ephemeral GC">Section 16.5, âThe ephemeral GCâ</a>'s write barrier18140 has to be implemented atomically (i.e.,both an18141 intergenerational store and the update of a18142 corresponding reference bit has to happen without18143 interruption, or neither of these events can18144 happen.)</p>18144 <p><a class="xref" href="#The-ephemeral-GC" title="16.5. The ephemeral GC">Section 16.5, âThe ephemeral GCâ</a>'s write barrier 18145 has to be implemented atomically (i.e.,both an 18146 intergenerational store and the update of a 18147 corresponding reference bit has to happen without 18148 interruption, or neither of these events can 18149 happen.)</p> 18145 18150 </li> 18146 18151 <li> … … 18150 18155 </div> 18151 18156 <p xmlns="http://www.w3.org/1999/xhtml">Fortunately, the number of these non-atomic instruction 18152 sequences is small, and fortunately it's fairly easy for the18153 interrupting thread to recognize when the interrupted thread18154 is in the middle of such a sequence. When this is detected,18155 the interrupting thread modifies the state of the interrupted18156 thread (modifying its PC and other registers) so that it is no18157 longer in the middle of such a sequence (it's either backed18158 out of it or the remaining instructions are emulated.)</p>18157 sequences is small, and fortunately it's fairly easy for the 18158 interrupting thread to recognize when the interrupted thread 18159 is in the middle of such a sequence. When this is detected, 18160 the interrupting thread modifies the state of the interrupted 18161 thread (modifying its PC and other registers) so that it is no 18162 longer in the middle of such a sequence (it's either backed 18163 out of it or the remaining instructions are emulated.)</p> 18159 18164 <p xmlns="http://www.w3.org/1999/xhtml">This works because (a) many of the troublesome 18160 instruction sequences are PPC-specific and it's relatively18161 easy to partially disassemble the instructions surrounding the18162 interrupted thread's PC on the PPC and (b) those instruction18163 sequences are heavily stylized and intended to be easily18164 recognized.</p>18165 instruction sequences are PPC-specific and it's relatively 18166 easy to partially disassemble the instructions surrounding the 18167 interrupted thread's PC on the PPC and (b) those instruction 18168 sequences are heavily stylized and intended to be easily 18169 recognized.</p> 18165 18170 </div> 18166 18171 </div> … … 18182 18187 </div> 18183 18188 <p xmlns="http://www.w3.org/1999/xhtml">Regardless of other details of its implementation, a 18184 garbage collector's job is to partition the set of all18185 heap-allocated lisp objects (CONSes, STRINGs, INSTANCEs, etc.)18186 into two subsets. The first subset contains all objects that18187 are transitively referenced from a small set of "root" objects18188 (the contents of the stacks and registers of all active18189 threads at the time the GC occurs and the values of some18190 global variables.) The second subset contains everything18191 else: those lisp objects that are not transitively reachable18192 from the roots are garbage, and the memory occupied by garbage18193 objects can be reclaimed (since the GC has just proven that18194 it's impossible to reference them.)</p>18189 garbage collector's job is to partition the set of all 18190 heap-allocated lisp objects (CONSes, STRINGs, INSTANCEs, etc.) 18191 into two subsets. The first subset contains all objects that 18192 are transitively referenced from a small set of "root" objects 18193 (the contents of the stacks and registers of all active 18194 threads at the time the GC occurs and the values of some 18195 global variables.) The second subset contains everything 18196 else: those lisp objects that are not transitively reachable 18197 from the roots are garbage, and the memory occupied by garbage 18198 objects can be reclaimed (since the GC has just proven that 18199 it's impossible to reference them.)</p> 18195 18200 <p xmlns="http://www.w3.org/1999/xhtml">The set of live, reachable lisp objects basically form 18196 the nodes of a (usually large) graph, with edges from each18197 node A to any other objects (nodes) that object A18198 references.</p>18201 the nodes of a (usually large) graph, with edges from each 18202 node A to any other objects (nodes) that object A 18203 references.</p> 18199 18204 <p xmlns="http://www.w3.org/1999/xhtml">Some nodes in this graph can never have outgoing edges: 18200 an array with a specialized numeric or character type usually18201 represents its elements in some (possibly more compact)18202 specialized way. Some nodes may refer to lisp objects that18203 are never allocated in memory (FIXNUMs, CHARACTERs,18204 SINGLE-FLOATs on 64-bit platforms ..) This latter class of18205 objects are sometimes called "immediates", but that's a little18206 confusing because the term "immediate" is sometimes used to18207 refer to things that can never be part of the big connectivity18208 graph (e.g., the "raw" bits that make up a floating-point18209 value, foreign address, or numeric value that needs to be used18210 - at least fleetingly - in compiled code.)</p>18205 an array with a specialized numeric or character type usually 18206 represents its elements in some (possibly more compact) 18207 specialized way. Some nodes may refer to lisp objects that 18208 are never allocated in memory (FIXNUMs, CHARACTERs, 18209 SINGLE-FLOATs on 64-bit platforms ..) This latter class of 18210 objects are sometimes called "immediates", but that's a little 18211 confusing because the term "immediate" is sometimes used to 18212 refer to things that can never be part of the big connectivity 18213 graph (e.g., the "raw" bits that make up a floating-point 18214 value, foreign address, or numeric value that needs to be used 18215 - at least fleetingly - in compiled code.)</p> 18211 18216 <p xmlns="http://www.w3.org/1999/xhtml">For the GC to be able to build the connectivity graph 18212 reliably, it's necessary for it to be able to reliably tell18213 (a) whether or not a "potential root" - the contents of a18214 machine register or stack location - is in fact a node and (b)18215 for any node, whether it may have components that refer to18216 other nodes.</p>18217 reliably, it's necessary for it to be able to reliably tell 18218 (a) whether or not a "potential root" - the contents of a 18219 machine register or stack location - is in fact a node and (b) 18220 for any node, whether it may have components that refer to 18221 other nodes.</p> 18217 18222 <p xmlns="http://www.w3.org/1999/xhtml">There's no reliable way to answer the first question on 18218 stock hardware. (If everything was a node, as might be the18219 case on specially microcoded "lisp machine" hardware, it18220 wouldn't even need to be asked.) Since there's no way to just18221 look at a machine word (the contents of a machine register or18222 stack location) and tell whether or not it's a node or just18223 some random non-node value, we have to either adopt and18224 enforce strict conventions on register and stack usage or18225 tolerate ambiguity.</p>18223 stock hardware. (If everything was a node, as might be the 18224 case on specially microcoded "lisp machine" hardware, it 18225 wouldn't even need to be asked.) Since there's no way to just 18226 look at a machine word (the contents of a machine register or 18227 stack location) and tell whether or not it's a node or just 18228 some random non-node value, we have to either adopt and 18229 enforce strict conventions on register and stack usage or 18230 tolerate ambiguity.</p> 18226 18231 <p xmlns="http://www.w3.org/1999/xhtml">"Tolerating ambiguity" is an approach taken by some 18227 ("conservative") GC schemes; by contrast, Clozure CL's GC is18228 "precise", which in this case means that it believes that the18229 contents of certain machine registers and stack locations are18230 always nodes and that other registers and stack locations are18231 never nodes and that these conventions are never violated by18232 the compiler or runtime system. The fact that threads are18233 preemptively scheduled means that a GC could occur (because of18234 activity in some other thread) on any instruction boundary,18235 which in turn means that the compiler and runtime system must18236 follow precise <ahref="#Register-and-stack-usage-conventions" title="16.2.3. Register and stack usage conventions">Section 16.2.3, âRegister and stack usage conventionsâ</a> at all18237 times.</p>18232 ("conservative") GC schemes; by contrast, Clozure CL's GC is 18233 "precise", which in this case means that it believes that the 18234 contents of certain machine registers and stack locations are 18235 always nodes and that other registers and stack locations are 18236 never nodes and that these conventions are never violated by 18237 the compiler or runtime system. The fact that threads are 18238 preemptively scheduled means that a GC could occur (because of 18239 activity in some other thread) on any instruction boundary, 18240 which in turn means that the compiler and runtime system must 18241 follow precise <a class="xref" href="#Register-and-stack-usage-conventions" title="16.2.3. Register and stack usage conventions">Section 16.2.3, âRegister and stack usage conventionsâ</a> at all 18242 times.</p> 18238 18243 <p xmlns="http://www.w3.org/1999/xhtml">Once we've decided that a given machine word is a node, 18239 a <a href="#Tagging-scheme" title="16.2.4. Tagging scheme">Section 16.2.4, âTagging schemeâ</a> describes how the node's 18240 value and type are encoded in that machine word.</p> 18241 <p xmlns="http://www.w3.org/1999/xhtml">Most of this - so far - has discussed things from the 18242 GC's very low-level perspective. From a much higher point of 18243 view, lisp functions accept nodes as arguments, return nodes 18244 as values, and (usually) perform some operations on those 18245 arguments in order to produce those results. (In many cases, 18246 the operations in question involve raw non-node values.) 18247 Higher-level parts of the lisp type system (functions like 18248 TYPE-OF and CLASS-OF, etc.) depend on the <a href="#Tagging-scheme" title="16.2.4. Tagging scheme">Section 16.2.4, âTagging schemeâ</a>.</p> 18244 a <a class="xref" href="#Tagging-scheme" title="16.2.4. Tagging scheme">Section 16.2.4, âTagging schemeâ</a> describes how the node's 18245 value and type are encoded in that machine word.</p> 18246 <p xmlns="http://www.w3.org/1999/xhtml">Most of this discussionâso farâhas treated 18247 things from the GC's very low-level perspective. From a much 18248 higher point of view, lisp functions accept nodes as 18249 arguments, return nodes as values, and (usually) perform 18250 some operations on those arguments in order to produce those 18251 results. (In many cases, the operations in question involve 18252 raw non-node values.) Higher-level parts of the lisp type 18253 system (functions like TYPE-OF and CLASS-OF, etc.) depend on 18254 the <a class="xref" href="#Tagging-scheme" title="16.2.4. Tagging scheme">Section 16.2.4, âTagging schemeâ</a>.</p> 18249 18255 </div> 18250 18256 <div class="sect2" lang="en" xml:lang="en"> … … 18257 18263 </div> 18258 18264 <p xmlns="http://www.w3.org/1999/xhtml">On the PPC, there's a third case (besides "node" and 18259 "immediate" values). As discussed below, a node that denotes18260 a memory-allocated lisp object is a biased (tagged) pointer18261 -to- that object; it's not generally possible to point -into-18262 some composite (multi-element) object (such a pointer would18263 not be a node, and the GC would have no way to update the18264 pointer if it were to move the underlying object.)</p>18265 "immediate" values). As discussed below, a node that denotes 18266 a memory-allocated lisp object is a biased (tagged) pointer 18267 -to- that object; it's not generally possible to point -into- 18268 some composite (multi-element) object (such a pointer would 18269 not be a node, and the GC would have no way to update the 18270 pointer if it were to move the underlying object.)</p> 18265 18271 <p xmlns="http://www.w3.org/1999/xhtml">Such a pointer ("into" the interior of a heap-allocated 18266 object) is often called a <span class="emphasis"><em>locative</em></span>; the18267 cases where locatives are allowed in Clozure CL mostly involve18268 the behavior of function call and return instructions. (To be18269 technically accurate, the other case also arises on x86-64, but18270 that case isn't as user-visible.)</p>18272 object) is often called a <span class="emphasis"><em>locative</em></span>; the 18273 cases where locatives are allowed in Clozure CL mostly involve 18274 the behavior of function call and return instructions. (To be 18275 technically accurate, the other case also arises on x86-64, but 18276 that case isn't as user-visible.)</p> 18271 18277 <p xmlns="http://www.w3.org/1999/xhtml">On the PowerPC (both PPC32 and PPC64), all machine 18272 instructions are 32 bits wide and all instruction words are18273 allocated on 32-bit boundaries. In PPC Clozure CL, a CODE-VECTOR18274 is a specialized type of vector-like object; its elements are18275 32-bit PPC machine instructions. A CODE-VECTOR is an18276 attribute ofFUNCTION object; a function call involves18277 accessing the function's code-vector and jumping to the18278 address of its first instruction.</p>18278 instructions are 32 bits wide and all instruction words are 18279 allocated on 32-bit boundaries. In PPC Clozure CL, a CODE-VECTOR 18280 is a specialized type of vector-like object; its elements 18281 are 32-bit PPC machine instructions. A CODE-VECTOR is an 18282 attribute of a FUNCTION object; a function call involves 18283 accessing the function's code-vector and jumping to the 18284 address of its first instruction.</p> 18279 18285 <p xmlns="http://www.w3.org/1999/xhtml">As each instruction in the code vector sequentially 18280 executes, the hardware program counter (PC) register advances18281 to the address of the next instruction (a locative into the18282 code vector); since PPC instructions are always 32 bits wide18283 and aligned on 32-bit boundaries, the low two bits of the PC18284 are always 0. If the function executes a call (simple call18285 instructions have the mnemonic "bl" on the PPC, which stands18286 for "branch and link"), the address of the next instruction18287 (also a word-aligned locative into a code-vector) is copied18288 into the special- purpose PPC "link register" (lr); a function18289 returns to its caller via a "branch to link register" (blr)18290 instruction. Some cases of function call and return might18291 also use the PPC's "count register" (ctr), and if either the18292 lr or ctr needs to be stored in memory it needs to first be18293 copied to a general-purpose register.</p>18286 executes, the hardware program counter (PC) register advances 18287 to the address of the next instruction (a locative into the 18288 code vector); since PPC instructions are always 32 bits wide 18289 and aligned on 32-bit boundaries, the low two bits of the PC 18290 are always 0. If the function executes a call (simple call 18291 instructions have the mnemonic "bl" on the PPC, which stands 18292 for "branch and link"), the address of the next instruction 18293 (also a word-aligned locative into a code-vector) is copied 18294 into the special- purpose PPC "link register" (lr); a function 18295 returns to its caller via a "branch to link register" (blr) 18296 instruction. Some cases of function call and return might 18297 also use the PPC's "count register" (ctr), and if either the 18298 lr or ctr needs to be stored in memory it needs to first be 18299 copied to a general-purpose register.</p> 18294 18300 <p xmlns="http://www.w3.org/1999/xhtml">Clozure CL's GC understands that certain registers contain 18295 these special "pc-locatives" (locatives that point into 18296 CODE-VECTOR objects); it contains special support for finding 18297 the containing CODE-VECTOR object and for adjusting all of 18298 these "pc-locatives" if the containing object is moved in 18299 memory. The first part of that - finding the containing 18300 object - is possible and practical on the PPC because of 18301 architectural artifacts (fixed-width instructions and arcana 18302 of instruction encoding.) It's not possible on x86-64, but 18303 fortunately not necessary either (though the second part - 18304 adjusting the PC/RIP when the containing object moves) is both 18305 necessary and simple.</p> 18301 these special "pc-locatives" (locatives that point into 18302 CODE-VECTOR objects); it contains special support for 18303 finding the containing CODE-VECTOR object and for adjusting 18304 all of these "pc-locatives" if the containing object is 18305 moved in memory. The first part of that 18306 operationâfinding the containing objectâis 18307 possible and practical on the PPC because of architectural 18308 artifacts (fixed-width instructions and arcana of 18309 instruction encoding.) It's not possible on x86-64, but 18310 fortunately not necessary either (though the second part - 18311 adjusting the PC/RIP when the containing object moves) is 18312 both necessary and simple.</p> 18306 18313 </div> 18307 18314 <div class="sect2" lang="en" xml:lang="en"> … … 18322 18329 </div> 18323 18330 <p xmlns="http://www.w3.org/1999/xhtml">On both PPC and X86 platforms, each lisp thread uses 3 18324 stacks; the ways in which these stacks are used differs18325 between the PPC and X86.</p>18331 stacks; the ways in which these stacks are used differs 18332 between the PPC and X86.</p> 18326 18333 <p xmlns="http://www.w3.org/1999/xhtml">Each thread has:</p> 18327 18334 <div xmlns="http://www.w3.org/1999/xhtml" class="itemizedlist"> … … 18329 18336 <li> 18330 18337 <p>A "control stack". On both platforms, this is 18331 "the stack" used by foreign code. On the PPC, it18332 consists of a linked list of frames where the first word18333 in each frame points to the first word in the previous18334 frame (and the outermost frame points to 0.) Some18335 frames on a PPC control stack are lisp frames; lisp18336 frames are always 4 words in size and contain (in18337 addition to the back pointer to the previous frame) the18338 calling function (a node), the return address (a18339 "locative" into the calling function's code-vector), and18340 the value to which the value-stack pointer (see below)18341 should be restored on function exit. On the PPC, the GC18342 has to look at control-stack frames, identify which of18343 those frames are lisp frames, and treat the contents of18344 the saved function slot as a node (and handle the return18345 address locative specially.) On x86-64, the control18346 stack is used for dynamic-extent allocation of immediate18347 objects. Since the control stack never contains nodes18348 on x86-64, the GC ignores it on that platform.18349 Alignment of the control stack follows the ABI18350 conventions of the platform (at least at any point in18351 time where foreign code could run.) On PPC, the r118352 register always points to the top of the current18353 thread's control stack; on x86-64, the RSP register18354 points to the top of the current thread's control stack18355 when the thread is running foreign code and the address18356 of the top of the control stack is kept in the thread's18357 TCR (see <ahref="#The-Thread-Context-Record" title="16.1.1. The Thread Context Record">Section 16.1.1, âThe Thread Context Recordâ</a>18358 when not running foreign code. The control stack "grows18359 down."</p>18338 "the stack" used by foreign code. On the PPC, it 18339 consists of a linked list of frames where the first word 18340 in each frame points to the first word in the previous 18341 frame (and the outermost frame points to 0.) Some 18342 frames on a PPC control stack are lisp frames; lisp 18343 frames are always 4 words in size and contain (in 18344 addition to the back pointer to the previous frame) the 18345 calling function (a node), the return address (a 18346 "locative" into the calling function's code-vector), and 18347 the value to which the value-stack pointer (see below) 18348 should be restored on function exit. On the PPC, the GC 18349 has to look at control-stack frames, identify which of 18350 those frames are lisp frames, and treat the contents of 18351 the saved function slot as a node (and handle the return 18352 address locative specially.) On x86-64, the control 18353 stack is used for dynamic-extent allocation of immediate 18354 objects. Since the control stack never contains nodes 18355 on x86-64, the GC ignores it on that platform. 18356 Alignment of the control stack follows the ABI 18357 conventions of the platform (at least at any point in 18358 time where foreign code could run.) On PPC, the r1 18359 register always points to the top of the current 18360 thread's control stack; on x86-64, the RSP register 18361 points to the top of the current thread's control stack 18362 when the thread is running foreign code and the address 18363 of the top of the control stack is kept in the thread's 18364 TCR (see <a class="xref" href="#The-Thread-Context-Record" title="16.1.1. The Thread Context Record">Section 16.1.1, âThe Thread Context Recordâ</a> 18365 when not running foreign code. The control stack "grows 18366 down."</p> 18360 18367 </li> 18361 18368 <li> 18362 18369 <p>A "value stack". On both platforms, all values on 18363 the value stack are nodes (including "tagged return18364 addresses" on x86-64.) The value stack is always18365 aligned to the native word size; objects are always18366 pushed on the value stack using atomic instructions18367 ("stwu"/"stdu" on PPC, "push" on x86-64), so the18368 contents of the value stack between its bottom and top18369 are always unambiguously nodes; the compiler usually18370 tries to pop or discard nodes from the value stack as18371 soon as possible after their last use (as soon as they18372 may have become garbage.) On x86-64, the RSP register18373 addresses the top of the value stack when running lisp18374 code; that address is saved in the TCR when running18375 foreign code. On the PPC, a dedicated register (VSP,18376 currently r15) is used to address the top of the value18377 stack when running lisp code, and the VSP value is saved18378 in the TCR when running foreign code. The value stack18379 grows down.</p>18370 the value stack are nodes (including "tagged return 18371 addresses" on x86-64.) The value stack is always 18372 aligned to the native word size; objects are always 18373 pushed on the value stack using atomic instructions 18374 ("stwu"/"stdu" on PPC, "push" on x86-64), so the 18375 contents of the value stack between its bottom and top 18376 are always unambiguously nodes; the compiler usually 18377 tries to pop or discard nodes from the value stack as 18378 soon as possible after their last use (as soon as they 18379 may have become garbage.) On x86-64, the RSP register 18380 addresses the top of the value stack when running lisp 18381 code; that address is saved in the TCR when running 18382 foreign code. On the PPC, a dedicated register (VSP, 18383 currently r15) is used to address the top of the value 18384 stack when running lisp code, and the VSP value is saved 18385 in the TCR when running foreign code. The value stack 18386 grows down.</p> 18380 18387 </li> 18381 18388 <li> 18382 18389 <p>A "temp stack". The temp stack consists of a 18383 linked list of frames, each of which points to the 18384 previous temp stack frame. The number of native machine 18385 words in each temp stack frame is always even, so the 18386 temp stack is aligned on a two-word (64- or 128-bit) 18387 boundary. The temp stack is used for dynamic-extent 18388 objects on both platforms; on the PPC, it's used for 18389 essentially all such objects (regardless of whether or 18390 not the objects contain nodes); on the x86-64, immediate 18391 dynamic-extent objects (strings, foreign pointers, etc.) 18392 are allocated on the control stack and only 18393 node-containing dynamic-extent objects are allocated on 18394 the temp stack. Data structures used to implement CATCH 18395 and UNWIND-PROTECT are stored on the temp stack on both 18396 ppc and x86-64. Temp stack frames are always doublenode 18397 aligned and objects within a temp stack frame are 18398 aligned on doublenode boundaries. The first word in 18399 each frame contains a back pointer to the previous 18400 frame; on the PPC, the second word is used to indicate 18401 to the GC whether the remaining objects are nodes (if 18402 the second word is 0) or immediate (otherwise.) On 18403 x86-64, where temp stack frames always contain nodes, 18404 the second word is always 0. The temp stack grows down. 18405 It usually takes several instructions to allocate and 18406 safely initialize a temp stack frame that's intended to 18407 contain nodes, and the GC has to recognize the case 18408 where a thread is in the process of allocating and 18409 initializing a temp stack frame and take care not to 18410 interpret any uninitialized words in the frame as nodes. 18411 See (someplace). The PPC keeps the current top of the 18412 temp stack in a dedicated register (TSP, currently r12) 18413 when running lisp code and saves this register's value 18414 in the TCR when running foreign code. The x86-64 keeps 18415 the address of the top of each thread's temp stack in 18416 the thread's TCR.</p> 18390 linked list of frames, each of which points to the 18391 previous temp stack frame. The number of native 18392 machine words in each temp stack frame is always even, 18393 so the temp stack is aligned on a two-word (64- or 18394 128-bit) boundary. The temp stack is used for 18395 dynamic-extent objects on both platforms; on the PPC, 18396 it's used for essentially all such objects (regardless 18397 of whether or not the objects contain nodes); on the 18398 x86-64, immediate dynamic-extent objects (strings, 18399 foreign pointers, etc.) are allocated on the control 18400 stack and only node-containing dynamic-extent objects 18401 are allocated on the temp stack. Data structures used 18402 to implement CATCH and UNWIND-PROTECT are stored on 18403 the temp stack on both ppc and x86-64. Temp stack 18404 frames are always doublenode aligned and objects 18405 within a temp stack frame are aligned on doublenode 18406 boundaries. The first word in each frame contains a 18407 back pointer to the previous frame; on the PPC, the 18408 second word is used to indicate to the GC whether the 18409 remaining objects are nodes (if the second word is 0) 18410 or immediate (otherwise.) On x86-64, where temp stack 18411 frames always contain nodes, the second word is always 18412 0. The temp stack grows down. It usually takes 18413 several instructions to allocate and safely initialize 18414 a temp stack frame that's intended to contain nodes, 18415 and the GC has to recognize the case where a thread is 18416 in the process of allocating and initializing a temp 18417 stack frame and take care not to interpret any 18418 uninitialized words in the frame as nodes. The PPC 18419 keeps the current top of the temp stack in a dedicated 18420 register (TSP, currently r12) when running lisp code 18421 and saves this register's value in the TCR when 18422 running foreign code. The x86-64 keeps the address of 18423 the top of each thread's temp stack in the thread's 18424 TCR.</p> 18417 18425 </li> 18418 18426 </ul> … … 18428 18436 </div> 18429 18437 <p xmlns="http://www.w3.org/1999/xhtml">If there are a "reasonable" (for some value of 18430 "reasonable") number orgeneral-purpose registers and the18431 instruction set is "reasonably" orthogonal (most18432 instructions that operate on GPRs can operate on any GPR),18433 then it's possible to statically partition the GPRs into at18434 least two sets: "immediate registers" never contain nodes,18435 and "node registers" always contain nodes. (On the PPC, a18436 few registers are members of a third set of "PC locatives",18437 and on both platforms some registers may have dedicated18438 roles as stack or heap pointers; the latter class is treated18439 as immediates by the GC proper but may be used to help18440 determine the bounds of stack and heap memory areas.)</p>18438 "reasonable") number of general-purpose registers and the 18439 instruction set is "reasonably" orthogonal (most 18440 instructions that operate on GPRs can operate on any GPR), 18441 then it's possible to statically partition the GPRs into at 18442 least two sets: "immediate registers" never contain nodes, 18443 and "node registers" always contain nodes. (On the PPC, a 18444 few registers are members of a third set of "PC locatives", 18445 and on both platforms some registers may have dedicated 18446 roles as stack or heap pointers; the latter class is treated 18447 as immediates by the GC proper but may be used to help 18448 determine the bounds of stack and heap memory areas.)</p> 18441 18449 <p xmlns="http://www.w3.org/1999/xhtml">The ultimate definition of register partitioning is 18442 hardwired into the GC in functions like "mark_xp()" and18443 "forward_xp()", which process the values of some of the18444 registers in an exception frame as nodes and may give some18445 sort of special treatment to other register values they18446 encounter there.)</p>18450 hardwired into the GC in functions like "mark_xp()" and 18451 "forward_xp()", which process the values of some of the 18452 registers in an exception frame as nodes and may give some 18453 sort of special treatment to other register values they 18454 encounter there.)</p> 18447 18455 <p xmlns="http://www.w3.org/1999/xhtml">On x86-64, the static register partitioning scheme involves:</p> 18448 18456 <div xmlns="http://www.w3.org/1999/xhtml" class="itemizedlist"> … … 18451 18459 <p>(only) three "immediate" registers.</p> 18452 18460 <p>The RAX, RCX, and RDX registers are used as the 18453 implicit operands and results of some extended-precision18454 multiply and divide instructions which generally involve18455 non-node values; since their use in these instructions18456 means that they can't be guaranteed to contain node18457 values at all times, it's natural to put these registers18458 in the "immediate" set. RAX is generally given the18459 symbolic name "imm0", RDX is given the symbolic name18460 "imm1" and RCX is given the symbolic name "imm2"; you18461 may see these names in disassembled code, usually in18462 operations involving type checking, array indexing, and18463 foreign memory and function access.</p>18461 implicit operands and results of some extended-precision 18462 multiply and divide instructions which generally involve 18463 non-node values; since their use in these instructions 18464 means that they can't be guaranteed to contain node 18465 values at all times, it's natural to put these registers 18466 in the "immediate" set. RAX is generally given the 18467 symbolic name "imm0", RDX is given the symbolic name 18468 "imm1" and RCX is given the symbolic name "imm2"; you 18469 may see these names in disassembled code, usually in 18470 operations involving type checking, array indexing, and 18471 foreign memory and function access.</p> 18464 18472 </li> 18465 18473 <li> 18466 18474 <p>(only) two "dedicated" registers.</p> 18467 18475 <p>RSP and RBP have 18468 dedicated functionality dictated by the hardware and18469 calling conventions.</p>18476 dedicated functionality dictated by the hardware and 18477 calling conventions.</p> 18470 18478 </li> 18471 18479 <li> 18472 18480 <p>11 "node" registers.</p> 18473 18481 <p>All other registers (RBX, RSI, RDI, and R8-R15) 18474 are asserted to contain node values at (almost) all18475 times; legacy "string" operations that implicitly use RSI18476 and/or RDI are not used.</p>18482 are asserted to contain node values at (almost) all 18483 times; legacy "string" operations that implicitly use RSI 18484 and/or RDI are not used.</p> 18477 18485 </li> 18478 18486 </ul> 18479 18487 </div> 18480 18488 <p xmlns="http://www.w3.org/1999/xhtml">On the PPC, the static register partitioning scheme 18481 involves:</p>18489 involves:</p> 18482 18490 <div xmlns="http://www.w3.org/1999/xhtml" class="itemizedlist"> 18483 18491 <ul type="disc"> … … 18485 18493 <p>6 "immediate" registers.</p> 18486 18494 <p>Registers r3-r8 are given 18487 the symbolic names imm0-imm5. As a RISC architecture18488 with simpler addressing modes, the PPC probably18489 uses immediate registers a bit more often than the CISC18490 x86-64 does, but they're generally used for the same sort18491 of things (type checking, array indexing, FFI,18492 etc.)</p>18495 the symbolic names imm0-imm5. As a RISC architecture 18496 with simpler addressing modes, the PPC probably 18497 uses immediate registers a bit more often than the CISC 18498 x86-64 does, but they're generally used for the same sort 18499 of things (type checking, array indexing, FFI, 18500 etc.)</p> 18493 18501 </li> 18494 18502 <li> 18495 18503 <p>9 dedicated registers 18496 </p>18504 </p> 18497 18505 <div class="itemizedlist"> 18498 18506 <ul type="circle"> 18499 18507 <li> 18500 18508 <p>r0 (symbolic name rzero) always contains the 18501 value 0 when running lisp code. Its value is18502 sometimes read as 0 when it's used as the base18503 register in a memory address; keeping the value 018504 there is sometimes convenient and avoids18505 asymmetry.</p>18509 value 0 when running lisp code. Its value is 18510 sometimes read as 0 when it's used as the base 18511 register in a memory address; keeping the value 0 18512 there is sometimes convenient and avoids 18513 asymmetry.</p> 18506 18514 </li> 18507 18515 <li> 18508 18516 <p>r1 (symbolic name sp) is the control stack 18509 pointer, by PPC convention.</p>18517 pointer, by PPC convention.</p> 18510 18518 </li> 18511 18519 <li> 18512 18520 <p>r2 is used to hold the current thread's TCR on 18513 ppc64 systems; it's not used on ppc32.</p>18521 ppc64 systems; it's not used on ppc32.</p> 18514 18522 </li> 18515 18523 <li> 18516 18524 <p>r9 and r10 (symbolic names allocptr and 18517 allocbase) are used to do per-thread memory18518 allocation</p>18525 allocbase) are used to do per-thread memory 18526 allocation</p> 18519 18527 </li> 18520 18528 <li> 18521 18529 <p>r11 (symbolic name nargs) contains the number 18522 of function arguments on entry and the number of18523 return values in multiple-value returning18524 constructs. It's not used more generally as either18525 a node or immediate register because of the way that18526 certain trap instruction encodings are18527 interpreted.</p>18530 of function arguments on entry and the number of 18531 return values in multiple-value returning 18532 constructs. It's not used more generally as either 18533 a node or immediate register because of the way that 18534 certain trap instruction encodings are 18535 interpreted.</p> 18528 18536 </li> 18529 18537 <li> 18530 18538 <p>r12 (symbolic name tsp) holds the top of the 18531 current thread's temp stack.</p>18539 current thread's temp stack.</p> 18532 18540 </li> 18533 18541 <li> 18534 18542 <p>r13 is used to hold the TCR on PPC32 systems; 18535 it's not used on PPC64.</p>18543 it's not used on PPC64.</p> 18536 18544 </li> 18537 18545 <li> 18538 18546 <p>r14 (symbolic name loc-pc) is used to copy 18539 "pc-locative" values between main memory and18540 special-purpose PPC registers (LR and CTR) used in18541 function-call and return instructions.</p>18547 "pc-locative" values between main memory and 18548 special-purpose PPC registers (LR and CTR) used in 18549 function-call and return instructions.</p> 18542 18550 </li> 18543 18551 <li> 18544 18552 <p>r15 (symbolic name vsp) addresses the top of 18545 the current thread's value stack.</p>18553 the current thread's value stack.</p> 18546 18554 </li> 18547 18555 <li> 18548 18556 <p>lr and ctr are PPC branch-unit registers used 18549 in function call and return instructions; they're18550 always treated as "pc-locatives", which precludes18551 the use of the ctr in some PPC looping18552 constructs.</p>18557 in function call and return instructions; they're 18558 always treated as "pc-locatives", which precludes 18559 the use of the ctr in some PPC looping 18560 constructs.</p> 18553 18561 </li> 18554 18562 </ul> 18555 18563 </div> 18556 18564 <p> 18557 </p>18565 </p> 18558 18566 </li> 18559 18567 <li> 18560 18568 <p>17 "node" registers</p> 18561 18569 <p>r15-r31 are always treated as node 18562 registers</p>18570 registers</p> 18563 18571 </li> 18564 18572 </ul> … … 18575 18583 </div> 18576 18584 <p xmlns="http://www.w3.org/1999/xhtml">Clozure CL always allocates lisp objects on double-node 18577 (64-bit for 32-bit platforms, 128-bit for 64-bit platforms)18578 boundaries; this mean that the low 3 bits (32-bit lisp) or 418579 bits (64-bit lisp) are always 0 and are therefore redundant18580 (we only really need to know the upper 29 or 60 bits in order18581 to identify the aligned object address.) The extra bits in a18582 lisp node can be used to encode at least some information18583 about the node's type, and the other 29/60 bits represent18584 either an immediate value or a doublenode-aligned memory18585 address. The low 3 or 4 bits of a node are called the node's18586 "tag bits", and the conventions used to encode type18587 information in those tag bits are called a "tagging18588 scheme."</p>18585 (64-bit for 32-bit platforms, 128-bit for 64-bit platforms) 18586 boundaries; this mean that the low 3 bits (32-bit lisp) or 4 18587 bits (64-bit lisp) are always 0 and are therefore redundant 18588 (we only really need to know the upper 29 or 60 bits in order 18589 to identify the aligned object address.) The extra bits in a 18590 lisp node can be used to encode at least some information 18591 about the node's type, and the other 29/60 bits represent 18592 either an immediate value or a doublenode-aligned memory 18593 address. The low 3 or 4 bits of a node are called the node's 18594 "tag bits", and the conventions used to encode type 18595 information in those tag bits are called a "tagging 18596 scheme."</p> 18589 18597 <p xmlns="http://www.w3.org/1999/xhtml">It might be possible to use the same tagging scheme on 18590 all platforms (at least on all platforms with the same word18591 size and/or the same number of available tag bits), but there18592 are often some strong reasons for not doing so. These18593 arguments tend to be very machine-specific: sometimes, there18594 are fairly obvious machine-dependent tricks that can be18595 exploited to make common operations on some types of tagged18596 objects faster; other times, there are architectural18597 restrictions that make it impractical to use certain tags for18598 certain types. (On PPC64, the "ld" (load doubleword) and18599 "std" (store doubleword) instructions - which load and store a18600 GPR operand at the effective address formed by adding the18601 value of another GPR operand and a 16-bit constant operand -18602 require that the low two bits of that constant operand be 0.18603 Since such instructions would typically be used to access the18604 fields of things like CONS cells and structures, it's18605 desirable that that the tags chosen for CONS cells and18606 structures allow the use of these instructions as opposed to18607 more expensive alternatives.)</p>18598 all platforms (at least on all platforms with the same word 18599 size and/or the same number of available tag bits), but there 18600 are often some strong reasons for not doing so. These 18601 arguments tend to be very machine-specific: sometimes, there 18602 are fairly obvious machine-dependent tricks that can be 18603 exploited to make common operations on some types of tagged 18604 objects faster; other times, there are architectural 18605 restrictions that make it impractical to use certain tags for 18606 certain types. (On PPC64, the "ld" (load doubleword) and 18607 "std" (store doubleword) instructions - which load and store a 18608 GPR operand at the effective address formed by adding the 18609 value of another GPR operand and a 16-bit constant operand - 18610 require that the low two bits of that constant operand be 0. 18611 Since such instructions would typically be used to access the 18612 fields of things like CONS cells and structures, it's 18613 desirable that that the tags chosen for CONS cells and 18614 structures allow the use of these instructions as opposed to 18615 more expensive alternatives.)</p> 18608 18616 <p xmlns="http://www.w3.org/1999/xhtml">One architecture-dependent tagging trick that works well 18609 on all architectures is to use a tag of 0 for FIXNUMs: a 18610 fixnum basically encodes its value shifted left a few bits and 18611 keeps those low bits clear. FIXNUM addition, subtraction, and 18612 binary logical operations can operate directly on the node 18613 operands, addition and subtraction can exploit hardware-based 18614 overflow detection, and (in the absence of overflow) the 18615 hardware result of those operations is a node (fixnum). Some 18616 other slightly-less-common operations may require a few extra 18617 instructions, but arithmetic operations on FIXNUMs should be 18618 as cheap as possible and using a tag of zero for FIXNUMs helps 18619 to ensure that it will be.</p> 18620 <p xmlns="http://www.w3.org/1999/xhtml">If we have N available tag bits (N = 3 for 32-bit 18621 Clozure CL and N = 4 for 64-bit Clozure CL), this way of 18622 representing fixnums with the low M bits forced to 0 works as 18623 long as M <= N. The smaller we make M, the larger the 18624 values of MOST-POSITIVE-FIXNUM and MOST-NEGATIVE become; the 18625 larger we make N, the more distinct non-FIXNUM tags become 18626 available. A reasonable compromise is to choose M = N-1; this 18627 basically yields two distinct FIXNUM tags (one for even 18628 fixnums, one for odd fixnums), gives 30-bit fixnums on 32-bit 18629 platforms and 61-bit fixnums on 64-bit platforms, and leaves 18630 us with 6 or 14 tags to encoded other types.</p> 18617 on all architectures is to use a tag of 0 for FIXNUMs: a 18618 fixnum basically encodes its value shifted left a few bits 18619 and keeps those low bits clear. FIXNUM addition, 18620 subtraction, and binary logical operations can operate 18621 directly on the node operands, addition and subtraction can 18622 exploit hardware-based overflow detection, and (in the 18623 absence of overflow) the hardware result of those operations 18624 is a node (fixnum). Some other slightly-less-common 18625 operations may require a few extra instructions, but 18626 arithmetic operations on FIXNUMs should be as cheap as 18627 possible and using a tag of zero for FIXNUMs helps to ensure 18628 that it will be.</p> 18629 <p xmlns="http://www.w3.org/1999/xhtml">If we have N available tag bits (N = 3 for 32-bit Clozure CL 18630 and N = 4 for 64-bit Clozure CL), this way of representing 18631 fixnums with the low M bits forced to 0 works as long as M 18632 <= N. The smaller we make M, the larger the values of 18633 MOST-POSITIVE-FIXNUM and MOST-NEGATIVE become; the larger we 18634 make N, the more distinct non-FIXNUM tags become available. 18635 A reasonable compromise is to choose M = N-1; this basically 18636 yields two distinct FIXNUM tags (one for even fixnums, one 18637 for odd fixnums), gives 30-bit fixnums on 32-bit platforms 18638 and 61-bit fixnums on 64-bit platforms, and leaves us with 6 18639 or 14 tags to encoded other types.</p> 18631 18640 <p xmlns="http://www.w3.org/1999/xhtml">Once we get past the assignment of FIXNUM tags, things 18632 quickly devolve into machine-dependencies. We can fairly18633 easily see that we can't directly all other primitive lisp18634 object types with only 6 or 14 available tag values; the18635 details of how types are encoded vary between the ppc32,18636 ppc64, and x86-64 implementations, but there are some general18637 common principles:</p>18641 quickly devolve into machine-dependencies. We can fairly 18642 easily see that we can't directly tag all other primitive 18643 lisp object types with only 6 or 14 available tag values; 18644 the details of how types are encoded vary between the ppc32, 18645 ppc64, and x86-64 implementations, but there are some 18646 general common principles:</p> 18638 18647 <div xmlns="http://www.w3.org/1999/xhtml" class="itemizedlist"> 18639 18648 <ul type="disc"> 18640 18649 <li> 18641 18650 <p>CONS cells always contain exactly 2 elements and are 18642 usually fairly common.It therefore makes sense to give18643 CONS cells their own tag. Unlike the fixnum case - where a18644 tag value of 0 had positive implications - there doesn't18645 seem to be any advantage to using any particular value.18646 (A longtime ago - in the case of 68K MCL - the CONS tag18647 and the order of CAR and CDR in memory were chosen to allow18648 smaller, cheaper addressing modes to be used to "cdr down a18649 list." That's not a factor on ppc or x86-64,but all18650 versions of Clozure CL still store the CDR of a CONS cell18651 first in memory. It doesn't matter, but doing it the way18652 that the host system did made boostrapping to a new target18653 system a little easier.)18654 </p>18651 usually fairly common.It therefore makes sense to give 18652 CONS cells their own tag. Unlike the fixnum case - 18653 where a tag value of 0 had positive implications - there 18654 doesn't seem to be any advantage to using any particular 18655 value. (A longtime ago - in the case of 68K MCL - the 18656 CONS tag and the order of CAR and CDR in memory were 18657 chosen to allow smaller, cheaper addressing modes to be 18658 used to "cdr down a list." That's not a factor on ppc 18659 or x86-64, but all versions of Clozure CL still store the CDR 18660 of a CONS cell first in memory. It doesn't matter, but 18661 doing it the way that the host system did made 18662 boostrapping to a new target system a little easier.) 18663 </p> 18655 18664 </li> 18656 18665 <li> 18657 <p>Any way you look at it, NIL is a bit ... unusual. NIL 18658 is both a SYMBOL and a LIST (as well as being a canonical 18659 truth value and probably a few other things.) Its role as 18660 a LIST is probably much more important to most programs 18661 than its role as a SYMBOL is:LISTP has to be true of NIL 18662 and primitives like CAR and CDR do LISTP implicitly when 18663 safe and want that operation to be fast.There are several 18664 possible approaches to this; Clozure CL uses two of them. On 18665 PPC32 and X86-64, NIL is basically a weird CONS cell that 18666 straddles two doublenodes; the tag of NIL is unique and 18667 congruent modulo 4 (modulo 8 on 64-bit) with the tag used 18668 for CONS cells. LISTP is therefore true of any node whose 18669 low 2 (or 3) bits contain the appropriate tag value (it's 18670 not otherwise necessary to special-case NIL.) 18671 SYMBOL accessors (SYMBOL-NAME, SYMBOL-VALUE, SYMBOL-PLIST 18672 ..) -do- have to special-case NIL (and access the 18673 components of an internal proxy symbol.) On PPC64 (where 18674 architectural restrictions dictate the set of tags that can 18675 be used to access fixed components of an object), 18676 that approach wasn't practical. NIL is just a 18677 distinguished SYMBOL,and it just happens to be the case 18678 that its pname slot and values lots are at the same offsets 18679 from a tagged pointer as a CONS cell's CDR and CAR would be. 18680 NIL's pname is set to NIL (SYMBOL-NAME checks for this and 18681 returns the string "NIL"), and LISTP (and therefore safe 18682 CAR and CDR) have to check for (OR NULL CONSP). At least in 18683 the case of CAR and CDR, the fact that the PPC has multiple 18684 condition-code fields keeps that extra test from 18685 being prohibitively expensive.</p> 18666 <p>Any way you look at it, NIL is a bit 18667 ... unusual. NIL is both a SYMBOL and a LIST (as well as 18668 being a canonical truth value and probably a few other 18669 things.) Its role as a LIST is probably much more 18670 important to most programs than its role as a SYMBOL is: 18671 LISTP has to be true of NIL and primitives like CAR and 18672 CDR do LISTP implicitly when safe and want that 18673 operation to be fast. There are several possible 18674 approaches to this problem; Clozure CL uses two of them. On 18675 PPC32 and X86-64, NIL is basically a weird CONS cell 18676 that straddles two doublenodes; the tag of NIL is unique 18677 and congruent modulo 4 (modulo 8 on 64-bit) with the tag 18678 used for CONS cells. LISTP is therefore true of any 18679 node whose low 2 (or 3) bits contain the appropriate tag 18680 value (it's not otherwise necessary to special-case 18681 NIL.) SYMBOL accessors (SYMBOL-NAME, SYMBOL-VALUE, 18682 SYMBOL-PLIST ..) -do- have to special-case NIL (and 18683 access the components of an internal proxy symbol.) On 18684 PPC64 (where architectural restrictions dictate the set 18685 of tags that can be used to access fixed components of 18686 an object), that approach wasn't practical. NIL is just 18687 a distinguished SYMBOL,and it just happens to be the 18688 case that its pname slot and values slot are at the same 18689 offsets from a tagged pointer as a CONS cell's CDR and 18690 CAR would be. NIL's pname is set to NIL (SYMBOL-NAME 18691 checks for this and returns the string "NIL"), and LISTP 18692 (and therefore safe CAR and CDR) has to check for (OR 18693 NULL CONSP). At least in the case of CAR and CDR, the 18694 fact that the PPC has multiple condition-code fields 18695 keeps that extra test from being prohibitively 18696 expensive.</p> 18686 18697 </li> 18687 18698 <li> 18688 <p>Some objects are immediate (but not FIXNUMs).This is 18689 true of CHARACTERs and, on 64-bit platforms, 18690 SINGLE-FLOATs.It's also true of some nodes used in the 18691 runtime system (special values used to indicate unbound 18692 variables and slots, for instance.) On 64-bit platforms, 18693 SINGLE-FLOATs have their own unique tag (making them a 18694 little easier to recognize; on all platforms, CHARACTERs 18695 share a tag with other immediate objects (unbound markers) 18696 but are easy to recognize (by looking at several of their 18697 low bits.) The GC treats any node with an immediate tag 18698 (and any node with a fixnum tag) as a leaf.</p> 18699 <p>Some objects are immediate (but not FIXNUMs). This 18700 is true of CHARACTERs and, on 64-bit platforms, 18701 SINGLE-FLOATs. It's also true of some nodes used in the 18702 runtime system (special values used to indicate unbound 18703 variables and slots, for instance.) On 64-bit platforms, 18704 SINGLE-FLOATs have their own unique tag (making them a 18705 little easier to recognize; on all platforms, CHARACTERs 18706 share a tag with other immediate objects (unbound 18707 markers) but are easy to recognize (by looking at 18708 several of their low bits.) The GC treats any node with 18709 an immediate tag (and any node with a fixnum tag) as a 18710 leaf.</p> 18699 18711 </li> 18700 18712 <li> 18701 18713 <p>There are some advantages to treating everything 18702 else - memory-allocated objects that aren't CONS cells - 18703 uniformly.There are some disadvantages to that uniform 18704 treatment as well, and the treatment of "memory-allocated 18705 non-CONS objects" isn't entirely uniform across all 18706 Clozure CL implementations. Let's first pretend that 18707 the treatment is uniform, then discuss the ways in which it 18708 isn't.The "uniform approach" is to treat all 18709 memory-allocated non-CONS objects as if they were vectors; 18710 this use of the term is a little looser than what's implied 18711 by the CL VECTOR type. Clozure CL actually uses the 18712 term "uvector" to mean "a memory-allocated lisp object 18713 other than a CONS cell,whose first word is a header which 18714 describes the object's type and the number of elements that 18715 it contains." In this view, a SYMBOL is a UVECTOR, as is a 18716 STRING, a STANDARD-INSTANCE, a CL array or vector,a 18717 FUNCTION, and even a DOUBLE-FLOAT.In the PPC 18718 implementations (where things are a little more 18719 ... uniform),a single tag value is used to denote any 18720 uvector; in order to determine something more specific 18721 about the type of the object in question, it's necessary to 18722 fetch the low byte of the header word from memory. On 18723 the x86-64 platform, certain types of uvectors - SYMBOLs 18724 and FUNCTIONs -are given their own unique tags. The good 18725 news about the x86-64 approach is that SYMBOLs and 18726 FUNCTIONs can be recognized without referencing memory; the 18727 slightly bad news is that primitive operations that work on 18728 UVECTOR-tagged objects - like the function CCL:UVREF - 18729 don't work on SYMBOLs or FUNCTIONs on x86-64 (but -do- work 18730 on those types of objects in the PPC ports.) The header word 18731 which precedes a UVECTOR's data in memory contains 8 bits 18732 of type information in the low byte and either 24 or 56 18733 bits of"element-count" information in the rest of the 18734 word. (This is where the sometimes-limiting value of 2^24 18735 for ARRAY-TOTAL-SIZE-LIMIT on PPC32 platforms comes from.) 18736 The low byte of the header - sometimes called the uvector's 18737 subtag - is itself tagged (which means that the header is 18738 tagged.) The (3 or 4) tag bits in the subtag are used to 18739 determine whether the uvector's elements are nodes or 18740 immediates.(A UVECTOR whose elements are nodes is called a 18741 GVECTOR; a UVECTOR whose elements are immediates is called 18742 an IVECTOR. This terminology came from Spice Lisp, which 18743 was a predecessor of CMUCL.) Even though a uvector header 18744 is tagged, a header is not a node. There's no (supported) 18745 way to get your hands on one in lisp and doing so could be 18746 dangerous. (If the value of a header wound up in a lisp 18747 node register and that register wound up getting pushed on 18748 a thread's value stack, the GC might misinterpret that 18749 situation to mean that there was a stack-allocated UVECTOR 18750 on the value stack.)</p> 18714 elseâmemory-allocated objects that aren't CONS 18715 cellsâuniformly.There are some disadvantages to 18716 that uniform treatment as well, and the treatment of 18717 "memory-allocated non-CONS objects" isn't entirely 18718 uniform across all Clozure CL implementations. Let's first 18719 pretend that the treatment is uniform, then discuss the 18720 ways in which it isn't.The "uniform approach" is to 18721 treat all memory-allocated non-CONS objects as if they 18722 were vectors; this use of the term is a little looser 18723 than what's implied by the CL VECTOR type. Clozure CL 18724 actually uses the term "uvector" to mean "a 18725 memory-allocated lisp object other than a CONS cell, 18726 whose first word is a header that describes the object's 18727 type and the number of elements that it contains." In 18728 this view, a SYMBOL is a UVECTOR, as is a STRING, a 18729 STANDARD-INSTANCE, a CL array or vector, a FUNCTION, and 18730 even a DOUBLE-FLOAT. In the PPC implementations (where 18731 things are a little more ... uniform), a single tag 18732 value is used to denote any uvector; in order to 18733 determine something more specific about the type of the 18734 object in question, it's necessary to fetch the low byte 18735 of the header word from memory. On the x86-64 platform, 18736 certain types of uvectors - SYMBOLs and FUNCTIONs -are 18737 given their own unique tags. The good news about the 18738 x86-64 approach is that SYMBOLs and FUNCTIONs can be 18739 recognized without referencing memory; the slightly bad 18740 news is that primitive operations that work on 18741 UVECTOR-tagged objectsâlike the function 18742 CCL:UVREFâdon't work on SYMBOLs or FUNCTIONs on 18743 x86-64 (but -do- work on those types of objects in the 18744 PPC ports.) The header word that precedes a UVECTOR's 18745 data in memory contains 8 bits of type information in 18746 the low byte and either 24 or 56 bits of "element-count" 18747 information in the rest of the word. (This is where the 18748 sometimes-limiting value of 2^24 for 18749 ARRAY-TOTAL-SIZE-LIMIT on PPC32 platforms comes from.) 18750 The low byte of the headerâsometimes called the 18751 uvector's subtagâis itself tagged (which means 18752 that the header is tagged.) The (3 or 4) tag bits in 18753 the subtag are used to determine whether the uvector's 18754 elements are nodes or immediates. (A UVECTOR whose 18755 elements are nodes is called a GVECTOR; a UVECTOR whose 18756 elements are immediates is called an IVECTOR. This 18757 terminology came from Spice Lisp, which was a 18758 predecessor of CMUCL.) Even though a uvector header is 18759 tagged, a header is not a node. There's no (supported) 18760 way to get your hands on one in lisp and doing so could 18761 be dangerous. (If the value of a header wound up in a 18762 lisp node register and that register wound up getting 18763 pushed on a thread's value stack, the GC might 18764 misinterpret that situation to mean that there was a 18765 stack-allocated UVECTOR on the value stack.)</p> 18751 18766 </li> 18752 18767 </ul> … … 18763 18778 </div> 18764 18779 <p xmlns="http://www.w3.org/1999/xhtml">When the Clozure CL kernel first 18765 starts up, a large contiguous chunk of the process's address 18766 space is mapped as "anonymous, no access" memory. ("Large" means 18767 different things in different contexts; on LinuxPPC32, it means 18768 "about 1 gigabyte", on DarwinPPC32, it means "about 2 18769 gigabytes", and on current 64-bit platforms it ranges from 128 18770 to 512 gigabytes, depending on OS. These values are both 18771 defaults and upper limits; the --heap-reserve argument can be 18772 used to try to reserve less than the default.)</p> 18780 starts up, a large contiguous chunk of the process's address 18781 space is mapped as "anonymous, no access" memory. ("Large" 18782 means different things in different contexts; on LinuxPPC32, 18783 it means "about 1 gigabyte", on DarwinPPC32, it means "about 2 18784 gigabytes", and on current 64-bit platforms it ranges from 128 18785 to 512 gigabytes, depending on OS. These values are both 18786 defaults and upper limits; 18787 the <code class="literal">--heap-reserve</code> argument can be used to 18788 try to reserve less than the default.)</p> 18773 18789 <p xmlns="http://www.w3.org/1999/xhtml">Reserving address space that can't (yet) be read or 18774 written to doesn't cost much; in particular, it doesn't require18775 that corresponding swap space or physical memory be available.18776 Marking the address range as being "mapped" helps to ensure that18777 other things (results from random calls to malloc(), dynamically18778 loaded shared libraries) won't be allocated in this region that18779 lisp has reserved for its own heap growth.</p>18790 written to doesn't cost much; in particular, it doesn't require 18791 that corresponding swap space or physical memory be available. 18792 Marking the address range as being "mapped" helps to ensure that 18793 other things (results from random calls to malloc(), dynamically 18794 loaded shared libraries) won't be allocated in this region that 18795 lisp has reserved for its own heap growth.</p> 18780 18796 <p xmlns="http://www.w3.org/1999/xhtml">A small portion (around 1/32 on 32-bit platforms and 1/64 18781 on 64-bit platforms) of that large chunk of address space is18782 reserved for GC data structures. Memory pages reserved for18783 these data structures are mapped read-write as pagesmade18784 writable in the main portion of the heap.</p>18797 on 64-bit platforms) of that large chunk of address space is 18798 reserved for GC data structures. Memory pages reserved for 18799 these data structures are mapped read-write as pages are made 18800 writable in the main portion of the heap.</p> 18785 18801 <p xmlns="http://www.w3.org/1999/xhtml">The initial heap image is mapped into this reserved 18786 address space and an additional (LISP-HEAP-GC-THRESHOLD) bytes18787 are mapped read-write. GC data structures grow to match the18788 amount of GC-able memory in the initial image +the gc18789 threshold, and control is transferred to lisp code. Inevitably,18790 that code spoils everything and starts consing; there are18791 basically three layers of memory allocation that can go18792 on.</p>18802 address space and an additional (LISP-HEAP-GC-THRESHOLD) bytes 18803 are mapped read-write. GC data structures grow to match the 18804 amount of GC-able memory in the initial image plus the gc 18805 threshold, and control is transferred to lisp code. 18806 Inevitably, that code spoils everything and starts consing; 18807 there are basically three layers of memory allocation that can 18808 go on.</p> 18793 18809 <div class="sect2" lang="en" xml:lang="en"> 18794 18810 <div xmlns="http://www.w3.org/1999/xhtml" class="titlepage"> … … 18800 18816 </div> 18801 18817 <p xmlns="http://www.w3.org/1999/xhtml">Each lisp thread has a private "reserved memory 18802 segment"; when a thread starts up, its reserved memory segment18803 is empty. PPC ports maintain the highest unallocated address18804 and the lowest allocatable address in the current segment in18805 registers when running lisp code; on x86-664, these values are18806 maintained in the current threads's TCR. (An "empty" heap18807 segment is one whose high pointer and low pointer are equal.)18808 When a thread is not in the middle of allocating something, the18809 low 3 or 4 bits of the high and low pointers are clear (the18810 pointers are doublenode-aligned.)</p>18818 segment"; when a thread starts up, its reserved memory segment 18819 is empty. PPC ports maintain the highest unallocated address 18820 and the lowest allocatable address in the current segment in 18821 registers when running lisp code; on x86-664, these values are 18822 maintained in the current threads's TCR. (An "empty" heap 18823 segment is one whose high pointer and low pointer are equal.) 18824 When a thread is not in the middle of allocating something, the 18825 low 3 or 4 bits of the high and low pointers are clear (the 18826 pointers are doublenode-aligned.)</p> 18811 18827 <p xmlns="http://www.w3.org/1999/xhtml">A thread tries to allocate an object whose physical size 18812 in bytes is X and whose tag is Y by:</p>18828 in bytes is X and whose tag is Y by:</p> 18813 18829 <div xmlns="http://www.w3.org/1999/xhtml" class="orderedlist"> 18814 18830 <ol type="1"> … … 18818 18834 <li> 18819 18835 <p>trapping if the high pointer is less than the low 18820 pointer</p>18836 pointer</p> 18821 18837 </li> 18822 18838 <li> 18823 18839 <p>using the (tagged) high pointer to initialize the 18824 object, if necessary</p>18840 object, if necessary</p> 18825 18841 </li> 18826 18842 <li> … … 18830 18846 </div> 18831 18847 <p xmlns="http://www.w3.org/1999/xhtml">On PPC32, where the size of a CONS cell is 8 bytes and 18832 the tag of a CONS cell is 1, machine code which sets the arg_z18833 register to the result of doing (CONS arg_y arg_z) looks18834 like:</p>18848 the tag of a CONS cell is 1, machine code which sets the arg_z 18849 register to the result of doing (CONS arg_y arg_z) looks 18850 like:</p> 18835 18851 <pre xmlns="http://www.w3.org/1999/xhtml" class="programlisting"> 18836 18852 (SUBI ALLOCPTR ALLOCPTR 7) ; decrement the high pointer by (- 8 1) … … 18840 18856 (MR ARG_Z ALLOCPTR) ; arg_z is the new CONS cell 18841 18857 (RLWINM ALLOCPTR ALLOCPTR 0 0 28) ; clear tag bits 18842 </pre>18858 </pre> 18843 18859 <p xmlns="http://www.w3.org/1999/xhtml">On x86-64, the idea's similar but the implementation is 18844 different. The high and low pointers to the current thread's18845 reserved segment are kept in the TCR, which is addressed by18846 the gs segment register. An x86-64 CONS cell is 16 bytes wide18847 and has a tag of 3; we canonically use the temp0 register to18848 initialize the object</p>18860 different. The high and low pointers to the current thread's 18861 reserved segment are kept in the TCR, which is addressed by 18862 the gs segment register. An x86-64 CONS cell is 16 bytes wide 18863 and has a tag of 3; we canonically use the temp0 register to 18864 initialize the object</p> 18849 18865 <pre xmlns="http://www.w3.org/1999/xhtml" class="programlisting"> 18850 18866 (subq ($ 13) ((% gs) 216)) ; decrement allocptr … … 18858 18874 (movq (% arg_z) (-3 (% temp0))); set the cdr 18859 18875 (movq (% temp0) (% arg_z)) ; return the cons 18860 </pre>18876 </pre> 18861 18877 <p xmlns="http://www.w3.org/1999/xhtml">If we don't take the trap (if allocating 8-16 bytes 18862 doesn't exhaust the thread's reserved memory segment), that's18863 a fairly short and simple instruction sequence. If we do take18864 the trap, we'll have to do some additional work in order to18865 get a new segment for the current thread.</p>18878 doesn't exhaust the thread's reserved memory segment), that's 18879 a fairly short and simple instruction sequence. If we do take 18880 the trap, we'll have to do some additional work in order to 18881 get a new segment for the current thread.</p> 18866 18882 </div> 18867 18883 <div class="sect2" lang="en" xml:lang="en"> … … 18874 18890 </div> 18875 18891 <p xmlns="http://www.w3.org/1999/xhtml">After the lisp image is first mapped into memory - and after 18876 each full GC - the lisp kernel ensures that18877 (LISP-HEAP-GC-TRESHOLD) additional bytes beyond the current18878 end of the heap are mapped read-write.</p>18892 each full GC - the lisp kernel ensures that 18893 (LISP-HEAP-GC-TRESHOLD) additional bytes beyond the current 18894 end of the heap are mapped read-write.</p> 18879 18895 <p xmlns="http://www.w3.org/1999/xhtml">If a thread traps while trying to allocate memory, the 18880 thread goes through the usual exception-handling protocol (to18881 ensure that any other thread that GCs "sees" the state of the18882 trapping thread and to serialize exception handling.) When18883 the exception handler runs, it determines the nature and size18884 of the failed allocation and tries to complete the allocation18885 on the thread's behalf (and leave it with a reasonably large18886 thread-specific memory segment so that the next small18887 allocation is unlikely to trap.</p>18896 thread goes through the usual exception-handling protocol (to 18897 ensure that any other thread that GCs "sees" the state of the 18898 trapping thread and to serialize exception handling.) When 18899 the exception handler runs, it determines the nature and size 18900 of the failed allocation and tries to complete the allocation 18901 on the thread's behalf (and leave it with a reasonably large 18902 thread-specific memory segment so that the next small 18903 allocation is unlikely to trap.</p> 18888 18904 <p xmlns="http://www.w3.org/1999/xhtml">Depending on the size of the requested segment 18889 allocation, the number of segment allocations that have18890 occurred since the last GC, and the EGC and GC thresholds, the18891 segment allocation trap handler may invoke a full or ephemeral18892 GC before returning a new segment. It's worth noting that the18893 [E]GC is triggered based on the number of and size of these18894 segments that have been allocated since the last GC; it doesn't18895 have much to do with how "full" each of those per-thread18896 segments are. It's possible for a large number of threads to18897 do fairly incidental memory allocation and trigger the GC as a18898 result; avoiding this involves tuning the per-thread18899 allocation quantum and the GC/EGC thresholds18900 appropriately.</p>18905 allocation, the number of segment allocations that have 18906 occurred since the last GC, and the EGC and GC thresholds, the 18907 segment allocation trap handler may invoke a full or ephemeral 18908 GC before returning a new segment. It's worth noting that the 18909 [E]GC is triggered based on the number of and size of these 18910 segments that have been allocated since the last GC; it doesn't 18911 have much to do with how "full" each of those per-thread 18912 segments are. It's possible for a large number of threads to 18913 do fairly incidental memory allocation and trigger the GC as a 18914 result; avoiding this involves tuning the per-thread 18915 allocation quantum and the GC/EGC thresholds 18916 appropriately.</p> 18901 18917 </div> 18902 18918 <div class="sect2" lang="en" xml:lang="en"> … … 18909 18925 </div> 18910 18926 <p xmlns="http://www.w3.org/1999/xhtml">All OSes on which Clozure CL currently runs use an 18911 "overcommit" memory allocation strategy by default (though18912 some of them provide ways of overriding that default.) What18913 this means in general is that the OS doesn't necessarily18914 ensure that backing store is available when asked to map pages18915 as read-write; it'll often return a success indicator from the18916 mapping attempt (mapping the pages as "zero-fill,18917 copy-on-write"), and only try to allocate the backing store18918 (swap space and/or physical memory) when non-zero contents are18919 written to the pages.</p>18927 "overcommit" memory allocation strategy by default (though 18928 some of them provide ways of overriding that default.) What 18929 this means in general is that the OS doesn't necessarily 18930 ensure that backing store is available when asked to map pages 18931 as read-write; it'll often return a success indicator from the 18932 mapping attempt (mapping the pages as "zero-fill, 18933 copy-on-write"), and only try to allocate the backing store 18934 (swap space and/or physical memory) when non-zero contents are 18935 written to the pages.</p> 18920 18936 <p xmlns="http://www.w3.org/1999/xhtml">It -sounds- like it'd be better to have the mmap() call 18921 fail immediately, but it's actually a complicated issue.18922 (It's possible that other applications will stop using some18923 backing store before lisp code actually touches the pages that18924 need it, for instance.) It's also not guaranteed that lisp18925 code would be able to "cleanly" signal an out-of-memory18926 condition if lisp is ... out of memory</p>18937 fail immediately, but it's actually a complicated issue. 18938 (It's possible that other applications will stop using some 18939 backing store before lisp code actually touches the pages that 18940 need it, for instance.) It's also not guaranteed that lisp 18941 code would be able to "cleanly" signal an out-of-memory 18942 condition if lisp is ... out of memory</p> 18927 18943 <p xmlns="http://www.w3.org/1999/xhtml">I don't know that I've ever seen an abrupt out-of-memory 18928 failure that wasn't preceded by several minutes of excessive18929 paging activity. The most expedient course in cases like this18930 is to either (a) use less memory or (b) get more memory; it's18931 generally hard to use memory that you don't have.</p>18944 failure that wasn't preceded by several minutes of excessive 18945 paging activity. The most expedient course in cases like this 18946 is to either (a) use less memory or (b) get more memory; it's 18947 generally hard to use memory that you don't have.</p> 18932 18948 </div> 18933 18949 </div> … … 18941 18957 </div> 18942 18958 <p xmlns="http://www.w3.org/1999/xhtml">The GC uses a Mark/Compact algorithm; its 18943 execution time is essentially a factor of the amount of live18944 data in the heap. (The somewhat better-known Mark/Sweep18945 algorithms don't compact the live data but instead traverse the18946 garbage to rebuild free-lists; their execution time is therefore18947 a factor of the total heap size.)</p>18948 <p xmlns="http://www.w3.org/1999/xhtml">As mentioned in <a href="#Heap-Allocation" title="16.3. Heap Allocation">Section 16.3, âHeap Allocationâ</a>, two18949 auxiliary data structures (proportional to the size of the lisp18950 heap) are maintained. These are</p>18959 execution time is essentially a factor of the amount of live 18960 data in the heap. (The somewhat better-known Mark/Sweep 18961 algorithms don't compact the live data but instead traverse the 18962 garbage to rebuild free-lists; their execution time is therefore 18963 a factor of the total heap size.)</p> 18964 <p xmlns="http://www.w3.org/1999/xhtml">As mentioned in <a class="xref" href="#Heap-Allocation" title="16.3. Heap Allocation">Section 16.3, âHeap Allocationâ</a>, two 18965 auxiliary data structures (proportional to the size of the lisp 18966 heap) are maintained. These are</p> 18951 18967 <div xmlns="http://www.w3.org/1999/xhtml" class="orderedlist"> 18952 18968 <ol type="1"> 18953 18969 <li> 18954 18970 <p>the markbits bitvector, which contains a bit for 18955 every doublenode in the dynamic heap (plus a few extra words18956 for alignment and so that sub-bitvectors can start on word18957 boundaries.)</p>18971 every doublenode in the dynamic heap (plus a few extra words 18972 for alignment and so that sub-bitvectors can start on word 18973 boundaries.)</p> 18958 18974 </li> 18959 18975 <li> 18960 18976 <p>the relocation table, which contains a native word for 18961 every 32 or 64 doublenodes in the dynamic heap, plus an18962 extra word used to keep track of the end of the heap.</p>18977 every 32 or 64 doublenodes in the dynamic heap, plus an 18978 extra word used to keep track of the end of the heap.</p> 18963 18979 </li> 18964 18980 </ol> 18965 18981 </div> 18966 18982 <p xmlns="http://www.w3.org/1999/xhtml">The total GC space overhead is therefore on the order of 18967 3% (2/64 or 1/32).</p>18983 3% (2/64 or 1/32).</p> 18968 18984 <p xmlns="http://www.w3.org/1999/xhtml">The general algorithm proceeds as follows:</p> 18969 18985 <div class="sect2" lang="en" xml:lang="en"> … … 18976 18992 </div> 18977 18993 <p xmlns="http://www.w3.org/1999/xhtml">Each doublenode in the dynamic heap has a corresponding 18978 bit in the markbits vector. (For any doublenode in the heap,18979 the index of its mark bit is determined by subtracting the18980 address of the start of the heap from the address of the18981 object and dividing the result by 8 or 16.) The GC knows the18982 markbit index of the free pointer, so determining that the18983 markbit index of a doubleword address is between the start of18984 the heap and the free pointer can be done with a single18985 unsigned comparison.</p>18994 bit in the markbits vector. (For any doublenode in the heap, 18995 the index of its mark bit is determined by subtracting the 18996 address of the start of the heap from the address of the 18997 object and dividing the result by 8 or 16.) The GC knows the 18998 markbit index of the free pointer, so determining that the 18999 markbit index of a doubleword address is between the start of 19000 the heap and the free pointer can be done with a single 19001 unsigned comparison.</p> 18986 19002 <p xmlns="http://www.w3.org/1999/xhtml">The markbits of all doublenodes in the dynamic heap are 18987 zeroed before the mark phase begins. An object is18988 <span class="emphasis"><em>marked</em></span> if the markbits of all of its18989 constituent doublewords are set and unmarked otherwise;18990 setting an object's markbits involves setting the corresponding18991 markbits of all constituent doublenodes in the object.</p>19003 zeroed before the mark phase begins. An object is 19004 <span class="emphasis"><em>marked</em></span> if the markbits of all of its 19005 constituent doublewords are set and unmarked otherwise; 19006 setting an object's markbits involves setting the corresponding 19007 markbits of all constituent doublenodes in the object.</p> 18992 19008 <p xmlns="http://www.w3.org/1999/xhtml">The mark phase traverses each root. If the tag of the 18993 value of the root indicates that it's a non-immediate node18994 whose address lies in the lisp heap, then:</p>19009 value of the root indicates that it's a non-immediate node 19010 whose address lies in the lisp heap, then:</p> 18995 19011 <div xmlns="http://www.w3.org/1999/xhtml" class="orderedlist"> 18996 19012 <ol type="1"> … … 19006 19022 <li> 19007 19023 <p>If the object is a cons cell, recursively mark its 19008 car and cdr.</p>19024 car and cdr.</p> 19009 19025 </li> 19010 19026 <li> 19011 19027 <p>Otherwise, the object is a gvector. Recursively mark 19012 its elements.</p>19028 its elements.</p> 19013 19029 </li> 19014 19030 </ol> 19015 19031 </div> 19016 19032 <p xmlns="http://www.w3.org/1999/xhtml">Marking an object thus involves ensuring that its mark 19017 bits are set and then recursively marking any pointers19018 contained within the object if the object was originally19019 unmarked. If this recursive step was implemented in the19020 obvious manner, marking an object would take stack space19021 proportional to the length of the pointer chain from some root19022 to that object. Rather than storing that pointer chain19023 implicitly on the stack (in a series of recursive calls to the19024 mark subroutine), the Clozure CL marker uses mixture of recursion19025 and a technique called <span class="emphasis"><em>link inversion</em></span> to19026 store the pointer chain in the objects themselves. (Recursion19027 tends to be simpler and faster; if a recursive step notes that19028 stack space is becoming limited, the link-inversion technique19029 is used.)</p>19033 bits are set and then recursively marking any pointers 19034 contained within the object if the object was originally 19035 unmarked. If this recursive step was implemented in the 19036 obvious manner, marking an object would take stack space 19037 proportional to the length of the pointer chain from some root 19038 to that object. Rather than storing that pointer chain 19039 implicitly on the stack (in a series of recursive calls to the 19040 mark subroutine), the Clozure CL marker uses mixture of recursion 19041 and a technique called <span class="emphasis"><em>link inversion</em></span> to 19042 store the pointer chain in the objects themselves. (Recursion 19043 tends to be simpler and faster; if a recursive step notes that 19044 stack space is becoming limited, the link-inversion technique 19045 is used.)</p> 19030 19046 <p xmlns="http://www.w3.org/1999/xhtml">Certain types of objects are treated a little specially:</p> 19031 19047 <div xmlns="http://www.w3.org/1999/xhtml" class="orderedlist"> … … 19033 19049 <li> 19034 19050 <p>To support a feature called <span class="emphasis"><em>GCTWA 19035 <sup>[<a id="id439619" href="#ftn.id439619">1</a>]</sup>19036 , </em></span>the vector which contains the19037 internal symbols of the current package is marked on19038 entry to the mark phase, but the symbols themselves are19039 not marked at this time. Near the end of the mark phase,19040 symbols referenced from this vector which are19041 not otherwise marked are marked if and only if they're19042 somehow distinguishable from newly created symbols (by19043 virtue of their having function bindings, value bindings,19044 plists,or other attributes.)</p>19051 <sup>[<a id="id418468" href="#ftn.id418468" class="footnote">1</a>]</sup> 19052 , </em></span>the vector that contains the internal 19053 symbols of the current package is marked on entry to the 19054 mark phase, but the symbols themselves are not marked at 19055 this time. Near the end of the mark phase, symbols 19056 referenced from this vector which are not otherwise 19057 marked are marked if and only if they're somehow 19058 distinguishable from newly created symbols (by virtue of 19059 their having function bindings, value bindings, plists, 19060 or other attributes.)</p> 19045 19061 </li> 19046 19062 <li> 19047 19063 <p>Pools have their first element set to NIL before any 19048 other elements are marked.</p>19064 other elements are marked.</p> 19049 19065 </li> 19050 19066 <li> 19051 19067 <p>All hash tables have certain fields (used to cache 19052 previous results) invalidated.</p>19068 previous results) invalidated.</p> 19053 19069 </li> 19054 19070 <li> 19055 19071 <p>Weak Hash Tables and other weak objects are put on a 19056 linkedlist as they're encountered; their contents are only19057 retained if there are other (non-weak) references to19058 them.</p>19072 linkedlist as they're encountered; their contents are only 19073 retained if there are other (non-weak) references to 19074 them.</p> 19059 19075 </li> 19060 19076 </ol> 19061 19077 </div> 19062 19078 <p xmlns="http://www.w3.org/1999/xhtml">At the end of the mark phase, the markbits of all 19063 objects whichare transitively reachable from the roots are19064 set and all other markbits are clear.</p>19079 objects that are transitively reachable from the roots are 19080 set and all other markbits are clear.</p> 19065 19081 </div> 19066 19082 <div class="sect2" lang="en" xml:lang="en"> … … 19073 19089 </div> 19074 19090 <p xmlns="http://www.w3.org/1999/xhtml">The <span class="emphasis"><em>forwarding address</em></span> of a 19075 doublenode in the dynamic heap is (<its current address> -19076 (size_of_doublenode * <the number of unmarked markbits that19077 precede it>)) or alternately (<the base of the heap> +19078 (size_of_doublenode * <the number of marked markbits that19079 precede it >)). Rather than count the number of preceding19080 markbits each time, the relocation table is used to precompute19081 an approximation of the forwarding addresses for all19082 doublewords. Given this approximate address and a pointer into19083 the markbits vector, it's relatively easy to compute the exact19084 forwarding address.</p>19091 doublenode in the dynamic heap is (<its current address> - 19092 (size_of_doublenode * <the number of unmarked markbits that 19093 precede it>)) or alternately (<the base of the heap> + 19094 (size_of_doublenode * <the number of marked markbits that 19095 precede it >)). Rather than count the number of preceding 19096 markbits each time, the relocation table is used to precompute 19097 an approximation of the forwarding addresses for all 19098 doublewords. Given this approximate address and a pointer into 19099 the markbits vector, it's relatively easy to compute the exact 19100 forwarding address.</p> 19085 19101 <p xmlns="http://www.w3.org/1999/xhtml">The relocation table contains the forwarding addresses 19086 of each <span class="emphasis"><em>pagelet</em></span>, where a pagelet is 25619087 bytes (or 32 doublenodes). The forwarding address of the first19088 pagelet is the base of the heap. The forwarding address of the19089 second pagelet is the sum of the forwarding address of the19090 first and 8 bytes for each mark bit set in the first 32-bit19091 word in the markbits table. The last entry in the relocation19092 table contains the forwarding address that the freepointer19093 would have, e.g., the new value of the freepointer after19094 compaction.</p>19102 of each <span class="emphasis"><em>pagelet</em></span>, where a pagelet is 256 19103 bytes (or 32 doublenodes). The forwarding address of the first 19104 pagelet is the base of the heap. The forwarding address of the 19105 second pagelet is the sum of the forwarding address of the 19106 first and 8 bytes for each mark bit set in the first 32-bit 19107 word in the markbits table. The last entry in the relocation 19108 table contains the forwarding address that the freepointer 19109 would have, e.g., the new value of the freepointer after 19110 compaction.</p> 19095 19111 <p xmlns="http://www.w3.org/1999/xhtml">In many programs, old objects rarely become garbage and 19096 new objects often do. When building the relocation table, the19097 relocation phase notes the address of the first unmarked19098 object in the dynamic heap. Only the area of the heap between19099 the first unmarked object and the freepointer needs to be19100 compacted; only pointers to this area will need to be19101 forwarded (the forwarding address of all other pointers to the19102 dynamic heap is the address of that pointer.) Often, the19103 first unmarked object is much nearer the free pointer than it19104 is to the base of the heap.</p>19112 new objects often do. When building the relocation table, the 19113 relocation phase notes the address of the first unmarked 19114 object in the dynamic heap. Only the area of the heap between 19115 the first unmarked object and the freepointer needs to be 19116 compacted; only pointers to this area will need to be 19117 forwarded (the forwarding address of all other pointers to the 19118 dynamic heap is the address of that pointer.) Often, the 19119 first unmarked object is much nearer the free pointer than it 19120 is to the base of the heap.</p> 19105 19121 </div> 19106 19122 <div class="sect2" lang="en" xml:lang="en"> … … 19113 19129 </div> 19114 19130 <p xmlns="http://www.w3.org/1999/xhtml">The forwarding phase traverses all roots and the "old" 19115 part of the dynamic heap (the part between the base of the19116 heap and the first unmarked object.) All references to objects19117 whose address is between the first unmarked object and the19118 free pointer are updated to point to the address the object19119 will have after compaction by using the relocation table and19120 the markbits vector and interpolating.</p>19131 part of the dynamic heap (the part between the base of the 19132 heap and the first unmarked object.) All references to objects 19133 whose address is between the first unmarked object and the 19134 free pointer are updated to point to the address the object 19135 will have after compaction by using the relocation table and 19136 the markbits vector and interpolating.</p> 19121 19137 <p xmlns="http://www.w3.org/1999/xhtml">The relocation table entry for the pagelet nearest the 19122 object is found. If the pagelet's address is less than the19123 object's address, the number of set markbits that precede the19124 object on the pagelet is used to determine the object's19125 address; otherwise, the number of set markbits the follow the19126 object on the pagelet is used.</p>19138 object is found. If the pagelet's address is less than the 19139 object's address, the number of set markbits that precede 19140 the object on the pagelet is used to determine the object's 19141 address; otherwise, the number of set markbits that follow 19142 the object on the pagelet is used.</p> 19127 19143 <p xmlns="http://www.w3.org/1999/xhtml">Since forwarding views the heap as a set of doublewords, 19128 locatives are (mostly) treated like any other pointers. (The19129 basic difference is that locatives may appear to be tagged as19130 fixnums, in which case they're treated as word-aligned19131 pointers into the object.)</p>19144 locatives are (mostly) treated like any other pointers. (The 19145 basic difference is that locatives may appear to be tagged as 19146 fixnums, in which case they're treated as word-aligned 19147 pointers into the object.)</p> 19132 19148 <p xmlns="http://www.w3.org/1999/xhtml">If the forward phase changes the address of any hash 19133 table key in a hash table that hashes by address (e.g., an EQ19134 hash table), it sets a bit in the hash table's header. The19135 hash table code will rehash the hash table's contents if it19136 tries to do a lookup on a key in such a table.</p>19149 table key in a hash table that hashes by address (e.g., an EQ 19150 hash table), it sets a bit in the hash table's header. The 19151 hash table code will rehash the hash table's contents if it 19152 tries to do a lookup on a key in such a table.</p> 19137 19153 <p xmlns="http://www.w3.org/1999/xhtml">Profiling reveals that about half of the total time 19138 spent in the GC is spent in the subroutine which determines a19139 pointer's forwarding address. Exploiting GCC-specific idioms,19140 hand-coding the routine, and inlining calls to it could all be19141 expected to improve GC performance.</p>19154 spent in the GC is spent in the subroutine which determines a 19155 pointer's forwarding address. Exploiting GCC-specific idioms, 19156 hand-coding the routine, and inlining calls to it could all be 19157 expected to improve GC performance.</p> 19142 19158 </div> 19143 19159 <div class="sect2" lang="en" xml:lang="en"> … … 19150 19166 </div> 19151 19167 <p xmlns="http://www.w3.org/1999/xhtml">The compact phase compacts the area between the first 19152 unmarked object and the freepointer so that it contains only19153 marked objects. While doing so, it forwards any pointers it19154 finds in the objects it copies.</p>19168 unmarked object and the freepointer so that it contains only 19169 marked objects. While doing so, it forwards any pointers it 19170 finds in the objects it copies.</p> 19155 19171 <p xmlns="http://www.w3.org/1999/xhtml">When the compact phase is finished, so is the GC (more 19156 or less): the free pointer and some other data structures are19157 updated and control returns to the exception handler that19158 invoked the GC. If sufficient memory has been freed to satisfy19159 any allocation request that may have triggered the GC, the19160 exception handler returns; otherwise, a "seriously low on19161 memory" condition is signaled, possibly after releasing a19162 small emergency pool of memory.</p>19163 </div> 19164 <div xmlns=" " class="footnotes">19172 or less): the free pointer and some other data structures are 19173 updated and control returns to the exception handler that 19174 invoked the GC. If sufficient memory has been freed to satisfy 19175 any allocation request that may have triggered the GC, the 19176 exception handler returns; otherwise, a "seriously low on 19177 memory" condition is signaled, possibly after releasing a 19178 small emergency pool of memory.</p> 19179 </div> 19180 <div xmlns="http://www.w3.org/1999/xhtml" class="footnotes"> 19165 19181 <br /> 19166 19182 <hr width="100" align="left" /> 19167 <div xmlns="http://www.w3.org/1999/xhtml"class="footnote">19168 <p><sup>[<a id="ftn.id4 39619" href="#id439619">1</a>] </sup>I believe that the acronym comes from MACLISP,19169 where it stood for "Garbage Collection of Truly19170 Worthless Atoms".</p>19183 <div class="footnote"> 19184 <p><sup>[<a id="ftn.id418468" href="#id418468" class="para">1</a>] </sup>I believe that the acronym comes from MACLISP, 19185 where it stood for "Garbage Collection of Truly 19186 Worthless Atoms".</p> 19171 19187 </div> 19172 19188 </div> … … 19181 19197 </div> 19182 19198 <p xmlns="http://www.w3.org/1999/xhtml">In the Clozure CL memory management scheme, the relative age 19183 of two objects in the dynamic heap can be determined by their19184 addresses: if addresses X and Y are both addresses in the19185 dynamic heap, X is younger than Y (X was created more recently19186 than Y) if it is nearer to the free pointer (and farther from19187 the base of the heap) than Y.</p>19199 of two objects in the dynamic heap can be determined by their 19200 addresses: if addresses X and Y are both addresses in the 19201 dynamic heap, X is younger than Y (X was created more recently 19202 than Y) if it is nearer to the free pointer (and farther from 19203 the base of the heap) than Y.</p> 19188 19204 <p xmlns="http://www.w3.org/1999/xhtml">Ephemeral (or generational) garbage collectors attempt to 19189 exploit the following assumptions:</p>19205 exploit the following assumptions:</p> 19190 19206 <div xmlns="http://www.w3.org/1999/xhtml" class="itemizedlist"> 19191 19207 <ul type="disc"> 19192 19208 <li> 19193 19209 <p>most newly created objects become garbage soon after 19194 they'recreated.</p>19210 they'recreated.</p> 19195 19211 </li> 19196 19212 <li> 19197 19213 <p>most objects that have already survived several GCs 19198 are unlikely to ever become garbage.</p>19214 are unlikely to ever become garbage.</p> 19199 19215 </li> 19200 19216 <li> 19201 19217 <p>old objects can only point to newer objects as the 19202 result of a destructive modification (e.g., via19203 SETF.)</p>19218 result of a destructive modification (e.g., via 19219 SETF.)</p> 19204 19220 </li> 19205 19221 </ul> 19206 19222 </div> 19207 19223 <p xmlns="http://www.w3.org/1999/xhtml">By concentrating its efforts on (frequently and quickly) 19208 reclaiming newly created garbage, an ephemeral collector hopes19209 to postpone the more costly full GC as long as possible. It's19210 important to note that most programs create some long-lived19211 garbage, so an EGC can't typically eliminate the need for full19212 GC.</p>19224 reclaiming newly created garbage, an ephemeral collector hopes 19225 to postpone the more costly full GC as long as possible. It's 19226 important to note that most programs create some long-lived 19227 garbage, so an EGC can't typically eliminate the need for full 19228 GC.</p> 19213 19229 <p xmlns="http://www.w3.org/1999/xhtml">An EGC views each object in the heap as belonging to 19214 exactly one <span class="emphasis"><em>generation</em></span>; generations are19215 sets of objects that are related to each other by age: some19216 generation is the youngest, some the oldest, and there's an age19217 relationship between any intervening generations. Objects are19218 typically assigned to the youngest generation when first19219 allocated; any object that has survived some number of GCs in19220 its current generation is promoted (or19221 <span class="emphasis"><em>tenured</em></span>) into an older generation.</p>19230 exactly one <span class="emphasis"><em>generation</em></span>; generations are 19231 sets of objects that are related to each other by age: some 19232 generation is the youngest, some the oldest, and there's an age 19233 relationship between any intervening generations. Objects are 19234 typically assigned to the youngest generation when first 19235 allocated; any object that has survived some number of GCs in 19236 its current generation is promoted (or 19237 <span class="emphasis"><em>tenured</em></span>) into an older generation.</p> 19222 19238 <p xmlns="http://www.w3.org/1999/xhtml">When a generation is GCed, the roots consist of the 19223 stacks, registers, and global variables as always and also of19224 any pointers to objects in that generation from other19225 generations. To avoid the need to scan those (often large) other19226 generations looking for such intergenerational references, the19227 runtime system must note all such intergenerational references19228 at the point where they're created (via Setf).<sup>[<a id="id528852" href="#ftn.id528852">2</a>]</sup> The19229 set of pointers that may contain intergenerational references is19230 sometimes called <span class="emphasis"><em>the remembered set</em></span>.</p>19239 stacks, registers, and global variables as always and also of 19240 any pointers to objects in that generation from other 19241 generations. To avoid the need to scan those (often large) other 19242 generations looking for such intergenerational references, the 19243 runtime system must note all such intergenerational references 19244 at the point where they're created (via Setf).<sup>[<a id="id418704" href="#ftn.id418704" class="footnote">2</a>]</sup> The 19245 set of pointers that may contain intergenerational references is 19246 sometimes called <span class="emphasis"><em>the remembered set</em></span>.</p> 19231 19247 <p xmlns="http://www.w3.org/1999/xhtml">In Clozure CL's EGC, the heap is organized exactly the same 19232 as otherwise; "generations" are merely structures which contain19233 pointers to regions of the heap (which is already ordered by19234 age.) When a generation needs to be GCed, any younger generation19235 is incorporated into it; all objects which survive a GC of a19236 given generation are promoted into the next older19237 generation. The only intergenerational references that can exist19238 are therefore those where an old object is modified to contain a19239 pointer to a new object.</p>19248 as otherwise; "generations" are merely structures which contain 19249 pointers to regions of the heap (which is already ordered by 19250 age.) When a generation needs to be GCed, any younger generation 19251 is incorporated into it; all objects which survive a GC of a 19252 given generation are promoted into the next older 19253 generation. The only intergenerational references that can exist 19254 are therefore those where an old object is modified to contain a 19255 pointer to a new object.</p> 19240 19256 <p xmlns="http://www.w3.org/1999/xhtml">The EGC uses exactly the same code as the full GC. When a 19241 given GC is "ephemeral",</p>19257 given GC is "ephemeral",</p> 19242 19258 <div xmlns="http://www.w3.org/1999/xhtml" class="itemizedlist"> 19243 19259 <ul type="disc"> 19244 19260 <li> 19245 19261 <p>the "base of the heap" used to determine an object's 19246 markbit address is the base of the generation19247 being collected;</p>19262 markbit address is the base of the generation 19263 being collected;</p> 19248 19264 </li> 19249 19265 <li> 19250 19266 <p>the markbits vector is actually a pointer into the 19251 middle of the global markbits table; preceding entries in19252 this table are used to note doubleword addresses in older19253 generations that (may) contain intergenerational19254 references;</p>19267 middle of the global markbits table; preceding entries in 19268 this table are used to note doubleword addresses in older 19269 generations that (may) contain intergenerational 19270 references;</p> 19255 19271 </li> 19256 19272 <li> 19257 19273 <p>some steps (notably GCTWA and the handling of weak 19258 objects) are not performed;</p>19274 objects) are not performed;</p> 19259 19275 </li> 19260 19276 <li> 19261 19277 <p>the intergenerational references table is used to 19262 find additional roots for the mark and forward phases. If a19263 bit is set inthe intergenerational references table, that19264 means that the corresponding doubleword (in some "old"19265 generation, in some "earlier" part of the heap) may have had19266 a pointer to an object in a younger generation stored into19267 it.</p>19278 find additional roots for the mark and forward phases. If a 19279 bit is set in the intergenerational references table, that 19280 means that the corresponding doubleword (in some "old" 19281 generation, in some "earlier" part of the heap) may have had 19282 a pointer to an object in a younger generation stored into 19283 it.</p> 19268 19284 </li> 19269 19285 </ul> 19270 19286 </div> 19271 19287 <p xmlns="http://www.w3.org/1999/xhtml">With one exception (the implicit setfs that occur on entry 19272 to and exit from the binding of a special variable), all setfs 19273 that might introduce an intergenerational reference must be 19274 memoized.@footnote{Note that the implicit setfs that occur when 19275 initializing an object - as in the case of a call to cons or 19276 vector - can't introduce intergenerational references, since the 19277 newly created object is always younger than the objects used to 19278 initialize it.} It's always safe to push any cons cell or 19279 gvector locative onto the memo stack; it's never safe to push 19280 anything else. 19288 to and exit from the binding of a special variable), all setfs 19289 that might introduce an intergenerational reference must be 19290 memoized. 19291 <sup>[<a id="id418773" href="#ftn.id418773" class="footnote">3</a>]</sup> It's always safe to 19292 push any cons cell or gvector locative onto the memo stack; 19293 it's never safe to push anything else. 19281 19294 </p> 19282 19295 <p xmlns="http://www.w3.org/1999/xhtml">Typically, the intergenerational references bitvector is 19283 sparse: a relatively small number of old locations are stored19284 into, although some of them may have been stored into many19285 times. The routine that scans the memoization buffer does a lot19286 of work and usually does it fairly often; it uses a simple,19287 brute-force method but might run faster if it was smarter about19288 recognizing addresses that it'd already seen.19296 sparse: a relatively small number of old locations are stored 19297 into, although some of them may have been stored into many 19298 times. The routine that scans the memoization buffer does a lot 19299 of work and usually does it fairly often; it uses a simple, 19300 brute-force method but might run faster if it was smarter about 19301 recognizing addresses that it'd already seen. 19289 19302 </p> 19290 19303 <p xmlns="http://www.w3.org/1999/xhtml">When the EGC mark and forward phases scan the 19291 intergenerational reference bits, they can clear any bits that19292 denote doublewords that definitely do not contain19293 intergenerational references.19304 intergenerational reference bits, they can clear any bits that 19305 denote doublewords that definitely do not contain 19306 intergenerational references. 19294 19307 </p> 19295 <div xmlns=" " class="footnotes">19308 <div xmlns="http://www.w3.org/1999/xhtml" class="footnotes"> 19296 19309 <br /> 19297 19310 <hr width="100" align="left" /> 19298 <div xmlns="http://www.w3.org/1999/xhtml" class="footnote"> 19299 <p><sup>[<a id="ftn.id528852" href="#id528852">2</a>] </sup>This is 19300 sometimes called "The Write Barrier": all assignments which 19301 might result in intergenerational references must be noted, as 19302 if the other generations were write-protected.</p> 19311 <div class="footnote"> 19312 <p><sup>[<a id="ftn.id418704" href="#id418704" class="para">2</a>] </sup>This is 19313 sometimes called "The Write Barrier": all assignments which 19314 might result in intergenerational references must be noted, as 19315 if the other generations were write-protected.</p> 19316 </div> 19317 <div class="footnote"> 19318 <p><sup>[<a id="ftn.id418773" href="#id418773" class="para">3</a>] </sup>Note that the implicit setfs that occur when 19319 initializing an object - as in the case of a call to cons or 19320 vector - can't introduce intergenerational references, since 19321 the newly created object is always younger than the objects 19322 used to initialize it.</p> 19303 19323 </div> 19304 19324 </div> … … 19313 19333 </div> 19314 19334 <p xmlns="http://www.w3.org/1999/xhtml">Saving and loading of Fasl files is implemented in 19315 xdump/faslenv.lisp, level-0/nfasload.lisp, and lib/nfcomp.lisp.19316 The information here is only an overview, which might help when19317 reading the source.</p>19335 xdump/faslenv.lisp, level-0/nfasload.lisp, and lib/nfcomp.lisp. 19336 The information here is only an overview, which might help when 19337 reading the source.</p> 19318 19338 <p xmlns="http://www.w3.org/1999/xhtml">The Clozure CL Fasl format is forked from the old MCL Fasl 19319 format; there are a few differences, but they are minor. The19320 name "nfasload" comes from the fact that this is the so-called19321 "new" Fasl system, which was true in 1986 or so. </p>19339 format; there are a few differences, but they are minor. The 19340 name "nfasload" comes from the fact that this is the so-called 19341 "new" Fasl system, which was true in 1986 or so. </p> 19322 19342 <p xmlns="http://www.w3.org/1999/xhtml">A Fasl file begins with a "file header", which contains 19323 version information and a count of the following "blocks".19324 There's typically only one "block" per Fasl file. The blocks19325 are part of a mechanism for combining multiple logical files19326 into a single physical file, in order to simplify the19327 distribution of precompiled programs. </p>19343 version information and a count of the following "blocks". 19344 There's typically only one "block" per Fasl file. The blocks 19345 are part of a mechanism for combining multiple logical files 19346 into a single physical file, in order to simplify the 19347 distribution of precompiled programs. </p> 19328 19348 <p xmlns="http://www.w3.org/1999/xhtml">Each block begins with a header for itself, which just 19329 describes the size of the data that follows.</p>19349 describes the size of the data that follows.</p> 19330 19350 <p xmlns="http://www.w3.org/1999/xhtml">The data in each block is treated as a simple stream of 19331 bytes, which define a bytecode program. The actual bytecodes,19332 "fasl operators", are defined in xdump/faslenv.lisp. The19333 descriptions in the source file are terse, but, according to19334 Gary, "probably accurate".</p>19351 bytes, which define a bytecode program. The actual bytecodes, 19352 "fasl operators", are defined in xdump/faslenv.lisp. The 19353 descriptions in the source file are terse, but, according to 19354 Gary, "probably accurate".</p> 19335 19355 <p xmlns="http://www.w3.org/1999/xhtml">Some of the operators are used to create a per-block 19336 "object table", which is a vector used to keep track of19337 previously-loaded objects and simplify references to them. When19338 the table is created, an index associated with it is set to19339 zero; this is analogous to an array fill-pointer, and allows the19340 table to be treated like a stack.</p>19356 "object table", which is a vector used to keep track of 19357 previously-loaded objects and simplify references to them. When 19358 the table is created, an index associated with it is set to 19359 zero; this is analogous to an array fill-pointer, and allows the 19360 table to be treated like a stack.</p> 19341 19361 <p xmlns="http://www.w3.org/1999/xhtml">The low seven bits of each bytecode are used to specify 19342 the fasl operator; currently, about fifty operators are defined.19343 The high byte, when set, indicates that the result of the19344 operation should be pushed onto the object table.</p>19362 the fasl operator; currently, about fifty operators are defined. 19363 The high byte, when set, indicates that the result of the 19364 operation should be pushed onto the object table.</p> 19345 19365 <p xmlns="http://www.w3.org/1999/xhtml">Most bytecodes are followed by operands; the operand data 19346 is byte-aligned. How many operands there are, and their type,19347 depend on the bytecode. Operands can be indices into the object19348 table, immediate values, or some combination of these.</p>19366 is byte-aligned. How many operands there are, and their type, 19367 depend on the bytecode. Operands can be indices into the object 19368 table, immediate values, or some combination of these.</p> 19349 19369 <p xmlns="http://www.w3.org/1999/xhtml">An exception is the bytecode #xFF, which has the symbolic 19350 name ccl::$faslend; it is used to mark the end of the19351 block.</p>19370 name ccl::$faslend; it is used to mark the end of the 19371 block.</p> 19352 19372 </div> 19353 19373 <div class="sect1" lang="en" xml:lang="en"> … … 19368 19388 </div> 19369 19389 <p xmlns="http://www.w3.org/1999/xhtml">In most cases, pointers to instances of Objective-C 19370 classes are recognized as such; the recognition is (and19371 probably always will be) slightly heuristic. Basically, any19372 pointer that passes basic sanity checks and whose first word19373 is a pointer to a known ObjC class is considered to be an19374 instance of that class; the Objective-C runtime system would19375 reach the same conclusion.</p>19390 classes are recognized as such; the recognition is (and 19391 probably always will be) slightly heuristic. Basically, any 19392 pointer that passes basic sanity checks and whose first word 19393 is a pointer to a known ObjC class is considered to be an 19394 instance of that class; the Objective-C runtime system would 19395 reach the same conclusion.</p> 19376 19396 <p xmlns="http://www.w3.org/1999/xhtml">It's certainly possible that a random pointer to an 19377 arbitrary memory address could look enough like an ObjC19378 instance to fool the lisp runtime system, and it's possible19379 that pointers could have their contents change so that19380 something that had either been a true ObjC instance (or had19381 looked a lot like one) is changed (possibly by virtue of19382 having been deallocated.)</p>19397 arbitrary memory address could look enough like an ObjC 19398 instance to fool the lisp runtime system, and it's possible 19399 that pointers could have their contents change so that 19400 something that had either been a true ObjC instance (or had 19401 looked a lot like one) is changed (possibly by virtue of 19402 having been deallocated.)</p> 19383 19403 <p xmlns="http://www.w3.org/1999/xhtml">In the first case, we can improve the heuristics 19384 substantially: we can make stronger assertions that a19385 particular pointer is really "of type :ID" when it's a19386 parameter to a function declared to take such a pointer as an19387 argument or a similarly declared function result; we can be19388 more confident of something we obtained via SLOT-VALUE of a19389 slot defined to be of type :ID than if we just dug a pointer19390 out of memory somewhere.</p>19404 substantially: we can make stronger assertions that a 19405 particular pointer is really "of type :ID" when it's a 19406 parameter to a function declared to take such a pointer as an 19407 argument or a similarly declared function result; we can be 19408 more confident of something we obtained via SLOT-VALUE of a 19409 slot defined to be of type :ID than if we just dug a pointer 19410 out of memory somewhere.</p> 19391 19411 <p xmlns="http://www.w3.org/1999/xhtml">The second case is a little more subtle: ObjC memory 19392 management is based on a reference-counting scheme, and it's19393 possible for an object to ... cease to be an object while lisp19394 is still referencing it. If we don't want to deal with this19395 possibility (and we don't), we'll basically have to ensure19396 that the object is not deallocated while lisp is still19397 thinking of it as a first-class object. There's some support19398 for this in the case of objects created with MAKE-INSTANCE,19399 but we may need to give similar treatment to foreign objects19400 that are introduced to the lisp runtime in other ways (as19401 function arguments, return values, SLOT-VALUE results, etc. as19402 well as those instances that are created under lisp19403 control.)</p>19412 management is based on a reference-counting scheme, and it's 19413 possible for an object to ... cease to be an object while lisp 19414 is still referencing it. If we don't want to deal with this 19415 possibility (and we don't), we'll basically have to ensure 19416 that the object is not deallocated while lisp is still 19417 thinking of it as a first-class object. There's some support 19418 for this in the case of objects created with MAKE-INSTANCE, 19419 but we may need to give similar treatment to foreign objects 19420 that are introduced to the lisp runtime in other ways (as 19421 function arguments, return values, SLOT-VALUE results, etc. as 19422 well as those instances that are created under lisp 19423 control.)</p> 19404 19424 <p xmlns="http://www.w3.org/1999/xhtml">This doesn't all work yet (in fact, not much of it works 19405 yet); in practice, this has not yet been as much of a problem19406 as anticipated, but that may be because existing Cocoa code19407 deals primarily with relatively long-lived objects such as19408 windows, views, menus, etc.</p>19425 yet); in practice, this has not yet been as much of a problem 19426 as anticipated, but that may be because existing Cocoa code 19427 deals primarily with relatively long-lived objects such as 19428 windows, views, menus, etc.</p> 19409 19429 </div> 19410 19430 <div class="sect2" lang="en" xml:lang="en"> … … 19412 19432 <div> 19413 19433 <div> 19414 <h3 class="title"><a id="id 529071"></a>16.7.2. Recommended Reading</h3>19434 <h3 class="title"><a id="id418917"></a>16.7.2. Recommended Reading</h3> 19415 19435 </div> 19416 19436 </div> … … 19420 19440 <dt> 19421 19441 <span class="term"> 19422 <ahref="http://developer.apple.com/documentation/Cocoa/" target="_top">Cocoa Documentation</a>19423 </span>19442 <a class="ulink" href="http://developer.apple.com/documentation/Cocoa/" target="_top">Cocoa Documentation</a> 19443 </span> 19424 19444 </dt> 19425 19445 <dd> 19426 19446 <p> 19427 This is the top page for all of Apple's documentation on19428 Cocoa. If you are unfamiliar with Cocoa, it is a good19429 place to start.19430 </p>19447 This is the top page for all of Apple's documentation on 19448 Cocoa. If you are unfamiliar with Cocoa, it is a good 19449 place to start. 19450 </p> 19431 19451 </dd> 19432 19452 <dt> 19433 19453 <span class="term"> 19434 <ahref="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/index.html" target="_top">Foundation Reference for Objective-C</a>19435 </span>19454 <a class="ulink" href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/index.html" target="_top">Foundation Reference for Objective-C</a> 19455 </span> 19436 19456 </dt> 19437 19457 <dd> 19438 19458 <p> 19439 This is one of the two most important Cocoa references; it19440 covers all of the basics, except for GUI programming. This is19441 a reference, not a tutorial.19442 </p>19459 This is one of the two most important Cocoa references; it 19460 covers all of the basics, except for GUI programming. This is 19461 a reference, not a tutorial. 19462 </p> 19443 19463 </dd> 19444 19464 </dl> … … 19518 19538 </div> 19519 19539 </div> 19520 <p xmlns="http://www.w3.org/1999/xhtml">As it's distributed, Clozure CL starts up with *PACKAGE* set 19521 t o the CL-USER package and with most predefined functions and19540 <p xmlns="http://www.w3.org/1999/xhtml">As it's distributed, Clozure CL starts up with *PACKAGE* set to 19541 the CL-USER package and with most predefined functions and 19522 19542 methods protected against accidental redefinition. The package 19523 setting is of course a requirement of ANSI CL, whilethe19524 protection protection is intended to catch certain types of19525 programming errors (accidentally redefining a CL or CCL19526 function) before those errors have a chance to do much19527 damage.</p>19528 <p xmlns="http://www.w3.org/1999/xhtml">These settings may make using Clozure CL to develop Clozure CL a 19529 bit more awkward, since much of that process assumes that the19530 CCL package is current (and a primary purpose of that process is19531 to redefine some "predefined, builtin functions".) The standard,19532 "routine" ways of building Clozure CL from sources (see ) -19533 COMPILE-CCL, XCOMPILE-CCL, and XLOAD-LEVEL-0 - bind *PACKAGE* to19534 the "CCL" package and enable the redefinition of predefined19535 functions; the symbols COMPILE-CCL, XCOMPILE-CCL, and19543 setting is of course a requirement of ANSI CL, and the 19544 protection of predifined functions and methods is intended to 19545 catch certain types of programming errors (accidentally 19546 redefining a CL or CCL function) before those errors have a 19547 chance to do much damage.</p> 19548 <p xmlns="http://www.w3.org/1999/xhtml">These settings may make using Clozure CL to develop Clozure CL a bit 19549 awkward, because much of that process assumes you are working in 19550 the CCL package is current, and a primary purpose of Clozure CL 19551 development is to redefine some predefined, builtin functions. 19552 The standard, "routine" ways of building Clozure CL from sources (see 19553 ) - COMPILE-CCL, XCOMPILE-CCL, and XLOAD-LEVEL-0 - bind 19554 *PACKAGE* to the "CCL" package and enable the redefinition of 19555 predefined functions; the symbols COMPILE-CCL, XCOMPILE-CCL, and 19536 19556 XLOAD-LEVEL-0 are additionally now exported from the "CCL" 19537 19557 package.</p> 19538 19558 <p xmlns="http://www.w3.org/1999/xhtml">Some other (more ad-hoc) ways of doing development on 19539 Clozure CL -compiling and/or loading individual files,19540 incrementally redefining individual functions - may be awkward19541 unless one reverts to the mode of operation which was19542 traditionally offered in Clozure CL. (Some Clozure CL source files -19559 Clozure CLâcompiling and/or loading individual files, 19560 incrementally redefining individual functionsâmay be 19561 awkward unless one reverts to the mode of operation which was 19562 traditionally offered in Clozure CL. Some Clozure CL source files - 19543 19563 especially those that comprise the bootstrapping image sources 19544 19564 and the first few files in the "cold load" sequence - are 19545 19565 compiled and loaded in the "CCL" package but don't contain 19546 19566 (IN-PACKAGE "CCL") forms, since IN-PACKAGE doesn't work until 19547 later in the cold load sequence. )</p>19567 later in the cold load sequence.</p> 19548 19568 <p xmlns="http://www.w3.org/1999/xhtml">The somewhat bizarre behavior of both SET-USER-ENVIRONMENT 19549 19569 and SET-DEVELOPMENT-ENVIRONMENT with respect to the special … … 19587 19607 Unhandled exception 11 at 0x300e90c8, context->regs at #x7ffff6b8 19588 19608 Continue/Debugger/eXit <enter>? 19589 </pre>19609 </pre> 19590 19610 <p xmlns="http://www.w3.org/1999/xhtml">As you may have noticed, it's not a perfect world; it's rare 19591 that the cause (attempting to reference the CDR of -1, and therefore19592 accessing unmapped memory near location 0) of this effect (an19593 "Unhandled exception ..." message) is so obvious.</p>19611 that the cause (attempting to reference the CDR of -1, and therefore 19612 accessing unmapped memory near location 0) of this effect (an 19613 "Unhandled exception ..." message) is so obvious.</p> 19594 19614 <p xmlns="http://www.w3.org/1999/xhtml">The addresses printed in the message above aren't very useful 19595 unless you're debugging the kernel with GDB (and they're often19596 very useful if you are.)</p>19615 unless you're debugging the kernel with GDB (and they're often 19616 very useful if you are.)</p> 19597 19617 <p xmlns="http://www.w3.org/1999/xhtml">Aside from causing an exception that the lisp kernel doesn't 19598 know how to handle, one can also enter the kernel debugger (more)19599 deliberately:</p>19618 know how to handle, one can also enter the kernel debugger (more) 19619 deliberately:</p> 19600 19620 <pre xmlns="http://www.w3.org/1999/xhtml" class="programlisting"> 19601 19621 ? (defun classify (n) 19602 (cond ((> n 0) "Greater")19603 ((< n 0) "Less")19604 (t19605 ;;; Sheesh ! What else could it be ?19606 (ccl::bug "I give up. How could this happen ?"))))19622 (cond ((> n 0) "Greater") 19623 ((< n 0) "Less") 19624 (t 19625 ;; Sheesh ! What else could it be ? 19626 (ccl::bug "I give up. How could this happen ?")))) 19607 19627 CLASSIFY 19608 19628 … … 19612 19632 ? for help 19613 19633 [12345] Clozure CL kernel debugger: 19614 </pre>19634 </pre> 19615 19635 <p xmlns="http://www.w3.org/1999/xhtml">CCL::BUG isn't quite the right tool for this example (a 19616 call to BREAK or PRINT might do a better job of clearing up the19617 mystery), but it's sometimes helpful when those other tools19618 can't be used. The lisp error system notices, for instance, if19619 attempts to signal errors themselves cause errors to be19620 signaled; this sort of thing can happen if CLOS or the I/O19621 system are broken or missing. After some small number of19622 recursive errors, the error system gives up and calls19623 CCL::BUG.</p>19636 call to BREAK or PRINT might do a better job of clearing up the 19637 mystery), but it's sometimes helpful when those other tools 19638 can't be used. The lisp error system notices, for instance, if 19639 attempts to signal errors themselves cause errors to be 19640 signaled; this sort of thing can happen if CLOS or the I/O 19641 system are broken or missing. After some small number of 19642 recursive errors, the error system gives up and calls 19643 CCL::BUG.</p> 19624 19644 <p xmlns="http://www.w3.org/1999/xhtml">If one enters a '?' at the kernel debugger prompt, one 19625 will see output like:</p>19645 will see output like:</p> 19626 19646 <pre xmlns="http://www.w3.org/1999/xhtml" class="programlisting"> 19627 19647 (S) Find and describe symbol matching specified name … … 19630 19650 (K) Kill Clozure CL process 19631 19651 (?) Show this help 19632 </pre>19652 </pre> 19633 19653 <p xmlns="http://www.w3.org/1999/xhtml">CCL::BUG just does an FF-CALL into the lisp kernel. If 19634 the kernel debugger was invoked because of an unhandled19635 exception (such as an illegal memory reference) the OS kernel19636 saves the machine state ("context") in a data structure for us,19637 and in that case some additional options can be used to display19638 the contents of the registers at the point of the19639 exception. Another function - CCL::DBG -causes a special19640 exception to be generated and enters the lisp kernel debugger19641 with a non-null "context":</p>19654 the kernel debugger was invoked because of an unhandled 19655 exception (such as an illegal memory reference) the OS kernel 19656 saves the machine state ("context") in a data structure for us, 19657 and in that case some additional options can be used to display 19658 the contents of the registers at the point of the 19659 exception. Another functionâCCL::DBGâcauses a special 19660 exception to be generated and enters the lisp kernel debugger 19661 with a non-null "context":</p> 19642 19662 <pre xmlns="http://www.w3.org/1999/xhtml" class="programlisting"> 19643 19663 ? (defun classify2 (n) 19644 (cond ((> n 0) "Greater")19645 ((< n 0) "Less")19646 (t (dbg n))))19664 (cond ((> n 0) "Greater") 19665 ((< n 0) "Less") 19666 (t (dbg n)))) 19647 19667 CLASSIFY2 19648 19668 19649 19669 ? (classify2 0) 19650 19670 Lisp Breakpoint 19651 While executing: #<Function CLASSIFY2 #x08476cfe>19671 While executing: #<Function CLASSIFY2 #x08476cfe> 19652 19672 ? for help 19653 19673 [12345] Clozure CL kernel debugger: ? … … 19664 19684 (K) Kill Clozure CL process 19665 19685 (?) Show this help 19666 </pre>19686 </pre> 19667 19687 <p xmlns="http://www.w3.org/1999/xhtml">CCL::DBG takes an argument, whose value is copied into the register 19668 that Clozure CL uses to return a function's primary value (arg_z, which19669 is r23 on the PowerPC). If we were to choose the (L) option at this point,19670 we'd see a dislay like:</p>19688 that Clozure CL uses to return a function's primary value (arg_z, which 19689 is r23 on the PowerPC). If we were to choose the (L) option at this point, 19690 we'd see a dislay like:</p> 19671 19691 <pre xmlns="http://www.w3.org/1999/xhtml" class="programlisting"> 19672 19692 rnil = 0x01836015 … … 19688 19708 r25 (save6) = () 19689 19709 r24 (save7) = () 19690 </pre>19710 </pre> 19691 19711 <p xmlns="http://www.w3.org/1999/xhtml">From this we can conclude that the problematic argument to CLASSIFY2 19692 was 0 (see r23/arg_z), and that I need to work on a better example.</p>19712 was 0 (see r23/arg_z), and that I need to work on a better example.</p> 19693 19713 <p xmlns="http://www.w3.org/1999/xhtml">The R option shows the values of the ALU (and PPC branch unit) 19694 registers in hex; the F option shows the values of the FPU registers.</p>19714 registers in hex; the F option shows the values of the FPU registers.</p> 19695 19715 <p xmlns="http://www.w3.org/1999/xhtml">The (B) option shows a raw stack backtrace; it'll try to 19696 identify foreign functions as well as lisp functions. (Foreign function19697 names are guesses based on the nearest preceding exported symbol.)</p>19716 identify foreign functions as well as lisp functions. (Foreign function 19717 names are guesses based on the nearest preceding exported symbol.)</p> 19698 19718 <p xmlns="http://www.w3.org/1999/xhtml">If you ever unexpectedly find yourself in the "lisp kernel 19699 debugger", the output of the (L) and (B) options are often the most19700 helpful things to include in a bug report.</p>19719 debugger", the output of the (L) and (B) options are often the most 19720 helpful things to include in a bug report.</p> 19701 19721 </div> 19702 19722 <div class="sect1" lang="en" xml:lang="en"> … … 19717 19737 </div> 19718 19738 <p xmlns="http://www.w3.org/1999/xhtml">It's now possible to use AltiVec instructions in PPC LAP 19719 (assembler) functions.</p>19739 (assembler) functions.</p> 19720 19740 <p xmlns="http://www.w3.org/1999/xhtml">The lisp kernel detects the presence or absence of 19721 AltiVec and preserves AltiVec state on lisp thread switch and19722 in response to exceptions, but the implementation doesn't19723 otherwise use vector operations.</p>19741 AltiVec and preserves AltiVec state on lisp thread switch and 19742 in response to exceptions, but the implementation doesn't 19743 otherwise use vector operations.</p> 19724 19744 <p xmlns="http://www.w3.org/1999/xhtml">This document doesn't document PPC LAP programming in 19725 general. Ideally, there would be some document that19726 did.</p>19745 general. Ideally, there would be some document that 19746 did.</p> 19727 19747 <p xmlns="http://www.w3.org/1999/xhtml">This document does explain AltiVec register-usage 19728 conventions in Clozure CL and explains the use of some lap macros19729 that help to enforce those conventions.</p>19748 conventions in Clozure CL and explains the use of some lap macros 19749 that help to enforce those conventions.</p> 19730 19750 <p xmlns="http://www.w3.org/1999/xhtml">All of the global symbols described below are exported 19731 from the CCL package. Note that lap macro names, ppc19732 instruction names, and (in most cases) register names are19733 treated as strings, so this only applies to functions and19734 global variable names.</p>19751 from the CCL package. Note that lap macro names, ppc 19752 instruction names, and (in most cases) register names are 19753 treated as strings, so this only applies to functions and 19754 global variable names.</p> 19735 19755 <p xmlns="http://www.w3.org/1999/xhtml">Much of the Clozure CL support for AltiVec LAP programming 19736 is based on work contributed to MCL by Shannon Spires.</p>19756 is based on work contributed to MCL by Shannon Spires.</p> 19737 19757 </div> 19738 19758 <div class="sect2" lang="en" xml:lang="en"> … … 19745 19765 </div> 19746 19766 <p xmlns="http://www.w3.org/1999/xhtml">Clozure CL LAP functions that use AltiVec instructions must 19747 interoperate with each other and with C functions; that19748 suggests that they follow C AltiVec register usage19749 conventions. (vr0-vr1 scratch, vr2-vr13 parameters/return19750 value, vr14-vr19 temporaries, vr20-vr31 callee-save19751 non-volatile registers.)</p>19767 interoperate with each other and with C functions; that fact 19768 suggests that they follow C AltiVec register usage 19769 conventions. (vr0-vr1 scratch, vr2-vr13 parameters/return 19770 value, vr14-vr19 temporaries, vr20-vr31 callee-save 19771 non-volatile registers.)</p> 19752 19772 <p xmlns="http://www.w3.org/1999/xhtml">The EABI (Embedded Application Binary Interface) used in 19753 LinuxPPC doesn't ascribe particular significance to the vrsave19754 special-purpose register; on other platforms (notably MacOS),19755 it's used as a bitmap which indicates to system-level code19756 which vector registers contain meaningful values.</p>19757 <p xmlns="http://www.w3.org/1999/xhtml">The WITH-ALTIVEC-REGISTERS lap macro generates code which19758 which saves, updates, and restores VRSAVE on platforms where19759 this is required (as indicated by the value of the special19760 variable which controls this) and ignores VRSAVE on platforms19761 that don't require it to be maintained.</p>19773 LinuxPPC doesn't ascribe particular significance to the vrsave 19774 special-purpose register; on other platforms (notably MacOS), 19775 it's used as a bitmap which indicates to system-level code 19776 which vector registers contain meaningful values.</p> 19777 <p xmlns="http://www.w3.org/1999/xhtml">The WITH-ALTIVEC-REGISTERS lap macro generates code that 19778 saves, updates, and restores VRSAVE on platforms where this is 19779 required (as indicated by the value of the special variable 19780 that controls this behavior) and ignores VRSAVE on platforms 19781 that don't require it to be maintained.</p> 19762 19782 <p xmlns="http://www.w3.org/1999/xhtml">On all PPC platforms, it's necessary to save any non-volatile 19763 vector registers (vr20 .. vr31) before assigning to them and to restore 19764 such registers before returning to the caller.</p> 19765 <p xmlns="http://www.w3.org/1999/xhtml">On platforms that require that VRSAVE be maintained, it's not 19766 necessary to mention the "use" of vector registers that are 19767 used as incoming parameters. It's not incorrect to mention their use 19768 in a WITH-ALTIVEC-REGISTERS form, but it may be unnecessary in many 19769 interesting cases. One can likewise assume that the caller of any function 19770 that returns a vector value (in vr2 has already set the appropriate bit in 19771 VRSAVE to indicate that this register is live. One could therefore write a 19772 leaf function that added the bytes in vr3 and vr2 and returned the result 19773 in vr2 as:</p> 19783 vector registers (vr20 .. vr31) before assigning to them and to restore 19784 such registers before returning to the caller.</p> 19785 <p xmlns="http://www.w3.org/1999/xhtml">On platforms that require that VRSAVE be maintained, it's 19786 not necessary to mention the "use" of vector registers that 19787 are used as incoming parameters. It's not incorrect to mention 19788 their use in a WITH-ALTIVEC-REGISTERS form, but it may be 19789 unnecessary in many interesting cases. One can likewise assume 19790 that the caller of any function that returns a vector value in 19791 vr2 has already set the appropriate bit in VRSAVE to indicate 19792 that this register is live. One could therefore write a leaf 19793 function that added the bytes in vr3 and vr2 and returned the 19794 result in vr2 as:</p> 19774 19795 <pre xmlns="http://www.w3.org/1999/xhtml" class="programlisting"> 19775 19796 (defppclapfunction vaddubs ((y vr3) (z vr2)) 19776 19797 (vaddubs z y z) 19777 19798 (blr)) 19778 </pre>19799 </pre> 19779 19800 <p xmlns="http://www.w3.org/1999/xhtml">When vector registers that aren't incoming parameters are used 19780 in a LAP function, WITH-ALTIVEC-REGISTERS takes care of maintaining VRSAVE19781 and of saving/restoring any non-volatile vector registers:</p>19801 in a LAP function, WITH-ALTIVEC-REGISTERS takes care of maintaining VRSAVE 19802 and of saving/restoring any non-volatile vector registers:</p> 19782 19803 <pre xmlns="http://www.w3.org/1999/xhtml" class="programlisting"> 19783 19804 (defppclapfunction load-array ((n arg_z)) … … 19785 19806 (with-altivec-registers (vr1 vr2 vr3 vr27) ; Clobbers imm0 19786 19807 (li imm0 arch::misc-data-offset) 19787 (lvx vr1 arg_z imm0) ; load MSQ19788 (lvsl vr27 arg_z imm0) ; set the permute vector19789 (addi imm0 imm0 16) ; address of LSQ19790 (lvx vr2 arg_z imm0) ; load LSQ19791 (vperm vr3 vr1 vr2 vr27) ; aligned result appears in VR319792 (dbg t)) ; Look at result in some debugger19808 (lvx vr1 arg_z imm0) ; load MSQ 19809 (lvsl vr27 arg_z imm0) ; set the permute vector 19810 (addi imm0 imm0 16) ; address of LSQ 19811 (lvx vr2 arg_z imm0) ; load LSQ 19812 (vperm vr3 vr1 vr2 vr27) ; aligned result appears in VR3 19813 (dbg t)) ; Look at result in some debugger 19793 19814 (blr)) 19794 </pre>19815 </pre> 19795 19816 <p xmlns="http://www.w3.org/1999/xhtml">AltiVec registers are not preserved by CATCH and UNWIND-PROTECT. 19796 Since AltiVec is only accessible from LAP in Clozure CL and since LAP 19797 functions rarely use high- level control structures, this should rarely be 19798 a problem in practice.</p> 19799 <p xmlns="http://www.w3.org/1999/xhtml">LAP functions which use non-volatile vector registers and which call 19800 (Lisp ?) code which may use CATCH or UNWIND-PROTECT should save those 19801 vector registers before such a call and restore them on return. This is 19802 one of the intended uses of the WITH-VECTOR-BUFFER lap macro.</p> 19817 Since AltiVec is only accessible from LAP in Clozure CL and since LAP 19818 functions rarely use high-level control structures, this should rarely be 19819 a problem in practice.</p> 19820 <p xmlns="http://www.w3.org/1999/xhtml">LAP functions that use non-volatile vector registers and 19821 that call (Lisp ?) code which may use CATCH or UNWIND-PROTECT 19822 should save those vector registers before such a call and 19823 restore them on return. This is one of the intended uses of 19824 the WITH-VECTOR-BUFFER lap macro.</p> 19803 19825 </div> 19804 19826 </div> … … 19823 19845 <div> 19824 19846 <div class="refsect1" lang="en" xml:lang="en"> 19825 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 69310"></a>19847 <a xmlns="http://www.w3.org/1999/xhtml" id="id424347"></a> 19826 19848 <div class="header">Description:</div> 19827 19849 <p xmlns="http://www.w3.org/1999/xhtml">When true, attempts to redefine (via DEFUN or DEFMETHOD) 19828 functions and methods that are marked as being19829 "predefined" signal continuable errors.</p>19850 functions and methods that are marked as being 19851 "predefined" signal continuable errors.</p> 19830 19852 <p xmlns="http://www.w3.org/1999/xhtml">Note that these are CERRORs, not warnings, and that 19831 no lisp functions or methods have been defined in the kernel19832 in MCL or Clozure CL since 1987 or so.</p>19853 no lisp functions or methods have been defined in the kernel 19854 in MCL or Clozure CL since 1987 or so.</p> 19833 19855 </div> 19834 19856 </div> … … 19839 19861 <strong>[Function]</strong> 19840 19862 <br></br> 19841 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">set-development-environment</strong></span>19842 <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&optional</em>19843 unmark-builtin-functions</code>19863 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>set-development-environment</strong></span> 19864 <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&optional</em> 19865 unmark-builtin-functions</code> 19844 19866 </div> 19845 19867 <div class="refentrytitle"></div> … … 19848 19870 <div> 19849 19871 <div class="refsect1" lang="en" xml:lang="en"> 19850 <a xmlns="http://www.w3.org/1999/xhtml" id="id 528030"></a>19872 <a xmlns="http://www.w3.org/1999/xhtml" id="id408862"></a> 19851 19873 <div class="header">Description:</div> 19852 19874 <p xmlns="http://www.w3.org/1999/xhtml">Arranges that the outermost special bindings of *PACKAGE* 19853 and *WARN-IF-REDEFINE-KERNEL* restore values of the "CCL"19854 package and NIL to these variables, respectively. If the optional19855 argument is true, marks all globally defined functions and methods19856 as being "not predefined" (this is a fairly expensive19857 operation.)</p>19875 and *WARN-IF-REDEFINE-KERNEL* restore values of the "CCL" 19876 package and NIL to these variables, respectively. If the optional 19877 argument is true, marks all globally defined functions and methods 19878 as being "not predefined" (this is a fairly expensive 19879 operation.)</p> 19858 19880 </div> 19859 19881 </div> … … 19864 19886 <strong>[Function]</strong> 19865 19887 <br></br> 19866 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">set-user-environment</strong></span>19867 <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&optional</em> mark-builtin-functions</code>19888 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>set-user-environment</strong></span> 19889 <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&optional</em> mark-builtin-functions</code> 19868 19890 </div> 19869 19891 <div class="refentrytitle"></div> … … 19872 19894 <div> 19873 19895 <div class="refsect1" lang="en" xml:lang="en"> 19874 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 26372"></a>19896 <a xmlns="http://www.w3.org/1999/xhtml" id="id417395"></a> 19875 19897 <div class="header">Description:</div> 19876 19898 <p xmlns="http://www.w3.org/1999/xhtml">Arranges that the outermost special bindings of *PACKAGE* 19877 and *WARN-IF-REDEFINE-KERNEL* restore values of the19878 "CL-USER" package and T to these variables, respectively.19879 If the optional argument is true, marks all globally defined19880 functions and methods as being "predefined" (this is a19881 fairly expensive operation.)</p>19899 and *WARN-IF-REDEFINE-KERNEL* restore values of the 19900 "CL-USER" package and T to these variables, respectively. 19901 If the optional argument is true, marks all globally defined 19902 functions and methods as being "predefined" (this is a 19903 fairly expensive operation.)</p> 19882 19904 </div> 19883 19905 </div> … … 19895 19917 <div> 19896 19918 <div class="refsect1" lang="en" xml:lang="en"> 19897 <a xmlns="http://www.w3.org/1999/xhtml" id="id 518558"></a>19919 <a xmlns="http://www.w3.org/1999/xhtml" id="id417440"></a> 19898 19920 <div class="header">Description:</div> 19899 19921 <p xmlns="http://www.w3.org/1999/xhtml">This variable is initialized each time an Clozure CL session 19900 starts based on information provided by the lisp kernel. Its value19901 is true if AltiVec is present and false otherwise. This variable19902 shouldn't be set by user code.</p>19922 starts based on information provided by the lisp kernel. Its value 19923 is true if AltiVec is present and false otherwise. This variable 19924 shouldn't be set by user code.</p> 19903 19925 </div> 19904 19926 </div> … … 19910 19932 <br></br> 19911 19933 <code> 19912 <span xmlns="http://www.w3.org/1999/xhtml" >19913 <strong class="function">altivec-available-p</strong>19934 <span xmlns="http://www.w3.org/1999/xhtml" class="function"> 19935 <strong>altivec-available-p</strong> 19914 19936 </span> 19915 19937 </code> … … 19920 19942 <div> 19921 19943 <div class="refsect1" lang="en" xml:lang="en"> 19922 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 29384"></a>19944 <a xmlns="http://www.w3.org/1999/xhtml" id="id417498"></a> 19923 19945 <div class="header">Description:</div> 19924 19946 <p xmlns="http://www.w3.org/1999/xhtml">Returns non-NIL if AltiVec is available.</p> … … 19938 19960 <div> 19939 19961 <div class="refsect1" lang="en" xml:lang="en"> 19940 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 90739"></a>19962 <a xmlns="http://www.w3.org/1999/xhtml" id="id417641"></a> 19941 19963 <div class="header">Description:</div> 19942 19964 <p xmlns="http://www.w3.org/1999/xhtml">Intended to control the expansion of certain lap macros. 19943 Initialized to NIL on LinuxPPC; initialized to T on platforms19944 (such as MacOS X/Darwin) that require that the VRSAVE SPR contain19945 a bitmask of active vector registers at all times.</p>19965 Initialized to NIL on LinuxPPC; initialized to T on platforms 19966 (such as MacOS X/Darwin) that require that the VRSAVE SPR contain 19967 a bitmask of active vector registers at all times.</p> 19946 19968 </div> 19947 19969 </div> … … 19952 19974 <strong>[LAP Macro]</strong> 19953 19975 <br></br> 19954 <code><span xmlns="http://www.w3.org/1999/xhtml" ><strong class="function">with-altivec-registers</strong></span>19955 reglist <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&body</em> body</code>19976 <code><span xmlns="http://www.w3.org/1999/xhtml" class="function"><strong>with-altivec-registers</strong></span> 19977 reglist <em xmlns="http://www.w3.org/1999/xhtml" class="varname">&body</em> body</code> 19956 19978 </div> 19957 19979 <div class="refentrytitle"></div> … … 19960 19982 <div> 19961 19983 <div class="refsect1" lang="en" xml:lang="en"> 19962 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 30110"></a>19984 <a xmlns="http://www.w3.org/1999/xhtml" id="id417705"></a> 19963 19985 <div class="header">Arguments and Values:</div> 19964 19986 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">reglist</span></i>---A list of vector register names (vr0 .. vr31).</p> … … 19966 19988 </div> 19967 19989 <div class="refsect1" lang="en" xml:lang="en"> 19968 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 70124"></a>19990 <a xmlns="http://www.w3.org/1999/xhtml" id="id417746"></a> 19969 19991 <div class="header">Description:</div> 19970 19992 <p xmlns="http://www.w3.org/1999/xhtml">Specifies the set of AltiVec registers used in body. If 19971 *altivec-lapmacros-maintain-vrsave-p* is true when the macro is19972 expanded, generates code to save the VRSAVE SPR and updates VRSAVE19973 to include a bitmask generated from the specified register list.19974 Generates code which saves any non-volatile vector registers which19975 appear in the register list, executes body, and restores the saved19976 non-volatile vector registers (and, if19977 *altivec-lapmacros-maintain-vrsave-p* is true, restores VRSAVE as19978 well. Uses the IMM0 register (r3) as a temporary.</p>19993 *altivec-lapmacros-maintain-vrsave-p* is true when the macro is 19994 expanded, generates code to save the VRSAVE SPR and updates VRSAVE 19995 to include a bitmask generated from the specified register list. 19996 Generates code which saves any non-volatile vector registers which 19997 appear in the register list, executes body, and restores the saved 19998 non-volatile vector registers (and, if 19999 *altivec-lapmacros-maintain-vrsave-p* is true, restores VRSAVE as 20000 well. Uses the IMM0 register (r3) as a temporary.</p> 19979 20001 </div> 19980 20002 </div> … … 19992 20014 <div> 19993 20015 <div class="refsect1" lang="en" xml:lang="en"> 19994 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 70977"></a>20016 <a xmlns="http://www.w3.org/1999/xhtml" id="id427200"></a> 19995 20017 <div class="header">Arguments and Values:</div> 19996 20018 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">base</span></i>---Any available general-purpose register.</p> 19997 20019 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">n</span></i>---An integer between 1 and 254, inclusive. (Should 19998 typically be much, much closer to 1.) Specifies the size of19999 the buffer, in 16-byte units.</p>20020 typically be much, much closer to 1.) Specifies the size of 20021 the buffer, in 16-byte units.</p> 20000 20022 <p><i><span xmlns="http://www.w3.org/1999/xhtml" class="term">body</span></i>---A sequence of PPC LAP instructions.</p> 20001 20023 </div> 20002 20024 <div class="refsect1" lang="en" xml:lang="en"> 20003 <a xmlns="http://www.w3.org/1999/xhtml" id="id4 49788"></a>20025 <a xmlns="http://www.w3.org/1999/xhtml" id="id427258"></a> 20004 20026 <div class="header">Description:</div> 20005 20027 <p xmlns="http://www.w3.org/1999/xhtml">Generates code which allocates a 16-byte aligned buffer 20006 large enough to contain N vector registers; the GPR base points to20007 the lowest address of this buffer. After processing body, the20008 buffer will be deallocated. The body should preserve the value of20009 base as long as it needs to reference the buffer. It's20010 intended that base be used as a base register in stvx and lvx20011 instructions within the body.</p>20028 large enough to contain N vector registers; the GPR base points to 20029 the lowest address of this buffer. After processing body, the 20030 buffer will be deallocated. The body should preserve the value of 20031 base as long as it needs to reference the buffer. It's 20032 intended that base be used as a base register in stvx and lvx 20033 instructions within the body.</p> 20012 20034 </div> 20013 20035 </div> … … 20030 20052 <p>A specially-structured directory that Mac OS X 20031 20053 recognizes as a 20032 launchable <a href="#Cocoa"><em class="glossterm">Cocoa</em></a>20054 launchable <a class="glossterm" href="#Cocoa"><em class="glossterm">Cocoa</em></a> 20033 20055 application. Graphical applications on Mac OS X are 20034 20056 represented as application bundles.</p> … … 20082 20104 features to Emacs. Hemlock was originally developed as part of 20083 20105 CMU Common Lisp. A portable version of Hemlock is built into 20084 the Clozure CL <a href="#IDE"><em class="glossterm">IDE</em></a>.</p>20106 the Clozure CL <a class="glossterm" href="#IDE"><em class="glossterm">IDE</em></a>.</p> 20085 20107 </dd> 20086 20108 </dl> … … 20092 20114 <dd> 20093 20115 <p>"Integrated Development Environment". In the context of 20094 Clozure CL, "the IDE" refers to the experimental <a href="#Cocoa"><em class="glossterm">Cocoa</em></a>20116 Clozure CL, "the IDE" refers to the experimental <a class="glossterm" href="#Cocoa"><em class="glossterm">Cocoa</em></a> 20095 20117 windowing development environment provided in source form with 20096 20118 Clozure CL distributions.</p> … … 20102 20124 containing archived versions of these data in a format that 20103 20125 can be loaded and reconstituted by the 20104 Lisp <a href="#lisp_kernel"><em class="glossterm">kernel</em></a>. A20126 Lisp <a class="glossterm" href="#lisp_kernel"><em class="glossterm">kernel</em></a>. A 20105 20127 working Clozure CL system consists of the kernel and 20106 an <a href="#lisp_image"><em class="glossterm">image</em></a>.</p>20128 an <a class="glossterm" href="#lisp_image"><em class="glossterm">image</em></a>.</p> 20107 20129 </dd> 20108 20130 <dt><a id="InterfaceBuilder"></a>InterfaceBuilder</dt> … … 20110 20132 <p>An application supplied by Apple with their developer 20111 20133 tools that can be used to interactively build user-interface 20112 elements for <a href="#Cocoa"><em class="glossterm">Cocoa</em></a>20134 elements for <a class="glossterm" href="#Cocoa"><em class="glossterm">Cocoa</em></a> 20113 20135 applications.</p> 20114 20136 </dd> … … 20123 20145 levels of the Lisp system. A working Clozure CL system consists of 20124 20146 the kernel and 20125 an <a href="#lisp_image"><em class="glossterm">image</em></a>.</p>20147 an <a class="glossterm" href="#lisp_image"><em class="glossterm">image</em></a>.</p> 20126 20148 </dd> 20127 20149 </dl> … … 20132 20154 <dt><a id="listener_window"></a>listener window</dt> 20133 20155 <dd> 20134 <p>In the <a href="#IDE"><em class="glossterm">IDE</em></a>,20135 a <a href="#Cocoa"><em class="glossterm">Cocoa</em></a>20156 <p>In the <a class="glossterm" href="#IDE"><em class="glossterm">IDE</em></a>, 20157 a <a class="glossterm" href="#Cocoa"><em class="glossterm">Cocoa</em></a> 20136 20158 window that contains a pseudo-terminal session that 20137 communicates with a Lisp <a href="#REPL"><em class="glossterm">REPL</em></a>.</p>20159 communicates with a Lisp <a class="glossterm" href="#REPL"><em class="glossterm">REPL</em></a>.</p> 20138 20160 </dd> 20139 20161 </dl> … … 20161 20183 <dd> 20162 20184 <p>A data file created by 20163 Apple's <a href="#InterfaceBuilder"><em class="glossterm">InterfaceBuilder</em></a>20185 Apple's <a class="glossterm" href="#InterfaceBuilder"><em class="glossterm">InterfaceBuilder</em></a> 20164 20186 application, which contains archived Objective-C objects that 20165 20187 define user-interface elements for 20166 a <a href="#Cocoa"><em class="glossterm">Cocoa</em></a>20188 a <a class="glossterm" href="#Cocoa"><em class="glossterm">Cocoa</em></a> 20167 20189 application. Under Mac OS 20168 X, <a href="#Cocoa"><em class="glossterm">Cocoa</em></a> applications20190 X, <a class="glossterm" href="#Cocoa"><em class="glossterm">Cocoa</em></a> applications 20169 20191 typically create their user interface elements by reading 20170 20192 nibfiles and unarchiving the objects in them.</p> … … 20218 20240 <p>The function executed by Lisp automatically once its 20219 20241 startup is complete. Clozure CL's default toplevel is the 20220 interactive <a href="#REPL"><em class="glossterm">read-eval-print20242 interactive <a class="glossterm" href="#REPL"><em class="glossterm">read-eval-print 20221 20243 loop</em></a> that you normally use to interact with 20222 20244 Lisp. You can, however, replace the toplevel with a function … … 20229 20251 be symbols (such as <code class="code">CONS</code> 20230 20252 and <code class="code">STRING</code>), or they may be more complex 20231 <a href="#s-expression"><em class="glossterm">S-expressions</em></a>20253 <a class="glossterm" href="#s-expression"><em class="glossterm">S-expressions</em></a> 20232 20254 (such as (UNSIGNED-BYTE 8)).</p> 20233 20255 </dd> … … 20247 20269 <h3>Symbols</h3> 20248 20270 <dl> 20249 <dt>#$, <a href="#rm_sharpsign-dollarsign">Reader Macro #$</a></dt>20250 <dt>#&, <a href="#rm_sharpsign-ampersand">Reader Macro #&</a></dt>20251 <dt>#/, <a href="#rm_sharpsign-slash">Reader Macro #/</a></dt>20252 <dt>#>, <a href="#rm_sharpsign-greaterthan">Reader Macro #></a></dt>20253 <dt>#_, <a href="#rm_sharpsign-underscore">Reader Macro #_</a></dt>20254 <dt>%ff-call, <a href="#f_Pff-call">Function %FF-CALL</a></dt>20255 <dt>%reference-external-entry-point, <a href="#f_Preference-external-entry-point">Function %REFERENCE-EXTERNAL-ENTRY-POINT</a></dt>20256 <dt>*alternate-line-terminator*, <a href="#v_alternate-line-terminator">Variable CCL:*ALTERNATE-LINE-TERMINATOR*</a></dt>20257 <dt>*altivec-available*, <a href="#v_altivec-available">Variable *ALTIVEC-AVAILABLE*</a></dt>20258 <dt>*altivec-lapmacros-maintain-vrsave-p*, <a href="#v_altivec-lapmacros-maintain-vrsave-p">Variable *ALTIVEC-LAPMACROS-MAINTAIN-VRSAVE-P*</a></dt>20259 <dt>*current-process*, <a href="#v_current-process">Variable *CURRENT-PROCESS*</a></dt>20260 <dt>*default-external-format*, <a href="#v_default-external-format">Variable CCL:*DEFAULT-EXTERNAL-FORMAT*</a></dt>20261 <dt>*ticks-per-second*, <a href="#v_ticks-per-second">Variable *TICKS-PER-SECOND*</a></dt>20262 <dt>*warn-if-redefine-kernel, <a href="#v_warn-if-redefine-kernel">Variable *WARN-IF-REDEFINE-KERNEL*</a></dt>20263 <dt>+NULL-PTR+, <a href="#Saving-Applications">Saving Applications</a></dt>20264 <dt>:external-format, <a href="#k_external-format">Keyword Argument :EXTERNAL-FORMAT</a></dt>20265 <dt>:y, <a href="#cmd_y">Toplevel Command :Y</a></dt>20266 <dt>@class, <a href="#m_class">Macro CCL::@CLASS</a></dt>20267 <dt>@selector, <a href="#m_selector">Macro CCL::@SELECTOR</a></dt>20268 <dt>[fn-name], <a href="#f_describe-character-encodings">Function DESCRIBE-CHARACTER-ENCODINGS</a></dt>20271 <dt>#$, <a class="indexterm" href="#rm_sharpsign-dollarsign">Reader Macro #$</a></dt> 20272 <dt>#&, <a class="indexterm" href="#rm_sharpsign-ampersand">Reader Macro #&</a></dt> 20273 <dt>#/, <a class="indexterm" href="#rm_sharpsign-slash">Reader Macro #/</a></dt> 20274 <dt>#>, <a class="indexterm" href="#rm_sharpsign-greaterthan">Reader Macro #></a></dt> 20275 <dt>#_, <a class="indexterm" href="#rm_sharpsign-underscore">Reader Macro #_</a></dt> 20276 <dt>%ff-call, <a class="indexterm" href="#f_Pff-call">Function %FF-CALL</a></dt> 20277 <dt>%reference-external-entry-point, <a class="indexterm" href="#f_Preference-external-entry-point">Function %REFERENCE-EXTERNAL-ENTRY-POINT</a></dt> 20278 <dt>*alternate-line-terminator*, <a class="indexterm" href="#v_alternate-line-terminator">Variable CCL:*ALTERNATE-LINE-TERMINATOR*</a></dt> 20279 <dt>*altivec-available*, <a class="indexterm" href="#v_altivec-available">Variable *ALTIVEC-AVAILABLE*</a></dt> 20280 <dt>*altivec-lapmacros-maintain-vrsave-p*, <a class="indexterm" href="#v_altivec-lapmacros-maintain-vrsave-p">Variable *ALTIVEC-LAPMACROS-MAINTAIN-VRSAVE-P*</a></dt> 20281 <dt>*current-process*, <a class="indexterm" href="#v_current-process">Variable *CURRENT-PROCESS*</a></dt> 20282 <dt>*default-external-format*, <a class="indexterm" href="#v_default-external-format">Variable CCL:*DEFAULT-EXTERNAL-FORMAT*</a></dt> 20283 <dt>*ticks-per-second*, <a class="indexterm" href="#v_ticks-per-second">Variable *TICKS-PER-SECOND*</a></dt> 20284 <dt>*warn-if-redefine-kernel, <a class="indexterm" href="#v_warn-if-redefine-kernel">Variable *WARN-IF-REDEFINE-KERNEL*</a></dt> 20285 <dt>+NULL-PTR+, <a class="indexterm" href="#Saving-Applications">Saving Applications</a></dt> 20286 <dt>:external-format, <a class="indexterm" href="#k_external-format">Keyword Argument :EXTERNAL-FORMAT</a></dt> 20287 <dt>:y, <a class="indexterm" href="#cmd_y">Toplevel Command :Y</a></dt> 20288 <dt>@class, <a class="indexterm" href="#m_class">Macro CCL::@CLASS</a></dt> 20289 <dt>@selector, <a class="indexterm" href="#m_selector">Macro CCL::@SELECTOR</a></dt> 20290 <dt>[fn-name], <a class="indexterm" href="#f_describe-character-encodings">Function DESCRIBE-CHARACTER-ENCODINGS</a></dt> 20269 20291 </dl> 20270 20292 </div> … … 20272 20294 <h3></h3> 20273 20295 <dl> 20274 <dt>, <a href="#trace">Trace</a>, <a href="#map-file-to-ivector">Memory-mapped Files</a>, <a href="#defstatic">Static Variables</a>, <a href="#save-application">Saving Applications</a>, <ahref="#build-application">The Application Builder</a></dt>20296 <dt>, <a class="indexterm" href="#trace">Trace</a>, <a class="indexterm" href="#map-file-to-ivector">Memory-mapped Files</a>, <a class="indexterm" href="#defstatic">Static Variables</a>, <a class="indexterm" href="#save-application">Saving Applications</a>, <a class="indexterm" href="#build-application">The Application Builder</a></dt> 20275 20297 </dl> 20276 20298 </div> … … 20278 20300 <h3>A</h3> 20279 20301 <dl> 20280 <dt>accept-connection, <a href="#f_accept-connection">Function ACCEPT-CONNECTION</a></dt>20281 <dt>all-processes, <a href="#f_all-processes">Function ALL-PROCESSES</a></dt>20282 <dt>altivec-available-p, <a href="#f_altivec-available-p">Function ALTIVEC-AVAILABLE-P</a></dt>20302 <dt>accept-connection, <a class="indexterm" href="#f_accept-connection">Function ACCEPT-CONNECTION</a></dt> 20303 <dt>all-processes, <a class="indexterm" href="#f_all-processes">Function ALL-PROCESSES</a></dt> 20304 <dt>altivec-available-p, <a class="indexterm" href="#f_altivec-available-p">Function ALTIVEC-AVAILABLE-P</a></dt> 20283 20305 </dl> 20284 20306 </div> … … 20287 20309 <dl> 20288 20310 <dt>bootstrapping 20289 image, <ahref="#building-definitions">Building Definitions</a></dt>20311 image, <a class="indexterm" href="#building-definitions">Building Definitions</a></dt> 20290 20312 </dl> 20291 20313 </div> … … 20293 20315 <h3>C</h3> 20294 20316 <dl> 20295 <dt>CCL Logical Host, <a href="#Predefined-Logical-Hosts">Predefined Logical Hosts</a></dt>20296 <dt>close, <a href="#o_close">Method CLOSE</a></dt>20297 <dt>close-shared-library, <a href="#f_close-shared-library">Function CLOSE-SHARED-LIBRARY</a></dt>20298 <dt>communication-deadline-expired, <a href="#Stream-Timeouts-And-Deadlines">Stream Timeouts and Deadlines</a></dt>20299 <dt>configure-gcc, <a href="#f_configure-gcc">Function CONFIGURE-GCC</a></dt>20300 <dt>current-directory-name, <a href="#f_current-directory-name">Function CCL::CURRENT-DIRECTORY-NAME</a></dt>20317 <dt>CCL Logical Host, <a class="indexterm" href="#Predefined-Logical-Hosts">Predefined Logical Hosts</a></dt> 20318 <dt>close, <a class="indexterm" href="#o_close">Method CLOSE</a></dt> 20319 <dt>close-shared-library, <a class="indexterm" href="#f_close-shared-library">Function CLOSE-SHARED-LIBRARY</a></dt> 20320 <dt>communication-deadline-expired, <a class="indexterm" href="#Stream-Timeouts-And-Deadlines">Stream Timeouts and Deadlines</a></dt> 20321 <dt>configure-gcc, <a class="indexterm" href="#f_configure-gcc">Function CONFIGURE-GCC</a></dt> 20322 <dt>current-directory-name, <a class="indexterm" href="#f_current-directory-name">Function CCL::CURRENT-DIRECTORY-NAME</a></dt> 20301 20323 </dl> 20302 20324 </div> … … 20304 20326 <h3>D</h3> 20305 20327 <dl> 20306 <dt>def-foreign-type, <a href="#m_def-foreign-type">Macro DEF-FOREIGN-TYPE</a></dt>20307 <dt>defcallback, <a href="#m_defcallback">Macro DEFCALLBACK</a></dt>20308 <dt>define-objc-class-method, <a href="#m_define-objc-class-method">Macro CCL::DEFINE-OBJC-CLASS-METHOD</a></dt>20309 <dt>define-objc-method, <a href="#m_define-objc-method">Macro CCL::DEFINE-OBJC-METHOD</a></dt>20310 <dt>dotted-to-ipaddr, <a href="#f_dotted-to-ipaddr">Function DOTTED-TO-IPADDR</a></dt>20328 <dt>def-foreign-type, <a class="indexterm" href="#m_def-foreign-type">Macro DEF-FOREIGN-TYPE</a></dt> 20329 <dt>defcallback, <a class="indexterm" href="#m_defcallback">Macro DEFCALLBACK</a></dt> 20330 <dt>define-objc-class-method, <a class="indexterm" href="#m_define-objc-class-method">Macro CCL::DEFINE-OBJC-CLASS-METHOD</a></dt> 20331 <dt>define-objc-method, <a class="indexterm" href="#m_define-objc-method">Macro CCL::DEFINE-OBJC-METHOD</a></dt> 20332 <dt>dotted-to-ipaddr, <a class="indexterm" href="#f_dotted-to-ipaddr">Function DOTTED-TO-IPADDR</a></dt> 20311 20333 </dl> 20312 20334 </div> … … 20314 20336 <h3>E</h3> 20315 20337 <dl> 20316 <dt>egc, <a href="#f_egc">Function EGC</a></dt>20317 <dt>egc-active-p, <a href="#f_egc-active-p">Function EGC-ACTIVE-P</a></dt>20318 <dt>egc-configuration, <a href="#f_egc-configuration">Function EGC-CONFIGURATION</a></dt>20319 <dt>egc-enabled-p, <a href="#f_egc-enabled-p">Function EGC-ENABLED-P</a></dt>20320 <dt>external, <a href="#m_external">Macro EXTERNAL</a></dt>20321 <dt>external-call, <a href="#m_external-call">Macro EXTERNAL-CALL</a></dt>20322 <dt>external-process-error-stream, <a href="#f_external-process-error-stream">Function EXTERNAL-PROCESS-ERROR-STREAM</a></dt>20323 <dt>external-process-id, <a href="#f_external-process-id">Function EXTERNAL-PROCESS-ID</a></dt>20324 <dt>external-process-input-stream, <a href="#f_external-process-input-stream">Function EXTERNAL-PROCESS-INPUT-STREAM</a></dt>20325 <dt>external-process-output-stream, <a href="#f_external-process-output-stream">Function EXTERNAL-PROCESS-OUTPUT-STREAM</a></dt>20326 <dt>external-process-status, <a href="#f_external-process-status">Function EXTERNAL-PROCESS-STATUS</a></dt>20338 <dt>egc, <a class="indexterm" href="#f_egc">Function EGC</a></dt> 20339 <dt>egc-active-p, <a class="indexterm" href="#f_egc-active-p">Function EGC-ACTIVE-P</a></dt> 20340 <dt>egc-configuration, <a class="indexterm" href="#f_egc-configuration">Function EGC-CONFIGURATION</a></dt> 20341 <dt>egc-enabled-p, <a class="indexterm" href="#f_egc-enabled-p">Function EGC-ENABLED-P</a></dt> 20342 <dt>external, <a class="indexterm" href="#m_external">Macro EXTERNAL</a></dt> 20343 <dt>external-call, <a class="indexterm" href="#m_external-call">Macro EXTERNAL-CALL</a></dt> 20344 <dt>external-process-error-stream, <a class="indexterm" href="#f_external-process-error-stream">Function EXTERNAL-PROCESS-ERROR-STREAM</a></dt> 20345 <dt>external-process-id, <a class="indexterm" href="#f_external-process-id">Function EXTERNAL-PROCESS-ID</a></dt> 20346 <dt>external-process-input-stream, <a class="indexterm" href="#f_external-process-input-stream">Function EXTERNAL-PROCESS-INPUT-STREAM</a></dt> 20347 <dt>external-process-output-stream, <a class="indexterm" href="#f_external-process-output-stream">Function EXTERNAL-PROCESS-OUTPUT-STREAM</a></dt> 20348 <dt>external-process-status, <a class="indexterm" href="#f_external-process-status">Function EXTERNAL-PROCESS-STATUS</a></dt> 20327 20349 </dl> 20328 20350 </div> … … 20331 20353 <dl> 20332 20354 <dt>fasl 20333 files, <ahref="#building-definitions">Building Definitions</a></dt>20334 <dt>ff-call, <a href="#m_ff-call">Macro FF-CALL</a></dt>20335 <dt>foreign-symbol-address, <a href="#f_foreign-symbol-address">Function FOREIGN-SYMBOL-ADDRESS</a></dt>20336 <dt>foreign-symbol-entry, <a href="#f_foreign-symbol-entry">Function FOREIGN-SYMBOL-ENTRY</a></dt>20337 <dt>free, <a href="#f_free">Function FREE</a></dt>20355 files, <a class="indexterm" href="#building-definitions">Building Definitions</a></dt> 20356 <dt>ff-call, <a class="indexterm" href="#m_ff-call">Macro FF-CALL</a></dt> 20357 <dt>foreign-symbol-address, <a class="indexterm" href="#f_foreign-symbol-address">Function FOREIGN-SYMBOL-ADDRESS</a></dt> 20358 <dt>foreign-symbol-entry, <a class="indexterm" href="#f_foreign-symbol-entry">Function FOREIGN-SYMBOL-ENTRY</a></dt> 20359 <dt>free, <a class="indexterm" href="#f_free">Function FREE</a></dt> 20338 20360 </dl> 20339 20361 </div> … … 20341 20363 <h3>G</h3> 20342 20364 <dl> 20343 <dt>gc-retain-pages, <a href="#f_gc-retain-pages">Function GC-RETAIN-PAGES</a></dt>20344 <dt>gc-retaining-pages, <a href="#f_gc-retaining-pages">Function GC-RETAINING-PAGES</a></dt>20345 <dt>get-user-home-dir, <a href="#f_get-user-home-dir">Function CCL::GET-USER-HOME-DIR</a></dt>20346 <dt>getenv, <a href="#f_getenv">Function CCL::GETENV</a></dt>20347 <dt>getpid, <a href="#f_getpid">Function CCL::GETPID</a></dt>20348 <dt>getuid, <a href="#f_getuid">Function CCL::GETUID</a></dt>20349 <dt>grab-lock, <a href="#f_grab-lock">Function GRAB-LOCK</a></dt>20365 <dt>gc-retain-pages, <a class="indexterm" href="#f_gc-retain-pages">Function GC-RETAIN-PAGES</a></dt> 20366 <dt>gc-retaining-pages, <a class="indexterm" href="#f_gc-retaining-pages">Function GC-RETAINING-PAGES</a></dt> 20367 <dt>get-user-home-dir, <a class="indexterm" href="#f_get-user-home-dir">Function CCL::GET-USER-HOME-DIR</a></dt> 20368 <dt>getenv, <a class="indexterm" href="#f_getenv">Function CCL::GETENV</a></dt> 20369 <dt>getpid, <a class="indexterm" href="#f_getpid">Function CCL::GETPID</a></dt> 20370 <dt>getuid, <a class="indexterm" href="#f_getuid">Function CCL::GETUID</a></dt> 20371 <dt>grab-lock, <a class="indexterm" href="#f_grab-lock">Function GRAB-LOCK</a></dt> 20350 20372 </dl> 20351 20373 </div> … … 20354 20376 <dl> 20355 20377 <dt>heap 20356 image, <ahref="#building-definitions">Building Definitions</a></dt>20378 image, <a class="indexterm" href="#building-definitions">Building Definitions</a></dt> 20357 20379 </dl> 20358 20380 </div> … … 20360 20382 <h3>I</h3> 20361 20383 <dl> 20362 <dt>input-timeout, <a href="#Stream-Timeouts-And-Deadlines">Stream Timeouts and Deadlines</a></dt>20363 <dt>ipaddr-to-dotted, <a href="#f_ipaddr-to-dotted">Function IPADDR-TO-DOTTED</a></dt>20364 <dt>ipaddr-to-hostname, <a href="#f_ipaddr-to-hostname">Function IPADDR-TO-HOSTNAME</a></dt>20384 <dt>input-timeout, <a class="indexterm" href="#Stream-Timeouts-And-Deadlines">Stream Timeouts and Deadlines</a></dt> 20385 <dt>ipaddr-to-dotted, <a class="indexterm" href="#f_ipaddr-to-dotted">Function IPADDR-TO-DOTTED</a></dt> 20386 <dt>ipaddr-to-hostname, <a class="indexterm" href="#f_ipaddr-to-hostname">Function IPADDR-TO-HOSTNAME</a></dt> 20365 20387 </dl> 20366 20388 </div> … … 20368 20390 <h3>K</h3> 20369 20391 <dl> 20370 <dt>kernel build directory, <a href="#building-definitions">Building Definitions</a></dt>20392 <dt>kernel build directory, <a class="indexterm" href="#building-definitions">Building Definitions</a></dt> 20371 20393 </dl> 20372 20394 </div> … … 20375 20397 <dl> 20376 20398 <dt>lisp 20377 kernel, <ahref="#building-definitions">Building Definitions</a></dt>20378 <dt>lisp-heap-gc-threshold, <a href="#f_lisp-heap-gc-threshold">Function LISP-HEAP-GC-THRESHOLD</a></dt>20379 <dt>local-host, <a href="#f_local-host">Function LOCAL-HOST</a></dt>20380 <dt>local-port, <a href="#f_local-port">Function LOCAL-PORT</a></dt>20381 <dt>lookup-hostname, <a href="#f_lookup-hostname">Function LOOKUP-HOSTNAME</a></dt>20382 <dt>lookup-port, <a href="#f_lookup-port">Function LOOKUP-PORT</a></dt>20399 kernel, <a class="indexterm" href="#building-definitions">Building Definitions</a></dt> 20400 <dt>lisp-heap-gc-threshold, <a class="indexterm" href="#f_lisp-heap-gc-threshold">Function LISP-HEAP-GC-THRESHOLD</a></dt> 20401 <dt>local-host, <a class="indexterm" href="#f_local-host">Function LOCAL-HOST</a></dt> 20402 <dt>local-port, <a class="indexterm" href="#f_local-port">Function LOCAL-PORT</a></dt> 20403 <dt>lookup-hostname, <a class="indexterm" href="#f_lookup-hostname">Function LOOKUP-HOSTNAME</a></dt> 20404 <dt>lookup-port, <a class="indexterm" href="#f_lookup-port">Function LOOKUP-PORT</a></dt> 20383 20405 </dl> 20384 20406 </div> … … 20386 20408 <h3>M</h3> 20387 20409 <dl> 20388 <dt>make-external-format, <a href="#f_make-external-format">Function MAKE-EXTERNAL-FORMAT</a></dt>20389 <dt>make-gcable-record, <a href="#m_make-record">Macro MAKE-RECORD</a></dt>20390 <dt>make-lock, <a href="#f_make-lock">Function MAKE-LOCK</a></dt>20391 <dt>make-process, <a href="#f_make-process">Function MAKE-PROCESS</a></dt>20392 <dt>make-read-write-lock, <a href="#f_make-read-write-lock">Function MAKE-READ-WRITE-LOCK</a></dt>20393 <dt>make-record, <a href="#m_make-record">Macro MAKE-RECORD</a></dt>20394 <dt>make-semaphore, <a href="#f_make-semaphore">Function MAKE-SEMAPHORE</a></dt>20395 <dt>make-socket, <a href="#f_make-socket">Function MAKE-SOCKET</a></dt>20410 <dt>make-external-format, <a class="indexterm" href="#f_make-external-format">Function MAKE-EXTERNAL-FORMAT</a></dt> 20411 <dt>make-gcable-record, <a class="indexterm" href="#m_make-record">Macro MAKE-RECORD</a></dt> 20412 <dt>make-lock, <a class="indexterm" href="#f_make-lock">Function MAKE-LOCK</a></dt> 20413 <dt>make-process, <a class="indexterm" href="#f_make-process">Function MAKE-PROCESS</a></dt> 20414 <dt>make-read-write-lock, <a class="indexterm" href="#f_make-read-write-lock">Function MAKE-READ-WRITE-LOCK</a></dt> 20415 <dt>make-record, <a class="indexterm" href="#m_make-record">Macro MAKE-RECORD</a></dt> 20416 <dt>make-semaphore, <a class="indexterm" href="#f_make-semaphore">Function MAKE-SEMAPHORE</a></dt> 20417 <dt>make-socket, <a class="indexterm" href="#f_make-socket">Function MAKE-SOCKET</a></dt> 20396 20418 </dl> 20397 20419 </div> … … 20399 20421 <h3>N</h3> 20400 20422 <dl> 20401 <dt>note-open-file-stream, <a href="#f_note-open-file-stream">Function NOTE-OPEN-FILE-STREAM</a></dt>20402 <dt>ns-lisp-string, <a href="#c_ns-lisp-string">Class CCL::NS-LISP-STRING</a></dt>20423 <dt>note-open-file-stream, <a class="indexterm" href="#f_note-open-file-stream">Function NOTE-OPEN-FILE-STREAM</a></dt> 20424 <dt>ns-lisp-string, <a class="indexterm" href="#c_ns-lisp-string">Class CCL::NS-LISP-STRING</a></dt> 20403 20425 </dl> 20404 20426 </div> … … 20406 20428 <h3>O</h3> 20407 20429 <dl> 20408 <dt>objc:defmethod, <a href="#m_objc-defmethod">Macro objc:defmethod</a></dt>20409 <dt>open-file-streams, <a href="#f_open-file-streams">Function OPEN-FILE-STREAMS</a></dt>20410 <dt>open-shared-library, <a href="#f_open-shared-library">Function OPEN-SHARED-LIBRARY</a></dt>20411 <dt>os-command, <a href="#f_os-command">Function CCL::OS-COMMAND</a></dt>20412 <dt>output-timeout, <a href="#Stream-Timeouts-And-Deadlines">Stream Timeouts and Deadlines</a></dt>20430 <dt>objc:defmethod, <a class="indexterm" href="#m_objc-defmethod">Macro objc:defmethod</a></dt> 20431 <dt>open-file-streams, <a class="indexterm" href="#f_open-file-streams">Function OPEN-FILE-STREAMS</a></dt> 20432 <dt>open-shared-library, <a class="indexterm" href="#f_open-shared-library">Function OPEN-SHARED-LIBRARY</a></dt> 20433 <dt>os-command, <a class="indexterm" href="#f_os-command">Function CCL::OS-COMMAND</a></dt> 20434 <dt>output-timeout, <a class="indexterm" href="#Stream-Timeouts-And-Deadlines">Stream Timeouts and Deadlines</a></dt> 20413 20435 </dl> 20414 20436 </div> … … 20416 20438 <h3>P</h3> 20417 20439 <dl> 20418 <dt>pref, <a href="#m_pref">Macro PREF</a></dt>20419 <dt>process-abort, <a href="#f_process-abort">Function PROCESS-ABORT</a></dt>20420 <dt>process-allow-schedule, <a href="#f_process-allow-schedule">Function PROCESS-ALLOW-SCHEDULE</a></dt>20421 <dt>process-enable, <a href="#f_process-enable">Function PROCESS-ENABLE</a></dt>20422 <dt>process-input-wait, <a href="#f_process-input-wait">Function PROCESS-INPUT-WAIT</a></dt>20423 <dt>process-interrupt, <a href="#f_process-interrupt">Function PROCESS-INTERRUPT</a></dt>20424 <dt>process-kill, <a href="#f_process-kill">Function PROCESS-KILL</a></dt>20425 <dt>process-output-wait, <a href="#f_process-output-wait">Function PROCESS-OUTPUT-WAIT</a></dt>20426 <dt>process-preset, <a href="#f_process-preset">Function PROCESS-PRESET</a></dt>20427 <dt>process-reset, <a href="#f_process-reset">Function PROCESS-RESET</a></dt>20428 <dt>process-resume, <a href="#f_process-resume">Function PROCESS-RESUME</a></dt>20429 <dt>process-run-function, <a href="#f_process-run-function">Function PROCESS-RUN-FUNCTION</a></dt>20430 <dt>process-suspend, <a href="#f_process-suspend">Function PROCESS-SUSPEND</a></dt>20431 <dt>process-suspend-count, <a href="#f_process-suspend-count">Function PROCESS-SUSPEND-COUNT</a></dt>20432 <dt>process-wait, <a href="#f_process-wait">Function PROCESS-WAIT</a></dt>20433 <dt>process-wait-with-timeout, <a href="#f_process-wait-with-timeout">Function PROCESS-WAIT-WITH-TIMEOUT</a></dt>20434 <dt>process-whostate, <a href="#f_process-whostate">Function PROCESS-WHOSTATE</a></dt>20440 <dt>pref, <a class="indexterm" href="#m_pref">Macro PREF</a></dt> 20441 <dt>process-abort, <a class="indexterm" href="#f_process-abort">Function PROCESS-ABORT</a></dt> 20442 <dt>process-allow-schedule, <a class="indexterm" href="#f_process-allow-schedule">Function PROCESS-ALLOW-SCHEDULE</a></dt> 20443 <dt>process-enable, <a class="indexterm" href="#f_process-enable">Function PROCESS-ENABLE</a></dt> 20444 <dt>process-input-wait, <a class="indexterm" href="#f_process-input-wait">Function PROCESS-INPUT-WAIT</a></dt> 20445 <dt>process-interrupt, <a class="indexterm" href="#f_process-interrupt">Function PROCESS-INTERRUPT</a></dt> 20446 <dt>process-kill, <a class="indexterm" href="#f_process-kill">Function PROCESS-KILL</a></dt> 20447 <dt>process-output-wait, <a class="indexterm" href="#f_process-output-wait">Function PROCESS-OUTPUT-WAIT</a></dt> 20448 <dt>process-preset, <a class="indexterm" href="#f_process-preset">Function PROCESS-PRESET</a></dt> 20449 <dt>process-reset, <a class="indexterm" href="#f_process-reset">Function PROCESS-RESET</a></dt> 20450 <dt>process-resume, <a class="indexterm" href="#f_process-resume">Function PROCESS-RESUME</a></dt> 20451 <dt>process-run-function, <a class="indexterm" href="#f_process-run-function">Function PROCESS-RUN-FUNCTION</a></dt> 20452 <dt>process-suspend, <a class="indexterm" href="#f_process-suspend">Function PROCESS-SUSPEND</a></dt> 20453 <dt>process-suspend-count, <a class="indexterm" href="#f_process-suspend-count">Function PROCESS-SUSPEND-COUNT</a></dt> 20454 <dt>process-wait, <a class="indexterm" href="#f_process-wait">Function PROCESS-WAIT</a></dt> 20455 <dt>process-wait-with-timeout, <a class="indexterm" href="#f_process-wait-with-timeout">Function PROCESS-WAIT-WITH-TIMEOUT</a></dt> 20456 <dt>process-whostate, <a class="indexterm" href="#f_process-whostate">Function PROCESS-WHOSTATE</a></dt> 20435 20457 </dl> 20436 20458 </div> … … 20438 20460 <h3>R</h3> 20439 20461 <dl> 20440 <dt>receive-from, <a href="#f_receive-from">Function RECEIVE-FROM</a></dt>20441 <dt>release-lock, <a href="#f_release-lock">Function RELEASE-LOCK</a></dt>20442 <dt>remote-host, <a href="#f_remote-host">Function REMOTE-HOST</a></dt>20443 <dt>remote-port, <a href="#f_remote-port">Function REMOTE-PORT</a></dt>20444 <dt>remove-open-file-stream, <a href="#f_remove-open-file-stream">Function REMOVE-OPEN-FILE-STREAM</a></dt>20445 <dt>request-terminal-input-via-break, <a href="#v_request-terminal-input-via-break">Variable *REQUEST-TERMINAL-INPUT-VIA-BREAK*</a></dt>20446 <dt>rlet, <a href="#m_rlet">Macro RLET</a></dt>20447 <dt>rletz, <a href="#m_rletz">Macro RLETZ</a></dt>20448 <dt>run-program, <a href="#f_run-program">Function RUN-PROGRAM</a></dt>20462 <dt>receive-from, <a class="indexterm" href="#f_receive-from">Function RECEIVE-FROM</a></dt> 20463 <dt>release-lock, <a class="indexterm" href="#f_release-lock">Function RELEASE-LOCK</a></dt> 20464 <dt>remote-host, <a class="indexterm" href="#f_remote-host">Function REMOTE-HOST</a></dt> 20465 <dt>remote-port, <a class="indexterm" href="#f_remote-port">Function REMOTE-PORT</a></dt> 20466 <dt>remove-open-file-stream, <a class="indexterm" href="#f_remove-open-file-stream">Function REMOVE-OPEN-FILE-STREAM</a></dt> 20467 <dt>request-terminal-input-via-break, <a class="indexterm" href="#v_request-terminal-input-via-break">Variable *REQUEST-TERMINAL-INPUT-VIA-BREAK*</a></dt> 20468 <dt>rlet, <a class="indexterm" href="#m_rlet">Macro RLET</a></dt> 20469 <dt>rletz, <a class="indexterm" href="#m_rletz">Macro RLETZ</a></dt> 20470 <dt>run-program, <a class="indexterm" href="#f_run-program">Function RUN-PROGRAM</a></dt> 20449 20471 </dl> 20450 20472 </div> … … 20452 20474 <h3>S</h3> 20453 20475 <dl> 20454 <dt>save-application, <a href="#Saving-Applications">Saving Applications</a></dt>20455 <dt>send-to, <a href="#f_send-to">Function SEND-TO</a></dt>20456 <dt>set-development-environment, <a href="#f_set-development-environment">Function SET-DEVELOPMENT-ENVIRONMENT</a></dt>20457 <dt>set-lisp-heap-gc-threshold, <a href="#f_set-lisp-heap-gc-threshold">Function SET-LISP-HEAP-GC-THRESHOLD</a></dt>20458 <dt>set-user-environment, <a href="#f_set-user-environment">Function SET-USER-ENVIRONMENT</a></dt>20459 <dt>setenv, <a href="#f_setenv">Function CCL::SETENV</a></dt>20460 <dt>setgid, <a href="#f_setgid">Function CCL::SETGID</a></dt>20461 <dt>setuid, <a href="#f_setuid">Function CCL::SETUID</a></dt>20462 <dt>shutdown, <a href="#f_shutdown">Function SHUTDOWN</a></dt>20463 <dt>signal-external-process, <a href="#f_signal-external-process">Function SIGNAL-EXTERNAL-PROCESS</a></dt>20464 <dt>signal-semaphore, <a href="#f_signal-semaphore">Function SIGNAL-SEMAPHORE</a></dt>20465 <dt>socket-address-family, <a href="#f_socket-address-family">Function SOCKET-ADDRESS-FAMILY</a></dt>20466 <dt>socket-connect, <a href="#f_socket-connect">Function SOCKET-CONNECT</a></dt>20467 <dt>socket-error, <a href="#c_socket-error">Class SOCKET-ERROR</a></dt>20468 <dt>socket-error-code, <a href="#f_socket-error-code">Function SOCKET-ERROR-CODE</a></dt>20469 <dt>socket-error-identifier, <a href="#f_socket-error-identifier">Function SOCKET-ERROR-IDENTIFIER</a></dt>20470 <dt>socket-error-situation, <a href="#f_socket-error-situation">Function SOCKET-ERROR-SITUATION</a></dt>20471 <dt>socket-format, <a href="#f_socket-format">Function SOCKET-FORMAT</a></dt>20472 <dt>socket-os-fd, <a href="#f_socket-os-fd">Function SOCKET-OS-FD</a></dt>20473 <dt>socket-type, <a href="#f_socket-type">Function SOCKET-TYPE</a></dt>20474 <dt>stream-deadline, <a href="#Stream-Timeouts-And-Deadlines">Stream Timeouts and Deadlines</a></dt>20475 <dt>stream-device, <a href="#f_stream-device">Generic Function CCL::STREAM-DEVICE</a></dt>20476 <dt>stream-input-timeout, <a href="#Stream-Timeouts-And-Deadlines">Stream Timeouts and Deadlines</a></dt>20477 <dt>stream-output-timeout, <a href="#Stream-Timeouts-And-Deadlines">Stream Timeouts and Deadlines</a></dt>20478 <dt>stream-read-ivector, <a href="#f_stream-read-ivector">Generic Function STREAM-READ-IVECTOR</a></dt>20479 <dt>stream-read-list, <a href="#f_stream-read-list">Generic Function CCL:STREAM-READ-LIST</a></dt>20480 <dt>stream-read-vector, <a href="#f_stream-read-vector">Generic Function CCL:STREAM-READ-VECTOR</a></dt>20481 <dt>stream-write-ivector, <a href="#f_stream-write-ivector">Generic Function STREAM-WRITE-IVECTOR</a></dt>20482 <dt>stream-write-list, <a href="#f_stream-write-list">Generic Function CCL:STREAM-WRITE-LIST</a></dt>20483 <dt>stream-write-vector, <a href="#f_stream-write-vector">Generic Function CCL:STREAM-WRITE-VECTOR</a></dt>20476 <dt>save-application, <a class="indexterm" href="#Saving-Applications">Saving Applications</a></dt> 20477 <dt>send-to, <a class="indexterm" href="#f_send-to">Function SEND-TO</a></dt> 20478 <dt>set-development-environment, <a class="indexterm" href="#f_set-development-environment">Function SET-DEVELOPMENT-ENVIRONMENT</a></dt> 20479 <dt>set-lisp-heap-gc-threshold, <a class="indexterm" href="#f_set-lisp-heap-gc-threshold">Function SET-LISP-HEAP-GC-THRESHOLD</a></dt> 20480 <dt>set-user-environment, <a class="indexterm" href="#f_set-user-environment">Function SET-USER-ENVIRONMENT</a></dt> 20481 <dt>setenv, <a class="indexterm" href="#f_setenv">Function CCL::SETENV</a></dt> 20482 <dt>setgid, <a class="indexterm" href="#f_setgid">Function CCL::SETGID</a></dt> 20483 <dt>setuid, <a class="indexterm" href="#f_setuid">Function CCL::SETUID</a></dt> 20484 <dt>shutdown, <a class="indexterm" href="#f_shutdown">Function SHUTDOWN</a></dt> 20485 <dt>signal-external-process, <a class="indexterm" href="#f_signal-external-process">Function SIGNAL-EXTERNAL-PROCESS</a></dt> 20486 <dt>signal-semaphore, <a class="indexterm" href="#f_signal-semaphore">Function SIGNAL-SEMAPHORE</a></dt> 20487 <dt>socket-address-family, <a class="indexterm" href="#f_socket-address-family">Function SOCKET-ADDRESS-FAMILY</a></dt> 20488 <dt>socket-connect, <a class="indexterm" href="#f_socket-connect">Function SOCKET-CONNECT</a></dt> 20489 <dt>socket-error, <a class="indexterm" href="#c_socket-error">Class SOCKET-ERROR</a></dt> 20490 <dt>socket-error-code, <a class="indexterm" href="#f_socket-error-code">Function SOCKET-ERROR-CODE</a></dt> 20491 <dt>socket-error-identifier, <a class="indexterm" href="#f_socket-error-identifier">Function SOCKET-ERROR-IDENTIFIER</a></dt> 20492 <dt>socket-error-situation, <a class="indexterm" href="#f_socket-error-situation">Function SOCKET-ERROR-SITUATION</a></dt> 20493 <dt>socket-format, <a class="indexterm" href="#f_socket-format">Function SOCKET-FORMAT</a></dt> 20494 <dt>socket-os-fd, <a class="indexterm" href="#f_socket-os-fd">Function SOCKET-OS-FD</a></dt> 20495 <dt>socket-type, <a class="indexterm" href="#f_socket-type">Function SOCKET-TYPE</a></dt> 20496 <dt>stream-deadline, <a class="indexterm" href="#Stream-Timeouts-And-Deadlines">Stream Timeouts and Deadlines</a></dt> 20497 <dt>stream-device, <a class="indexterm" href="#f_stream-device">Generic Function CCL::STREAM-DEVICE</a></dt> 20498 <dt>stream-input-timeout, <a class="indexterm" href="#Stream-Timeouts-And-Deadlines">Stream Timeouts and Deadlines</a></dt> 20499 <dt>stream-output-timeout, <a class="indexterm" href="#Stream-Timeouts-And-Deadlines">Stream Timeouts and Deadlines</a></dt> 20500 <dt>stream-read-ivector, <a class="indexterm" href="#f_stream-read-ivector">Generic Function STREAM-READ-IVECTOR</a></dt> 20501 <dt>stream-read-list, <a class="indexterm" href="#f_stream-read-list">Generic Function CCL:STREAM-READ-LIST</a></dt> 20502 <dt>stream-read-vector, <a class="indexterm" href="#f_stream-read-vector">Generic Function CCL:STREAM-READ-VECTOR</a></dt> 20503 <dt>stream-write-ivector, <a class="indexterm" href="#f_stream-write-ivector">Generic Function STREAM-WRITE-IVECTOR</a></dt> 20504 <dt>stream-write-list, <a class="indexterm" href="#f_stream-write-list">Generic Function CCL:STREAM-WRITE-LIST</a></dt> 20505 <dt>stream-write-vector, <a class="indexterm" href="#f_stream-write-vector">Generic Function CCL:STREAM-WRITE-VECTOR</a></dt> 20484 20506 </dl> 20485 20507 </div> … … 20487 20509 <h3>T</h3> 20488 20510 <dl> 20489 <dt>terminate-when-unreachable, <a href="#f_terminate-when-unreachable">Function TERMINATE-WHEN-UNREACHABLE</a></dt>20490 <dt>timed-wait-on-semaphore, <a href="#f_timed-wait-on-semaphore">Function TIMED-WAIT-ON-SEMAPHORE</a></dt>20491 <dt>try-lock, <a href="#f_try-lock">Function TRY-LOCK</a></dt>20511 <dt>terminate-when-unreachable, <a class="indexterm" href="#f_terminate-when-unreachable">Function TERMINATE-WHEN-UNREACHABLE</a></dt> 20512 <dt>timed-wait-on-semaphore, <a class="indexterm" href="#f_timed-wait-on-semaphore">Function TIMED-WAIT-ON-SEMAPHORE</a></dt> 20513 <dt>try-lock, <a class="indexterm" href="#f_try-lock">Function TRY-LOCK</a></dt> 20492 20514 </dl> 20493 20515 </div> … … 20495 20517 <h3>U</h3> 20496 20518 <dl> 20497 <dt>unuse-interface-dir, <a href="#f_unuse-interface-dir">Function UNUSE-INTERFACE-DIR</a></dt>20498 <dt>use-interface-dir, <a href="#f_use-interface-dir">Function USE-INTERFACE-DIR</a></dt>20499 <dt>use-lisp-heap-gc-threshold, <a href="#f_use-lisp-heap-gc-threshold">Function USE-LISP-HEAP-GC-THRESHOLD</a></dt>20519 <dt>unuse-interface-dir, <a class="indexterm" href="#f_unuse-interface-dir">Function UNUSE-INTERFACE-DIR</a></dt> 20520 <dt>use-interface-dir, <a class="indexterm" href="#f_use-interface-dir">Function USE-INTERFACE-DIR</a></dt> 20521 <dt>use-lisp-heap-gc-threshold, <a class="indexterm" href="#f_use-lisp-heap-gc-threshold">Function USE-LISP-HEAP-GC-THRESHOLD</a></dt> 20500 20522 </dl> 20501 20523 </div> … … 20503 20525 <h3>W</h3> 20504 20526 <dl> 20505 <dt>wait-on-semaphore, <a href="#f_wait-on-semaphore">Function WAIT-ON-SEMAPHORE</a></dt>20506 <dt>with-altivec-registers, <a href="#lapm_with-altivec-registers">LAP Macro WITH-ALTIVEC-REGISTERS</a></dt>20507 <dt>with-lock-grabbed, <a href="#m_with-lock-grabbed">Macro WITH-LOCK-GRABBED</a></dt>20508 <dt>with-open-socket, <a href="#m_with-open-socket">Macro WITH-OPEN-SOCKET</a></dt>20509 <dt>with-read-lock, <a href="#m_with-read-lock">Macro WITH-READ-LOCK</a></dt>20510 <dt>with-terminal-input, <a href="#m_with-terminal-input">Macro WITH-TERMINAL-INPUT</a></dt>20511 <dt>with-vector-buffer, <a href="#lapm_with-vector-buffer">LAP Macro WITH-VECTOR-BUFFER</a></dt>20512 <dt>with-write-lock, <a href="#m_with-write-lock">Macro WITH-WRITE-LOCK</a></dt>20513 <dt>without-interrupts, <a href="#m_without-interrupts">Macro WITHOUT-INTERRUPTS</a></dt>20527 <dt>wait-on-semaphore, <a class="indexterm" href="#f_wait-on-semaphore">Function WAIT-ON-SEMAPHORE</a></dt> 20528 <dt>with-altivec-registers, <a class="indexterm" href="#lapm_with-altivec-registers">LAP Macro WITH-ALTIVEC-REGISTERS</a></dt> 20529 <dt>with-lock-grabbed, <a class="indexterm" href="#m_with-lock-grabbed">Macro WITH-LOCK-GRABBED</a></dt> 20530 <dt>with-open-socket, <a class="indexterm" href="#m_with-open-socket">Macro WITH-OPEN-SOCKET</a></dt> 20531 <dt>with-read-lock, <a class="indexterm" href="#m_with-read-lock">Macro WITH-READ-LOCK</a></dt> 20532 <dt>with-terminal-input, <a class="indexterm" href="#m_with-terminal-input">Macro WITH-TERMINAL-INPUT</a></dt> 20533 <dt>with-vector-buffer, <a class="indexterm" href="#lapm_with-vector-buffer">LAP Macro WITH-VECTOR-BUFFER</a></dt> 20534 <dt>with-write-lock, <a class="indexterm" href="#m_with-write-lock">Macro WITH-WRITE-LOCK</a></dt> 20535 <dt>without-interrupts, <a class="indexterm" href="#m_without-interrupts">Macro WITHOUT-INTERRUPTS</a></dt> 20514 20536 </dl> 20515 20537 </div> … … 20520 20542 <a href="#Symbol-Index">Symbol Index</a> 20521 20543 </div> 20522 <p xmlns="http://www.w3.org/TR/xhtml1/transitional" xmlns:date="http://exslt.org/dates-and-times" class="footer">This document was last modified at 2:17 PM on April 10, 2008, in UTC.<br></br>It uses version 1.72.0 of the Norman Walsh Docbook stylesheets.<br></br>Using libxml 20616, libxslt 10112 and libexslt 810.</p>20544 <p xmlns="http://www.w3.org/TR/xhtml1/transitional" xmlns:date="http://exslt.org/dates-and-times" class="footer">This document was last modified at 10:46 on April 20, 2008, in UTC.<br></br>It uses version 1.73.2 of the Norman Walsh Docbook stylesheets.<br></br>Built from subversion rev 9206<br></br>Using libxml 20631, libxslt 10122 and libexslt 813.</p> 20523 20545 </body> 20524 20546 </html> -
release/1.2/source/doc/src
-
Property svn:ignore
set to
build*
*html
-
Property svn:ignore
set to
-
release/1.2/source/doc/src/Makefile.fedora
r8574 r9219 55 55 # Compute some targets. 56 56 57 XMLFILES = $(wildcard [0-9][0-9]-*.xml) ccl-documentation.xml57 XMLFILES = $(wildcard *.xml) 58 58 XSLFILES = $(shell find xsl -name "*.xsl") 59 #HTMLFILES = $(patsubst %.xml,%.html, $(XMLFILES))60 59 HTMLFILES = ccl-documentation.html 61 60 … … 63 62 64 63 XSLTPROCVERSION = $(shell $(XSLTPROC) --version | head -n 1) 64 65 # Try to determine the svn revishion 66 SVNREV = $(shell /usr/bin/svnversion) 67 65 68 66 69 .PHONY: all clean distclean … … 71 74 72 75 install: $(HTMLFILES) distclean 73 cp $(HTMLFILES) ../ HTML76 cp $(HTMLFILES) ../ 74 77 75 78 $(TEMP): -
release/1.2/source/doc/src/Makefile.macports
r8574 r9219 12 12 13 13 XSLTPROC = /usr/bin/xsltproc 14 15 # Try to determine the svn revishion 16 SVNREV = $(shell /usr/bin/svnversion) 14 17 15 18 … … 58 61 # Compute some targets. 59 62 60 XMLFILES = $(wildcard [0-9][0-9]-*.xml) ccl-documentation.xml63 XMLFILES = $(wildcard *.xml) 61 64 XSLFILES = $(shell find xsl -name "*.xsl") 62 65 HTMLFILES = ccl-documentation.html … … 73 76 74 77 install: $(HTMLFILES) distclean 75 cp $(HTMLFILES) ../ HTML78 cp $(HTMLFILES) ../ 76 79 77 80 $(TEMP): -
release/1.2/source/doc/src/makehtml
r8574 r9219 8 8 $(if $(findstring Doc, $(@D)), 0, 1) \ 9 9 --stringparam xsltproc.version "$(XSLTPROCVERSION)." \ 10 --stringparam svnrev "$(SVNREV)"\ 10 11 $(EXTRAPARAMS) \ 11 12 $(STYLESHEET) $< -
release/1.2/source/doc/src/xsl/footer.xsl
r8555 r9219 23 23 <xsl:variable name="now" select="date:date-time()"/> 24 24 <xsl:text>This document was last modified at </xsl:text> 25 <xsl:choose> 26 <xsl:when test="date:hour-in-day($now) = 0"> 27 <xsl:text>12:</xsl:text> 28 <xsl:number value="date:minute-in-hour($now)" format="01"/> 29 <xsl:text> AM</xsl:text> 30 </xsl:when> 31 <xsl:when test="date:hour-in-day($now) < 12"> 32 <xsl:value-of select="date:hour-in-day($now)"/> 33 <xsl:text>:</xsl:text> 34 <xsl:number value="date:minute-in-hour($now)" format="01"/> 35 <xsl:text> AM</xsl:text> 36 </xsl:when> 37 <xsl:when test="date:hour-in-day($now) = 12"> 38 <xsl:text>12:</xsl:text> 39 <xsl:number value="date:minute-in-hour($now)" format="01"/> 40 <xsl:text> PM</xsl:text> 41 </xsl:when> 42 <xsl:otherwise> 43 <xsl:value-of select="date:hour-in-day($now) - 12"/> 44 <xsl:text>:</xsl:text> 45 <xsl:number value="date:minute-in-hour($now)" format="01"/> 46 <xsl:text> PM</xsl:text> 47 </xsl:otherwise> 48 </xsl:choose> 25 <xsl:value-of select="date:hour-in-day($now)"/> 26 <xsl:text>:</xsl:text> 27 <xsl:value-of select="date:minute-in-hour($now)"/> 49 28 <xsl:text> on </xsl:text> 50 29 <xsl:value-of select="date:month-name($now)"/> … … 59 38 <xsl:text> of the Norman Walsh Docbook stylesheets.</xsl:text> 60 39 <br/> 40 <xsl:text>Built from subversion rev </xsl:text> 41 <xsl:value-of select="$svnrev"/> 42 <br/> 61 43 <xsl:value-of select="$xsltproc.version"/> 62 44 </p> -
release/1.2/source/level-1/linux-files.lisp
r9007 r9219 540 540 541 541 (defun %read-dir (dir) 542 (let* ((res (#_readdir dir))) 543 (unless (%null-ptr-p res) 544 (get-foreign-namestring (pref res :dirent.d_name))))) 542 (rlet ((entry #>dirent) 543 (presult :address +null-ptr+)) 544 (let* ((err (#_readdir_r dir entry presult)) 545 (result (%get-ptr presult))) 546 (declare (fixnum err) (dynamic-extent result)) 547 (when (zerop err) 548 (unless (%null-ptr-p result) 549 (get-foreign-namestring (pref result #>dirent.d_name))))))) 545 550 546 551 (defun tcgetpgrp (fd) -
release/1.2/source/lib/foreign-types.lisp
r8541 r9219 1713 1713 (canonicalize-foreign-type-ordinal '(:* (:struct :hostent))) 1714 1714 (canonicalize-foreign-type-ordinal '(:array :int 2)) 1715 (canonicalize-foreign-type-ordinal '(:array (:struct :pollfd) 1))))) 1715 (canonicalize-foreign-type-ordinal '(:array (:struct :pollfd) 1)) 1716 (canonicalize-foreign-type-ordinal '(:struct :dirent))))) 1716 1717 1717 1718 (defun install-standard-foreign-types (ftd) -
release/1.2/source/tools/asdf-install/COPYRIGHT
r2590 r9219 15 15 MK:DEFSYSTEM which includes the files load-asdf-install.lisp, 16 16 loader.lisp, and finally split-sequence.lisp which has its own 17 copyright notice. 17 copyright notice. ASDF-Install is currently maintained by Gary King 18 <gwking@metabang.com> and is hosted on Common-Lisp.net. 18 19 19 20 The complete code distributed with this archive (asdf-install.tar.gz) -
release/1.2/source/tools/asdf-install/asdf-install.asd
r926 r9219 1 1 ;;; -*- Lisp -*- 2 3 ;;; Portatble ASDF-Install is based on Dan Barlow's ASDF-Install 4 ;; (see the file COPYRIGHT for details). It is currently maintained 5 ;; by Gary King <gwking@metabang.com>. 2 6 3 7 (defpackage #:asdf-install-system … … 5 9 6 10 (in-package #:asdf-install-system) 7 #+:sbcl8 (require 'sb-executable)9 10 ;;; this is appalling misuse of asdf. please don't treat it as any11 ;;; kind of example. this shouldn't be a compile-op, or if it is, should12 ;;; define output-files properly instead of leaving it be the fasl13 #+:sbcl14 (defclass exe-file (cl-source-file) ())15 #+:sbcl16 (defmethod perform :after ((o compile-op) (c exe-file))17 (sb-executable:make-executable18 (make-pathname :name "asdf-install"19 :type nil20 :defaults (component-pathname c))21 (output-files o c)22 :initial-function "RUN"))23 24 #+:sbcl25 (defmethod perform ((o load-op) (c exe-file)) nil)26 11 27 12 (defsystem asdf-install 28 13 #+:sbcl :depends-on 29 #+:sbcl (sb-posix sb-bsd-sockets) 30 :version "0.3" 14 #+:sbcl (sb-bsd-sockets) 15 :version "0.6.10" 16 :author "Dan Barlow <dan@telent.net>, Edi Weitz <edi@agharta.de> and many others. See the file COPYRIGHT for more details." 17 :maintainer "Gary Warren King <gwking@metabang.com>" 31 18 :components ((:file "defpackage") 32 #+:sbcl 33 (:exe-file "loader" :depends-on ("installer")) 34 (:file "split-sequence") 19 (:file "split-sequence" :depends-on ("defpackage")) 20 35 21 (:file "port" :depends-on ("defpackage")) 36 22 #+:digitool 37 23 (:file "digitool" :depends-on ("port")) 38 (:file "installer" :depends-on ("port" "split-sequence" #+:digitool "digitool")))) 39 24 25 (:file "conditions" :depends-on ("defpackage" "variables")) 26 (:file "variables" :depends-on ("port")) 27 (:file "installer" 28 :depends-on ("port" "split-sequence" 29 #+:digitool "digitool" 30 "conditions" "variables")) 31 (:file "deprecated" :depends-on ("installer"))) 32 :in-order-to ((test-op (load-op test-asdf-install))) 33 :perform (test-op :after (op c) 34 (funcall 35 (intern (symbol-name '#:run-tests) :lift) 36 :config :generic))) 37 40 38 (defmethod perform :after ((o load-op) (c (eql (find-system :asdf-install)))) 39 (let ((show-version (find-symbol 40 (symbol-name '#:show-version-information) 41 '#:asdf-install))) 42 (when (and show-version (fboundp show-version)) 43 (funcall show-version))) 41 44 (provide 'asdf-install)) 42 45 46 (defmethod operation-done-p 47 ((o test-op) (c (eql (find-system :asdf-install)))) 48 nil) 49 50 #+(or) 43 51 (defmethod perform ((o test-op) (c (eql (find-system :asdf-install)))) 44 52 t) -
release/1.2/source/tools/asdf-install/defpackage.lisp
r2590 r9219 1 1 (cl:in-package :cl-user) 2 2 3 (defpackage :asdf-install 4 (:use "CL") 3 (defpackage #:asdf-install 4 (:use #:common-lisp) 5 6 #+asdf 7 (:import-from #:asdf #:*defined-systems*) 5 8 (:export 6 9 7 10 ;; Customizable variables. 11 #:*shell-path* 8 12 #:*proxy* 9 13 #:*cclan-mirror* 10 #:*sbcl-home* ; Deprecated.11 14 #:asdf-install-dirs 12 15 #:private-asdf-install-dirs 16 #:*tar-extractors* 13 17 18 #:*shell-search-paths* 14 19 #:*verify-gpg-signatures* 15 20 #:*locations* 16 21 #:*safe-url-prefixes* 17 22 #:*preferred-location* 18 19 #+(or :win32 :mswindows) 20 #:*cygwin-bin-directory* 21 22 #+(or :win32 :mswindows) 23 #:*cygwin-bash-command* 24 23 #:*temporary-directory* 24 25 25 ;; External entry points. 26 26 #:add-locations 27 #+(and asdf (or :win32 :mswindows)) 28 #:sysdef-source-dir-search 27 #:add-registry-location 29 28 #:uninstall 30 29 #:install 30 #:asdf-install-version 31 32 #+(and asdf (or :win32 :mswindows)) 33 #:sysdef-source-dir-search 34 31 35 ;; proxy authentication 32 36 #:*proxy-user* 33 #:*proxy-passwd*)) 37 #:*proxy-passwd* 38 39 ;; conditions 40 #:download-error 41 #:signature-error 42 #:gpg-error 43 #:gpg-shell-error 44 #:key-not-found 45 #:key-not-trusted 46 #:author-not-trusted 47 #:installation-abort 34 48 35 (defpackage :asdf-install-customize 36 (:use "CL" "ASDF-INSTALL")) 49 ;; restarts 50 #:install-anyways 51 ) 52 53 #+(or :win32 :mswindows) 54 (:export 55 #:*cygwin-bin-directory* 56 #:*cygwin-bash-command*)) 57 58 (defpackage #:asdf-install-customize 59 (:use #:common-lisp #:asdf-install)) -
release/1.2/source/tools/asdf-install/digitool.lisp
r503 r9219 6 6 ;;; 2008-01-22 added exit-code checks to call-system 7 7 8 (in-package :asdf-install)8 (in-package #:asdf-install) 9 9 10 10 #+:digitool -
release/1.2/source/tools/asdf-install/installer.lisp
r2590 r9219 1 (in-package :asdf-install)1 (in-package #:asdf-install) 2 2 3 3 (pushnew :asdf-install *features*) 4 4 5 5 (defun installer-msg (stream format-control &rest format-arguments) 6 (apply #'format stream ";;; ASDF-INSTALL: ~@?~%" format-control format-arguments)) 7 8 9 #+:digitool 10 (defparameter *home-volume-name* 11 (second (pathname-directory (truename (user-homedir-pathname)))) 12 "Digitool MCL retains the OS 9 convention that ALL volumes have a 13 name which includes the startup volume. OS X doesn't know about this. 14 This figures in the home path and in the normalization for system 15 namestrings.") 16 17 (defvar *proxy* (get-env-var "http_proxy")) 18 19 (defvar *cclan-mirror* 20 (or (get-env-var "CCLAN_MIRROR") 21 "http://ftp.linux.org.uk/pub/lisp/cclan/")) 22 23 #+(or :win32 :mswindows) 24 (defvar *cygwin-bin-directory* 25 (pathname "C:\\PROGRA~1\\Cygwin\\bin\\")) 26 27 #+(or :win32 :mswindows) 28 (defvar *cygwin-bash-program* 29 "C:\\PROGRA~1\\Cygwin\\bin\\bash.exe") 30 31 (defvar *gnu-tar-program* 32 "tar" 33 "Path to the GNU tar program") 34 35 (eval-when (:compile-toplevel :load-toplevel :execute) 36 (defparameter *supported-defsystems* 37 (list :mk-defsystem 38 :asdf 39 40 ;; Add others. 41 ;; #+lispworks :common-defsystem 42 )) 43 44 45 (unless (some (lambda (defsys-tag) 46 (member defsys-tag *features*)) 47 *features*) 48 (error "ASDF-INSTALL requires one of the following \"defsystem\" utilities to work." 49 *supported-defsystems*))) 50 51 52 53 (defun directorify (name) 54 ;; input name may or may not have a trailing #\/, but we know we 55 ;; want a directory 56 (let ((path (pathname name))) 57 (if (pathname-name path) 58 (merge-pathnames 59 (make-pathname :directory `(:relative ,(pathname-name path)) 60 :name "") 61 path) 62 path))) 63 64 (defvar *asdf-install-dirs* 65 (directorify (or #+sbcl (get-env-var "SBCL_HOME") 66 (get-env-var "ASDF_INSTALL_DIR") 67 (make-pathname :directory 68 `(:absolute 69 #+digitool ,*home-volume-name* 70 "usr" "local" "asdf-install"))))) 71 72 #+sbcl ; Deprecated. 73 (define-symbol-macro *sbcl-home* *asdf-install-dirs*) 74 75 76 (defvar *private-asdf-install-dirs* 77 #+:sbcl 78 (merge-pathnames (make-pathname :directory '(:relative ".sbcl")) 79 (truename (user-homedir-pathname))) 80 #-:sbcl 81 (cond ((get-env-var "PRIVATE_ASDF_INSTALL_DIR") 82 (directorify (get-env-var "PRIVATE_ASDF_INSTALL_DIR"))) 83 (t 84 (merge-pathnames (make-pathname :directory '(:relative ".asdf-install-dir")) 85 (truename (user-homedir-pathname)))))) 86 87 #+sbcl ; Deprecated. 88 (define-symbol-macro *dot-sbcl* *private-asdf-install-dirs*) 89 90 91 (defvar *trusted-uids* nil) 92 93 (defvar *verify-gpg-signatures* t) 94 95 (defvar *safe-url-prefixes* nil) 96 97 (defvar *preferred-location* nil) 6 (apply #'format stream "~&;;; ASDF-INSTALL: ~@?~%" 7 format-control format-arguments)) 98 8 99 9 (defun verify-gpg-signatures-p (url) … … 109 19 (t t)))) 110 20 111 (defparameter *locations* 112 `((,(merge-pathnames (make-pathname :directory '(:relative "site")) 113 *asdf-install-dirs*) 114 ,(merge-pathnames (make-pathname :directory '(:relative "site-systems")) 115 *asdf-install-dirs*) 116 "System-wide install") 117 (,(merge-pathnames (make-pathname :directory '(:relative "site")) 118 *private-asdf-install-dirs*) 119 ,(merge-pathnames (make-pathname :directory '(:relative "systems")) 120 *private-asdf-install-dirs*) 121 "Personal installation"))) 122 123 124 #+(and (not :sbcl) :asdf) 125 (pushnew `(merge-pathnames ,(make-pathname :directory '(:relative "site-systems")) 126 ,*asdf-install-dirs*) 127 asdf:*central-registry* 128 :test #'equal) 129 130 #+(and (not :sbcl) :asdf) 131 (pushnew `(merge-pathnames ,(make-pathname :directory '(:relative "systems")) 132 ,*private-asdf-install-dirs*) 133 asdf:*central-registry* 134 :test #'equal) 135 136 #+mk-defsystem 137 (mk:add-registry-location 138 (merge-pathnames (make-pathname :directory '(:relative "site-systems")) 139 *private-asdf-install-dirs*)) 140 141 #+mk-defsystem 142 (mk:add-registry-location 143 (merge-pathnames (make-pathname :directory '(:relative "systems")) 144 *private-asdf-install-dirs*)) 145 21 (defun same-central-registry-entry-p (a b) 22 (flet ((ensure-string (x) 23 (typecase x 24 (string x) 25 (pathname (namestring (translate-logical-pathname x))) 26 (t nil)))) 27 (and (setf a (ensure-string a)) 28 (setf b (ensure-string b)) 29 a b (string-equal a b)))) 30 31 (defun add-registry-location (location) 32 (let ((location-directory (pathname-sans-name+type location))) 33 #+asdf 34 (pushnew location-directory 35 asdf:*central-registry* 36 :test #'same-central-registry-entry-p) 37 38 #+mk-defsystem 39 (mk:add-registry-location location-directory))) 146 40 147 41 ;;; Fixing the handling of *LOCATIONS* … … 162 56 (append *locations* (list (list site system-site loc-name))))) 163 57 164 165 166 (eval-when (:load-toplevel :execute)167 (let* ((*package* (find-package :asdf-install-customize))168 (file (probe-file (merge-pathnames169 (make-pathname :name ".asdf-install")170 (truename (user-homedir-pathname)))))171 )172 (when file (load file))))173 174 175 ;;;---------------------------------------------------------------------------176 ;;; Conditions.177 178 (define-condition download-error (error)179 ((url :initarg :url :reader download-url)180 (response :initarg :response :reader download-response))181 (:report (lambda (c s)182 (format s "Server responded ~A for GET ~A"183 (download-response c) (download-url c)))))184 185 (define-condition signature-error (error)186 ((cause :initarg :cause :reader signature-error-cause))187 (:report (lambda (c s)188 (format s "Cannot verify package signature: ~A"189 (signature-error-cause c)))))190 191 (define-condition gpg-error (error)192 ((message :initarg :message :reader gpg-error-message))193 (:report (lambda (c s)194 (format s "GPG failed with error status:~%~S"195 (gpg-error-message c)))))196 197 (define-condition no-signature (gpg-error) ())198 199 (define-condition key-not-found (gpg-error)200 ((key-id :initarg :key-id :reader key-id))201 (:report (lambda (c s)202 (format s "No key found for key id 0x~A. ~203 Try some command like ~% gpg --recv-keys 0x~A"204 (key-id c) (key-id c)))))205 206 (define-condition key-not-trusted (gpg-error)207 ((key-id :initarg :key-id :reader key-id)208 (key-user-name :initarg :key-user-name :reader key-user-name))209 (:report (lambda (c s)210 (format s "GPG warns that the key id 0x~A (~A) is not fully trusted"211 (key-id c) (key-user-name c)))))212 213 (define-condition author-not-trusted (gpg-error)214 ((key-id :initarg :key-id :reader key-id)215 (key-user-name :initarg :key-user-name :reader key-user-name))216 (:report (lambda (c s)217 (format s "~A (key id ~A) is not on your package supplier list"218 (key-user-name c) (key-id c)))))219 220 221 58 ;;;--------------------------------------------------------------------------- 222 59 ;;; URL handling. … … 232 69 (assert (string-equal url "http://" :end1 7)) 233 70 (let ((port-start (position #\: url :start 7))) 234 (if port-start (parse-integer url :start (1+ port-start) :junk-allowed t) 80))) 71 (if port-start 72 (parse-integer url :start (1+ port-start) :junk-allowed t) 80))) 235 73 236 74 ; This is from Juri Pakaste's <juri@iki.fi> base64.lisp … … 269 107 result)) 270 108 271 (defvar *proxy-user* nil) 272 (defvar *proxy-passwd* nil) 109 (defun request-uri (url) 110 (assert (string-equal url "http://" :end1 7)) 111 (if *proxy* 112 url 113 (let ((path-start (position #\/ url :start 7))) 114 (assert (and path-start) nil "url does not specify a file.") 115 (subseq url path-start)))) 273 116 274 117 (defun url-connection (url) … … 276 119 (host (url-host url))) 277 120 (format stream "GET ~A HTTP/1.0~C~CHost: ~A~C~CCookie: CCLAN-SITE=~A~C~C" 278 url#\Return #\Linefeed121 (request-uri url) #\Return #\Linefeed 279 122 host #\Return #\Linefeed 280 123 *cclan-mirror* #\Return #\Linefeed) … … 285 128 (format stream "~C~C" #\Return #\Linefeed) 286 129 (force-output stream) 287 (flet (#-:digitool 288 (read-header-line () 289 (read-line stream)) 290 #+:digitool 291 (read-header-line (&aux (line (make-array 16 292 :element-type 'character 293 :adjustable t 294 :fill-pointer 0)) 295 (byte nil)) 296 (print (multiple-value-bind (reader arg) 297 (ccl::stream-reader stream) 298 (loop (setf byte (funcall reader arg)) 299 (case byte 300 ((nil) 301 (return)) 302 ((#.(char-code #\Return) 303 #.(char-code #\Linefeed)) 304 (case (setf byte (funcall reader arg)) 305 ((nil #.(char-code #\Return) #.(char-code #\Linefeed))) 306 (t (ccl:stream-untyi stream byte))) 307 (return)) 308 (t 309 (vector-push-extend (code-char byte) line)))) 310 (when (or byte (plusp (length line))) 311 line))))) 312 (list 313 (let* ((l (read-header-line)) 314 (space (position #\Space l))) 315 (parse-integer l :start (1+ space) :junk-allowed t)) 316 (loop for line = (read-header-line) 317 until (or (null line) 318 (zerop (length line)) 319 (eql (elt line 0) (code-char 13))) 320 collect 321 (let ((colon (position #\: line))) 322 (cons (intern (string-upcase (subseq line 0 colon)) :keyword) 323 (string-trim (list #\Space (code-char 13)) 324 (subseq line (1+ colon)))))) 325 stream)))) 326 327 328 (defun download-files-for-package (package-name-or-url file-name) 329 (let ((url (if (= (mismatch package-name-or-url "http://") 7) 330 package-name-or-url 331 (format nil "http://www.cliki.net/~A?download" 332 package-name-or-url))) 333 ) 334 (destructuring-bind (response headers stream) 335 (block got 336 (loop 337 (destructuring-bind (response headers stream) (url-connection url) 338 (unless (member response '(301 302)) 339 (return-from got (list response headers stream))) 340 (close stream) 341 (setf url (cdr (assoc :location headers)))))) 342 (when (>= response 400) 343 (error 'download-error :url url :response response)) 344 (let ((length (parse-integer (or (cdr (assoc :content-length headers)) "") 345 :junk-allowed t))) 346 (installer-msg t "Downloading ~A bytes from ~A to ~A ..." 347 (or length "some unknown number of") 348 url 349 file-name) 350 (force-output) 351 #+:clisp (setf (stream-element-type stream) 352 '(unsigned-byte 8)) 353 (with-open-file (o file-name :direction :output 354 #+(or :clisp :digitool (and :lispworks :win32)) 355 :element-type 356 #+(or :clisp :digitool (and :lispworks :win32)) 357 '(unsigned-byte 8) 358 :if-exists :supersede) 359 #+(or :cmu :digitool) 360 (copy-stream stream o) 361 #-(or :cmu :digitool) 362 (if length 363 (let ((buf (make-array length 364 :element-type 365 (stream-element-type stream)))) 366 #-:clisp (read-sequence buf stream) 367 #+:clisp (ext:read-byte-sequence buf stream :no-hang nil) 368 (write-sequence buf o)) 369 (copy-stream stream o)))) 370 (close stream) 371 (terpri) 372 (restart-case 373 (verify-gpg-signature/url url file-name) 374 (skip-gpg-check (&rest rest) 375 :report "Don't ckeck GPG signature for this package" 376 (declare (ignore rest)) 377 nil))))) 378 379 380 (defun read-until-eof (stream) 381 (with-output-to-string (o) 382 (copy-stream stream o))) 383 130 (list 131 (let* ((l (read-header-line stream)) 132 (space (position #\Space l))) 133 (parse-integer l :start (1+ space) :junk-allowed t)) 134 (loop for line = (read-header-line stream) 135 until (or (null line) 136 (zerop (length line)) 137 (eql (elt line 0) (code-char 13))) 138 collect 139 (let ((colon (position #\: line))) 140 (cons (intern (string-upcase (subseq line 0 colon)) :keyword) 141 (string-trim (list #\Space (code-char 13)) 142 (subseq line (1+ colon)))))) 143 stream))) 144 145 (defun download-link-for-package (package-name-or-url) 146 (if (= (mismatch package-name-or-url "http://") 7) 147 package-name-or-url 148 (format nil "http://www.cliki.net/~A?download" 149 package-name-or-url))) 150 151 (defun download-link-for-signature (url) 152 (concatenate 'string url ".asc")) 153 154 (defun download-files-for-package (package-name-or-url) 155 (multiple-value-bind (package-url package-file) 156 (download-url-to-temporary-file 157 (download-link-for-package package-name-or-url)) 158 (if (verify-gpg-signatures-p package-name-or-url) 159 (multiple-value-bind (signature-url signature-file) 160 (download-url-to-temporary-file 161 (download-link-for-signature package-url)) 162 (declare (ignore signature-url)) 163 (values package-file signature-file)) 164 (values package-file nil)))) 384 165 385 (defun verify-gpg-signature/string (string file-name) 386 (let ((gpg-stream (make-stream-from-gpg-command string file-name)) 387 tags) 388 (unwind-protect 389 (loop for l = (read-line gpg-stream nil nil) 390 while l 391 do (print l) 392 when (> (mismatch l "[GNUPG:]") 6) 393 do (destructuring-bind (_ tag &rest data) 394 (split-sequence:split-sequence-if (lambda (x) 395 (find x '(#\Space #\Tab))) 396 l) 397 (declare (ignore _)) 398 (pushnew (cons (intern tag :keyword) 399 data) tags))) 400 (ignore-errors 401 (close gpg-stream))) 402 ;; test for obvious key/sig problems 403 (let ((errsig (assoc :errsig tags))) 404 (and errsig (error 'key-not-found :key-id (second errsig)))) 405 (let ((badsig (assoc :badsig tags))) 406 (and badsig (error 'key-not-found :key-id (second badsig)))) 407 (let* ((good (assoc :goodsig tags)) 408 (id (second good)) 409 (name (format nil "~{~A~^ ~}" (nthcdr 2 good)))) 410 ;; good signature, but perhaps not trusted 411 (unless (or (assoc :trust_ultimate tags) 412 (assoc :trust_fully tags)) 413 (cerror "Install the package anyway" 414 'key-not-trusted 415 :key-user-name name 416 :key-id id)) 417 (loop 418 (when 419 (restart-case 420 (or (assoc id *trusted-uids* :test #'equal) 421 (error 'author-not-trusted 422 :key-user-name name 423 :key-id id)) 424 (add-key (&rest rest) 425 :report "Add to package supplier list" 426 (declare (ignore rest)) 427 (pushnew (list id name) *trusted-uids*))) 428 (return)))))) 429 430 431 (defun verify-gpg-signature/url (url file-name) 432 (when (verify-gpg-signatures-p url) 433 (destructuring-bind (response headers stream) 434 (url-connection (concatenate 'string url ".asc")) 435 (unwind-protect 436 (flet (#-:digitool 437 (read-signature (data stream) 438 (read-sequence data stream)) 439 #+:digitool 440 (read-signature (data stream) 441 (multiple-value-bind (reader arg) 442 (ccl:stream-reader stream) 443 (let ((byte 0)) 444 (dotimes (i (length data)) 445 (unless (setf byte (funcall reader arg)) 446 (error 'download-error :url (concatenate 'string url ".asc") 447 :response 200)) 448 (setf (char data i) (code-char byte))))))) 449 (if (= response 200) 450 (let ((data (make-string (parse-integer 451 (cdr (assoc :content-length headers)) 452 :junk-allowed t)))) 453 (read-signature data stream) 454 (verify-gpg-signature/string data file-name)) 455 (error 'download-error :url (concatenate 'string url ".asc") 456 :response response))) 457 (close stream))))) 458 459 460 (define-condition installation-abort (condition) 461 () 462 (:report (lambda (c s) 463 (declare (ignore c)) 464 (installer-msg s "Installation aborted.")))) 465 466 467 (defun where () 166 (defun verify-gpg-signature (file-name signature-name) 167 (block verify 168 (loop 169 (restart-case 170 (let ((tags (gpg-results file-name signature-name))) 171 ;; test that command returned something 172 (unless tags 173 (error 'gpg-shell-error)) 174 ;; test for obvious key/sig problems 175 (let ((errsig (header-value :errsig tags))) 176 (and errsig (error 'key-not-found :key-id errsig))) 177 (let ((badsig (header-value :badsig tags))) 178 (and badsig (error 'key-not-found :key-id badsig))) 179 (let* ((good (header-value :goodsig tags)) 180 (id (first good)) 181 (name (format nil "~{~A~^ ~}" (rest good)))) 182 ;; good signature, but perhaps not trusted 183 (restart-case 184 (let ((trusted? (or (header-pair :trust_ultimate tags) 185 (header-pair :trust_fully tags))) 186 (in-list? (assoc id *trusted-uids* :test #'equal))) 187 (cond ((or trusted? in-list?) 188 ;; ok 189 ) 190 ((not trusted?) 191 (error 'key-not-trusted 192 :key-user-name name :key-id id)) 193 ((not in-list?) 194 (error 'author-not-trusted 195 :key-user-name name :key-id id)))) 196 (add-key (&rest rest) 197 :report "Add to package supplier list" 198 (declare (ignore rest)) 199 (pushnew (list id name) *trusted-uids*)))) 200 (return-from verify t)) 201 (install-anyways 202 (&rest rest) 203 :report "Don't check GPG signature for this package" 204 (declare (ignore rest)) 205 (return-from verify t)) 206 (retry-gpg-check 207 (&rest args) 208 :report "Retry GPG check \(e.g., after downloading the key\)" 209 (declare (ignore args)) 210 nil))))) 211 212 (defun header-value (name headers) 213 "Searchers headers for name _without_ case sensitivity. Headers should be an alist mapping symbols to values; name a symbol. Returns the value if name is found or nil if it is not." 214 (cdr (header-pair name headers))) 215 216 (defun header-pair (name headers) 217 "Searchers headers for name _without_ case sensitivity. Headers should be an alist mapping symbols to values; name a symbol. Returns the \(name value\) pair if name is found or nil if it is not." 218 (assoc name headers 219 :test (lambda (a b) 220 (string-equal (symbol-name a) (symbol-name b))))) 221 222 (defun validate-preferred-location () 223 (typecase *preferred-location* 224 (null t) 225 ((integer 0) 226 (assert (<= 1 *preferred-location* (length *locations*)) 227 (*preferred-location*) 228 'invalid-preferred-location-number-error 229 :preferred-location *preferred-location*)) 230 ((or symbol string) 231 (assert (find *preferred-location* *locations* 232 :test (if (typep *preferred-location* 'symbol) 233 #'eq #'string-equal) :key #'third) 234 (*preferred-location*) 235 'invalid-preferred-location-name-error 236 :preferred-location *preferred-location*)) 237 (t 238 (assert nil 239 (*preferred-location*) 240 'invalid-preferred-location-error 241 :preferred-location *preferred-location*))) 242 *preferred-location*) 243 244 (defun select-location () 468 245 (loop with n-locations = (length *locations*) 469 for response = (or *preferred-location* 470 (progn 471 (format t "Install where?~%") 472 (loop for (source system name) in *locations* 473 for i from 0 474 do (format t "~A) ~A: ~% System in ~A~% Files in ~A ~%" 475 i name system source)) 476 (format t "~D) Abort installation.~% --> " n-locations) 477 (force-output) 478 (read))) 479 when (and (numberp response) 480 (<= 0 response (1- n-locations))) 481 return (elt *locations* response) 482 when (and (numberp response) 483 (= response n-locations)) 484 do (abort (make-condition 'installation-abort)))) 246 for response = (progn 247 (format t "Install where?~%") 248 (loop for (source system name) in *locations* 249 for i from 1 250 do (format t "~A) ~A: ~% System in ~A~% Files in ~A ~%" 251 i name system source)) 252 (format t "0) Abort installation.~% --> ") 253 (force-output) 254 (read)) 255 when (and (numberp response) 256 (<= 1 response n-locations)) 257 return response 258 when (and (numberp response) 259 (zerop response)) 260 do (abort (make-condition 'installation-abort)))) 261 262 (defun install-location () 263 (validate-preferred-location) 264 (let ((location-selection (or *preferred-location* 265 (select-location)))) 266 (etypecase location-selection 267 (integer 268 (elt *locations* (1- location-selection))) 269 ((or symbol string) 270 (find location-selection *locations* :key #'third 271 :test (if (typep location-selection 'string) 272 #'string-equal #'eq)))))) 485 273 486 274 487 275 ;;; install-package -- 276 277 (defun find-shell-command (command) 278 (loop for directory in *shell-search-paths* do 279 (let ((target (make-pathname :name command :type nil 280 :directory directory))) 281 (when (probe-file target) 282 (return-from find-shell-command (namestring target))))) 283 (values nil)) 284 285 (defun tar-command () 286 #-(or :win32 :mswindows) 287 (find-shell-command *gnu-tar-program*) 288 #+(or :win32 :mswindows) 289 *cygwin-bash-program*) 290 291 (defun tar-arguments (source packagename) 292 #-(or :win32 :mswindows :scl) 293 (list "-C" (namestring (truename source)) 294 "-xzvf" (namestring (truename packagename))) 295 #+(or :win32 :mswindows) 296 (list "-l" 297 "-c" 298 (format nil "\"tar -C \\\"`cygpath '~A'`\\\" -xzvf \\\"`cygpath '~A'`\\\"\"" 299 (namestring (truename source)) 300 (namestring (truename packagename)))) 301 #+scl 302 (list "-C" (ext:unix-namestring (truename source)) 303 "-xzvf" (ext:unix-namestring (truename packagename)))) 304 305 (defun extract-using-tar (to-dir tarball) 306 (let ((tar-command (tar-command))) 307 (if (and tar-command (probe-file tar-command)) 308 (return-output-from-program tar-command 309 (tar-arguments to-dir tarball)) 310 (warn "Cannot find tar command ~S." tar-command)))) 311 312 (defun extract (to-dir tarball) 313 (or (some #'(lambda (extractor) (funcall extractor to-dir tarball)) 314 *tar-extractors*) 315 (error "Unable to extract tarball ~A." tarball))) 488 316 489 317 (defun install-package (source system packagename) … … 491 319 (ensure-directories-exist source) 492 320 (ensure-directories-exist system) 493 (let* ((tar 494 (or #-(or :win32 :mswindows) 495 (return-output-from-program *gnu-tar-program* 496 (list "-C" (namestring (truename source)) 497 "-xzvf" (namestring (truename packagename)))) 498 #+(or :win32 :mswindows) 499 (return-output-from-program *cygwin-bash-program* 500 (list "-l" 501 "-c" 502 (format nil "\"tar -C \\\"`cygpath '~A'`\\\" -xzvf \\\"`cygpath '~A'`\\\"\"" 503 (namestring (truename source)) 504 (namestring (truename packagename))))) 505 (error "ASDF-INSTALL: can't untar ~S." packagename))) 321 (let* ((tar (extract source packagename)) 506 322 (pos-slash (or (position #\/ tar) 507 323 (position #\Return tar) … … 511 327 (make-pathname :directory 512 328 `(:relative ,(subseq tar 0 pos-slash))) 513 source)) 514 ) 515 (princ tar) 329 source))) 330 ;(princ tar) 516 331 (loop for sysfile in (append 517 332 (directory 518 (make-pathname :defaults (print *default-pathname-defaults*)333 (make-pathname :defaults *default-pathname-defaults* 519 334 :name :wild 520 335 :type "asd")) 521 336 (directory 522 (make-pathname :defaults (print *default-pathname-defaults*)337 (make-pathname :defaults *default-pathname-defaults* 523 338 :name :wild 524 339 :type "system"))) 525 #-(or :win32 :mswindows) 526 do 527 #-(or :win32 :mswindows) 528 (let ((target (merge-pathnames 529 (make-pathname :name (pathname-name sysfile) 530 :type (pathname-type sysfile)) 531 system))) 532 (when (probe-file target) 533 (unlink-file target)) 534 (symlink-files sysfile target)) 535 collect sysfile))) 536 537 538 #| Original 539 (defun install-package (source system packagename) 540 "Returns a list of asdf system names for installed asdf systems" 541 (ensure-directories-exist source) 542 (ensure-directories-exist system) 543 (let* ((tar 544 (or 545 #-(or :win32 :mswindows) 546 (return-output-from-program "tar" 547 (list "-C" (system-namestring source) 548 "-xzvf" (system-namestring packagename))) 549 #+(or :win32 :mswindows) 550 (return-output-from-program "sh" 551 (list "-c" 552 (format nil "\"tar -C \\\"`cygpath '~A'`\\\" -xzvf \\\"`cygpath '~A'`\\\"\"" 553 (namestring (truename source)) 554 (namestring (truename packagename))))) 555 (error "can't untar"))) 556 (pos-slash (position-if #'(lambda (c) 557 (find c #(#\/ #\Return #\Linefeed))) 558 tar)) 559 (*default-pathname-defaults* 560 (merge-pathnames 561 (make-pathname :directory 562 `(:relative ,(subseq tar 0 pos-slash))) 563 source))) 564 (princ tar) 565 (loop for asd in (directory 566 (make-pathname :defaults (print *default-pathname-defaults*) 567 :name :wild 568 :type "asd")) 569 #-(or :win32 :mswindows) 570 do 571 #-(or :win32 :mswindows) 572 (let ((target (merge-pathnames 573 (make-pathname :name (pathname-name asd) 574 :type (pathname-type asd)) 575 system))) 576 (when (probe-file target) 577 (unlink-file target)) 578 (symlink-files asd target)) 579 collect (pathname-name asd)))) 580 |# 581 340 do (maybe-symlink-sysfile system sysfile) 341 do (installer-msg t "Found system definition: ~A" sysfile) 342 do (maybe-update-central-registry sysfile) 343 collect sysfile))) 344 345 (defun maybe-update-central-registry (sysfile) 346 ;; make sure that the systems we install are accessible in case 347 ;; asdf-install:*locations* and asdf:*central-registry* are out 348 ;; of sync 349 (add-registry-location sysfile)) 582 350 583 351 (defun temp-file-name (p) 584 (let* ((pos-slash (position #\/ p :from-end t)) 585 (pos-dot (position #\. p :start (or pos-slash 0)))) 586 (merge-pathnames 587 (make-pathname 588 :name (subseq p (if pos-slash (1+ pos-slash) 0) pos-dot) 589 :type "asdf-install-tmp") 590 #+:clisp (user-homedir-pathname)))) 352 (declare (ignore p)) 353 (let ((pathname nil)) 354 (loop for i = 0 then (1+ i) do 355 (setf pathname 356 (merge-pathnames 357 (make-pathname 358 :name (format nil "asdf-install-~d" i) 359 :type "asdf-install-tmp") 360 *temporary-directory*)) 361 (unless (probe-file pathname) 362 (return-from temp-file-name pathname))))) 591 363 592 364 … … 594 366 ;;; This is the external entry point. 595 367 596 (defun install (&rest packages) 597 (let ((*temporary-files* nil) 598 (*trusted-uids* 599 (let ((p (merge-pathnames "trusted-uids.lisp" *private-asdf-install-dirs*))) 600 (when (probe-file p) 601 (with-open-file (f p) (read f))))) 602 ;; (installed-packages nil) 603 ) 368 (defun install (packages &key (propagate nil) (where *preferred-location*)) 369 (let* ((*preferred-location* where) 370 (*temporary-files* nil) 371 (trusted-uid-file 372 (merge-pathnames "trusted-uids.lisp" *private-asdf-install-dirs*)) 373 (*trusted-uids* 374 (when (probe-file trusted-uid-file) 375 (with-open-file (f trusted-uid-file) (read f)))) 376 (old-uids (copy-list *trusted-uids*)) 377 #+asdf 378 (*defined-systems* (if propagate 379 (make-hash-table :test 'equal) 380 *defined-systems*)) 381 (packages (if (atom packages) (list packages) packages)) 382 (*propagate-installation* propagate) 383 (*systems-installed-this-time* nil)) 604 384 (unwind-protect 605 (destructuring-bind (source system name) (where) 606 (declare (ignore name)) 607 (labels ((one-iter (packages) 608 (let ((installed-package-sysfiles 609 (loop for p in (mapcar #'string packages) 610 unless 611 #+(or :sbcl :alisp) (probe-file p) 612 #-(or :sbcl :alisp) (and (/= (mismatch p "http://") 7) 613 (probe-file p)) 614 do (let ((tmp (temp-file-name p))) 615 (pushnew tmp *temporary-files*) 616 (download-files-for-package p tmp) 617 (setf p tmp)) 618 end 619 do (installer-msg t "Installing ~A in ~A, ~A" 620 p 621 source 622 system) 623 append (install-package source 624 system 625 p))) 626 ) 627 (dolist (sysfile installed-package-sysfiles) 628 (handler-bind 629 ( 630 #+asdf 631 (asdf:missing-dependency 632 (lambda (c) 633 (installer-msg t 634 "Downloading package ~A, required by ~A~%" 635 (asdf::missing-requires c) 636 (asdf:component-name 637 (asdf::missing-required-by c))) 638 (one-iter (list 639 (symbol-name 640 (asdf::missing-requires c)))) 641 (invoke-restart 'retry))) 642 643 #+mk-defsystem 644 (make:missing-component 645 (lambda (c) 646 (installer-msg t 647 "Downloading package ~A, required by ~A~%" 648 (make:missing-component-name c) 649 (pathname-name sysfile) ; This should work. 650 ) 651 (one-iter (list (make:missing-component-name c))) 652 (invoke-restart 'retry))) 653 ) 654 655 (loop (multiple-value-bind (ret restart-p) 656 (with-simple-restart 657 (retry "Retry installation") 658 (load-system-definition sysfile)) 659 (declare (ignore ret)) 660 (unless restart-p (return)))) 661 )))) 662 ) 663 (one-iter packages))) 664 (let ((p (merge-pathnames "trusted-uids.lisp" *private-asdf-install-dirs*))) 665 (when (probe-file p) 666 (with-open-file (out p 667 :direction :output 668 :if-exists :supersede) 669 (with-standard-io-syntax 670 (prin1 *trusted-uids* out))))) 385 (destructuring-bind (source system name) (install-location) 386 (declare (ignore name)) 387 (labels 388 ((one-iter (packages) 389 (let ((packages-to-install nil)) 390 (loop for p in (mapcar #'string packages) do 391 (cond ((local-archive-p p) 392 (setf packages-to-install 393 (append packages-to-install 394 (install-package source system p)))) 395 (t 396 (multiple-value-bind (package signature) 397 (download-files-for-package p) 398 (when (verify-gpg-signatures-p p) 399 (verify-gpg-signature package signature)) 400 (installer-msg t "Installing ~A in ~A, ~A" 401 p source system) 402 (install-package source system package)) 403 (setf packages-to-install 404 (append packages-to-install 405 (list p)))))) 406 (dolist (package packages-to-install) 407 (setf package 408 (etypecase package 409 (symbol package) 410 (string (intern package :asdf-install)) 411 (pathname (intern 412 (namestring (pathname-name package)) 413 :asdf-install)))) 414 (handler-bind 415 ( 416 #+asdf 417 (asdf:missing-dependency 418 (lambda (c) 419 (installer-msg 420 t 421 "Downloading package ~A, required by ~A~%" 422 (asdf::missing-requires c) 423 (asdf:component-name 424 (asdf::missing-required-by c))) 425 (one-iter 426 (list (asdf::coerce-name 427 (asdf::missing-requires c)))) 428 (invoke-restart 'retry))) 429 #+mk-defsystem 430 (make:missing-component 431 (lambda (c) 432 (installer-msg 433 t 434 "Downloading package ~A, required by ~A~%" 435 (make:missing-component-name c) 436 package) 437 (one-iter (list (make:missing-component-name c))) 438 (invoke-restart 'retry)))) 439 (loop (multiple-value-bind (ret restart-p) 440 (with-simple-restart 441 (retry "Retry installation") 442 (push package *systems-installed-this-time*) 443 (load-package package)) 444 (declare (ignore ret)) 445 (unless restart-p (return))))))))) 446 (one-iter packages))) 447 ;;; cleanup 448 (unless (equal old-uids *trusted-uids*) 449 (let ((create-file-p nil)) 450 (unless (probe-file trusted-uid-file) 451 (installer-msg t "Trusted UID file ~A does not exist" 452 (namestring trusted-uid-file)) 453 (setf create-file-p 454 (y-or-n-p "Do you want to create the file?"))) 455 (when (or create-file-p (probe-file trusted-uid-file)) 456 (ensure-directories-exist trusted-uid-file) 457 (with-open-file (out trusted-uid-file 458 :direction :output 459 :if-exists :supersede) 460 (with-standard-io-syntax 461 (prin1 *trusted-uids* out)))))) 671 462 (dolist (l *temporary-files* t) 672 (when (probe-file l) (delete-file l)))))) 673 674 675 (defun load-system-definition (sysfile) 676 (declare (type pathname sysfile)) 463 (when (probe-file l) (delete-file l)))) 464 (nreverse *systems-installed-this-time*))) 465 466 (defun local-archive-p (package) 467 #+(or :sbcl :allegro) (probe-file package) 468 #-(or :sbcl :allegro) (and (/= (mismatch package "http://") 7) 469 (probe-file package))) 470 471 (defun load-package (package) 677 472 #+asdf 678 (when (or (string-equal "asd" (pathname-type sysfile)) 679 (string-equal "asdf" (pathname-type sysfile))) 680 (installer-msg t "Loading system ~S via ASDF." (pathname-name sysfile)) 681 (asdf:operate 'asdf:load-op (pathname-name sysfile))) 682 473 (progn 474 (installer-msg t "Loading system ~S via ASDF." package) 475 (asdf:operate 'asdf:load-op package)) 683 476 #+mk-defsystem 684 (when (string-equal "system" (pathname-type sysfile)) 685 (installer-msg t "Loading system ~S via MK:DEFSYSTEM." (pathname-name sysfile)) 686 (mk:load-system (pathname-name sysfile)))) 687 688 689 #| Original. 690 (defun install (&rest packages) 691 (let ((*temporary-files* nil) 692 (*trusted-uids* 693 (let ((p (merge-pathnames "trusted-uids.lisp" *private-asdf-install-dirs*))) 694 (when (probe-file p) 695 (with-open-file (f p) (read f)))))) 696 (unwind-protect 697 (destructuring-bind (source system name) (where) 698 (declare (ignore name)) 699 (labels ((one-iter (packages) 700 (dolist (asd 701 (loop for p in (mapcar 'string packages) 702 unless #+(or :sbcl :alisp) 703 (probe-file p) 704 #-(or :sbcl :alisp) 705 (and (/= (mismatch p "http://") 7) 706 (probe-file p)) 707 do (let ((tmp (temp-file-name p))) 708 (pushnew tmp *temporary-files*) 709 (download-files-for-package p tmp) 710 (setf p tmp)) 711 end 712 do (format t "Installing ~A in ~A,~A~%" 713 p source system) 714 append (install-package source system p))) 715 (handler-bind 716 ((asdf:missing-dependency 717 (lambda (c) 718 (format t 719 "Downloading package ~A, required by ~A~%" 720 (asdf::missing-requires c) 721 (asdf:component-name 722 (asdf::missing-required-by c))) 723 (one-iter (list 724 (symbol-name 725 (asdf::missing-requires c)))) 726 (invoke-restart 'retry)))) 727 (loop 728 (multiple-value-bind (ret restart-p) 729 (with-simple-restart 730 (retry "Retry installation") 731 (asdf:operate 'asdf:load-op asd)) 732 (declare (ignore ret)) 733 (unless restart-p (return)))))))) 734 (one-iter packages))) 735 (let ((p (merge-pathnames "trusted-uids.lisp" *private-asdf-install-dirs*))) 736 (with-open-file (out p :direction :output 737 :if-exists :supersede) 738 (with-standard-io-syntax 739 (prin1 *trusted-uids* out)))) 740 (dolist (l *temporary-files*) 741 (when (probe-file l) (delete-file l)))))) 742 |# 743 477 (progn 478 (installer-msg t "Loading system ~S via MK:DEFSYSTEM." package) 479 (mk:load-system package))) 744 480 745 481 ;;; uninstall -- … … 749 485 (let* ((asd (asdf:system-definition-pathname system)) 750 486 (system (asdf:find-system system)) 751 (dir ( asdf::pathname-sans-name+type487 (dir (pathname-sans-name+type 752 488 (asdf::resolve-symlinks asd)))) 753 489 (when (or (not prompt) … … 757 493 #-(or :win32 :mswindows) 758 494 (delete-file asd) 759 (asdf:run-shell-command "rm -r '~A'" (namestring (truename dir))))) 495 (let ((dir (#-scl namestring #+scl ext:unix-namestring (truename dir)))) 496 (when dir 497 (asdf:run-shell-command "rm -r '~A'" dir))))) 760 498 761 499 #+mk-defsystem … … 777 515 ))) 778 516 779 780 #| Original781 (defun uninstall (system &optional (prompt t))782 (let* ((asd (asdf:system-definition-pathname system))783 (system (asdf:find-system system))784 (dir (asdf::pathname-sans-name+type785 (asdf::resolve-symlinks asd))))786 (when (or (not prompt)787 (y-or-n-p788 "Delete system ~A~%asd file: ~A~%sources: ~A~%Are you sure?"789 system asd dir))790 #-(or :win32 :mswindows)791 (delete-file asd)792 (asdf:run-shell-command "rm -r '~A'" (namestring (truename dir))))))793 |#794 795 517 796 518 ;;; some day we will also do UPGRADE, but we need to sort out version … … 814 536 (return-from sysdef-source-dir-search file))))))) 815 537 538 (defmethod asdf:find-component :around 539 ((module (eql nil)) name &optional version) 540 (declare (ignore version)) 541 (when (or (not *propagate-installation*) 542 (member name *systems-installed-this-time* 543 :test (lambda (a b) 544 (flet ((ensure-string (x) 545 (etypecase x 546 (symbol (symbol-name x)) 547 (string x)))) 548 (string-equal (ensure-string a) (ensure-string b)))))) 549 (call-next-method))) 550 551 (defun show-version-information () 552 (let ((version (asdf-install-version))) 553 (if version 554 (format *standard-output* "~&;;; ASDF-Install version ~A" 555 version) 556 (format *standard-output* "~&;;; ASDF-Install version unknown; unable to find ASDF system definition.")) 557 (values))) 558 559 (defun asdf-install-version () 560 "Returns the ASDf-Install version information as a string or nil if it cannot be determined." 561 (let ((system (asdf:find-system 'asdf-install))) 562 (when system (asdf:component-version system)))) 563 564 ;; load customizations if any 565 (eval-when (:load-toplevel :execute) 566 (let* ((*package* (find-package :asdf-install-customize)) 567 (file (probe-file (merge-pathnames 568 (make-pathname :name ".asdf-install") 569 (truename (user-homedir-pathname)))))) 570 (when file (load file)))) 571 816 572 ;;; end of file -- install.lisp -- -
release/1.2/source/tools/asdf-install/load-asdf-install.lisp
r928 r9219 5 5 6 6 (eval-when (:load-toplevel :execute) 7 (unless (find-package "ASDF-INSTALL-LOADER")8 (make-package "ASDF-INSTALL-LOADER" :use '("COMMON-LISP"))))7 (unless (find-package '#:asdf-install-loader) 8 (make-package '#:asdf-install-loader :use '(#:common-lisp)))) 9 9 10 (in-package "ASDF-INSTALL-LOADER")10 (in-package :asdf-install-loader) 11 11 12 12 (eval-when (:compile-toplevel :load-toplevel :execute) … … 67 67 (load-and-or-compile "ASDF-INSTALL-LIBRARY:port.lisp") 68 68 69 (unless (find-package "SPLIT-SEQUENCE")69 (unless (find-package '#:split-sequence) 70 70 (load-and-or-compile "ASDF-INSTALL-LIBRARY:split-sequence.lisp")) 71 71 72 #| 73 ;; Implementation dependencies (in alphabetical order). 74 #+allegro 75 (load-and-or-compile "ASDF-INSTALL-LIBRARY:impl-dependent;allegro.lisp") 72 (load-and-or-compile "ASDF-INSTALL-LIBRARY:installer.lisp") 76 73 77 #+clisp78 (load-and-or-compile "ASDF-INSTALL-LIBRARY:impl-dependent;clisp.lisp")79 80 #+(or cmu sbcl) ; They are still very similar.81 (load-and-or-compile "ASDF-INSTALL-LIBRARY:impl-dependent;cmucl.lisp")82 83 #+digitool84 (load-and-or-compile "ASDF-INSTALL-LIBRARY:digitool.lisp")85 86 #+lcl87 (load-and-or-compile "ASDF-INSTALL-LIBRARY:impl-dependent;lcl.lisp")88 89 #+lispworks90 (load-and-or-compile "ASDF-INSTALL-LIBRARY:impl-dependent;lispworks.lisp")91 |#92 93 94 (load-and-or-compile "ASDF-INSTALL-LIBRARY:installer.lisp")95 74 ;; (load-and-or-compile "ASDF-INSTALL-LIBRARY:loader.lisp") 96 75 … … 100 79 101 80 ;; To clean a minimum (and to make things difficult to debug)... 102 ;; (delete-package "ASDF-INSTALL-LOADER")81 ;; (delete-package '#:asdf-install-loader) 103 82 ) 104 83 -
release/1.2/source/tools/asdf-install/loader.lisp
r503 r9219 3 3 (eval-when (:load-toplevel) 4 4 (unless (find-package 'asdf) 5 (require 'asdf)) 5 (require 'asdf))) 6 7 (eval-when (:load-toplevel) 8 (unless (find-package 'asdf) 9 (error "ASDF-Install requires ASDF to load")) 6 10 (let ((asdf::*verbose-out* nil)) 7 11 (require 'asdf-install))) 8 12 13 #+sbcl 9 14 (defun run () 10 15 (handler-case -
release/1.2/source/tools/asdf-install/port.lisp
r2590 r9219 1 (in-package :asdf-install)1 (in-package #:asdf-install) 2 2 3 3 (defvar *temporary-files*) 4 4 5 (defparameter *shell-path* "/bin/sh" 6 "The path to a Bourne compatible command shell in physical pathname notation.") 7 5 8 (eval-when (:load-toplevel :compile-toplevel :execute) 6 #+:lispworks7 (require "comm")8 9 #+:allegro 9 10 (require :osi) … … 11 12 (require :socket) 12 13 #+:digitool 13 (require :opentransport)) 14 (require :opentransport) 15 #+:ecl 16 (require :sockets) 17 #+:lispworks 18 (require "comm") 19 ) 14 20 15 21 (defun get-env-var (name) 22 #+:allegro (sys:getenv name) 23 #+:clisp (ext:getenv name) 24 #+:cmu (cdr (assoc (intern (substitute #\_ #\- name) 25 :keyword) 26 ext:*environment-list*)) 27 #+:ecl (ext:getenv name) 28 #+:lispworks (lw:environment-variable name) 29 #+(or :mcl :openmcl) (ccl::getenv name) 16 30 #+:sbcl (sb-ext:posix-getenv name) 17 #+:cmu (cdr (assoc (intern (substitute #\_ #\- name) 18 :keyword) 19 ext:*environment-list*)) 20 #+:allegro (sys:getenv name) 21 #+:lispworks (lw:environment-variable name) 22 #+:clisp (ext:getenv name) 23 #+(or :mcl :openmcl) (ccl::getenv name)) 31 #+:scl (cdr (assoc name ext:*environment-list* :test #'string=)) 32 ) 24 33 25 34 #-:digitool … … 39 48 (unless truename 40 49 (setf truename 41 (translate-logical-pathname42 (merge-pathnames pathname *default-pathname-defaults*))))50 (translate-logical-pathname 51 (merge-pathnames pathname *default-pathname-defaults*)))) 43 52 (let ((directory (pathname-directory truename))) 44 53 (flet ((string-or-nil (value) (when (stringp value) value)) … … 65 74 66 75 ;; for non-SBCL we just steal this from SB-EXECUTABLE 67 #-(or : sbcl :digitool)76 #-(or :digitool) 68 77 (defvar *stream-buffer-size* 8192) 69 #-(or : sbcl :digitool)78 #-(or :digitool) 70 79 (defun copy-stream (from to) 71 80 "Copy into TO from FROM until end of the input stream, in blocks of … … 76 85 :element-type (stream-element-type from)))) 77 86 (loop 78 (let ((pos #-(or :clisp :cmu) (read-sequence buf from)79 #+:clisp (ext:read-byte-sequence buf from :no-hang nil)80 #+:cmu (sys:read-n-bytes from buf 0 *stream-buffer-size* nil)))81 (when (zerop pos) (return))82 (write-sequence buf to :end pos)))))87 (let ((pos #-(or :clisp :cmu) (read-sequence buf from) 88 #+:clisp (ext:read-byte-sequence buf from :no-hang nil) 89 #+:cmu (sys:read-n-bytes from buf 0 *stream-buffer-size* nil))) 90 (when (zerop pos) (return)) 91 (write-sequence buf to :end pos))))) 83 92 84 93 #+:digitool … … 92 101 (funcall writer writer-arg datum)))))) 93 102 94 #+:sbcl95 (declaim (inline copy-stream))96 #+:sbcl97 (defun copy-stream (from to)98 (sb-executable:copy-stream from to))99 100 103 (defun make-stream-from-url (url) 101 #+ :sbcl104 #+(or :sbcl :ecl) 102 105 (let ((s (make-instance 'sb-bsd-sockets:inet-socket 103 :type :stream104 :protocol :tcp)))106 :type :stream 107 :protocol :tcp))) 105 108 (sb-bsd-sockets:socket-connect 106 109 s (car (sb-bsd-sockets:host-ent-addresses 107 110 (sb-bsd-sockets:get-host-by-name (url-host url)))) 108 111 (url-port url)) 109 (sb-bsd-sockets:socket-make-stream s :input t :output t :buffering :full)) 112 (sb-bsd-sockets:socket-make-stream 113 s 114 :input t 115 :output t 116 :buffering :full 117 :external-format :iso-8859-1)) 110 118 #+:cmu 111 119 (sys:make-fd-stream (ext:connect-to-inet-socket (url-host url) (url-port url)) 112 120 :input t :output t :buffering :full) 121 #+:scl 122 (sys:make-fd-stream (ext:connect-to-inet-socket (url-host url) (url-port url)) 123 :input t :output t :buffering :full 124 :external-format :iso-8859-1) 113 125 #+:lispworks 114 126 (comm:open-tcp-stream (url-host url) (url-port url) … … 129 141 :element-type 'unsigned-byte)) 130 142 131 #+(or :sbcl :cmu)132 (defun make-stream-from-gpg-command (string file-name)133 (#+:sbcl sb-ext:process-output134 #+:cmu ext:process-output135 (#+:sbcl sb-ext:run-program136 #+:cmu ext:run-program137 "gpg"138 (list139 "--status-fd" "1" "--verify" "-"140 (namestring file-name))141 :output :stream142 :error nil143 #+sbcl :search #+sbcl t144 :input (make-string-input-stream string)145 :wait t)))146 147 #+(and :lispworks (not :win32))148 (defun make-stream-from-gpg-command (string file-name)149 ;; kludge - we can't separate the in and out streams150 (let ((stream (sys:open-pipe (format nil "echo '~A' | gpg --status-fd 1 --verify - ~A"151 string152 (namestring file-name)))))153 stream))154 155 (defun make-temp-sig (file-name content)156 (let ((name (format nil "~A.asc" (namestring (truename file-name)))))157 (with-open-file (out name158 :direction :output159 :if-exists :supersede)160 (write-string content out))161 (pushnew name *temporary-files*)162 name))163 164 #+(and :lispworks :win32)165 (defun make-stream-from-gpg-command (string file-name)166 (sys:open-pipe (format nil "gpg --status-fd 1 --verify \"~A\" \"~A\""167 (make-temp-sig file-name string)168 (namestring file-name))))169 170 #+(and :clisp (not (or :win32 :cygwin)))171 (defun make-stream-from-gpg-command (string file-name)172 (let ((stream173 (ext:run-shell-command (format nil "echo '~A' | gpg --status-fd 1 --verify - ~A"174 string175 (namestring file-name))176 :output :stream177 :wait nil)))178 stream))179 180 #+(and :clisp (or :win32 :cygwin))181 (defun make-stream-from-gpg-command (string file-name)182 (ext:run-shell-command (format nil "gpg --status-fd 1 --verify \"~A\" \"~A\""183 (make-temp-sig file-name string)184 (namestring file-name))185 :output :stream186 :wait nil))187 188 #+:allegro189 (defun make-stream-from-gpg-command (string file-name)190 (multiple-value-bind (in-stream out-stream)191 (excl:run-shell-command192 #-:mswindows193 (concatenate 'vector194 #("gpg" "gpg" "--status-fd" "1" "--verify" "-")195 (make-sequence 'vector 1196 :initial-element (namestring file-name)))197 #+:mswindows198 (format nil "gpg --status-fd 1 --verify - \"~A\"" (namestring file-name))199 :input :stream200 :output :stream201 :separate-streams t202 :wait nil)203 (write-string string in-stream)204 (finish-output in-stream)205 (close in-stream)206 out-stream))207 208 #+:openmcl209 (defun make-stream-from-gpg-command (string file-name)210 (let ((proc (ccl:run-program "gpg" (list "--status-fd" "1" "--verify" "-" (namestring file-name))211 :input :stream212 :output :stream213 :wait nil)))214 (write-string string (ccl:external-process-input-stream proc))215 (close (ccl:external-process-input-stream proc))216 (ccl:external-process-output-stream proc)))217 218 #+:digitool219 (defun make-stream-from-gpg-command (string file-name)220 (make-instance 'popen-input-stream221 :command (format nil "echo '~A' | gpg --status-fd 1 --verify - '~A'"222 string223 (system-namestring file-name))))224 143 225 144 #+:sbcl … … 230 149 args 231 150 :output out-stream 151 :search t 232 152 :wait t))) 233 153 (when (or (null proc) … … 236 156 (return-from return-output-from-program nil))))) 237 157 238 #+ :cmu158 #+(or :cmu :scl) 239 159 (defun return-output-from-program (program args) 240 160 (with-output-to-string (out-stream) … … 254 174 (unless (zerop (sys:call-system-showing-output 255 175 (format nil #-:win32 "~A~{ '~A'~}" 256 #+:win32 "~A~{ ~A~}"257 program args)176 #+:win32 "~A~{ ~A~}" 177 program args) 258 178 :prefix "" 259 179 :show-cmd nil … … 265 185 (with-output-to-string (out-stream) 266 186 (let ((stream 267 (ext:run-program program268 :arguments args269 :output :stream270 :wait nil)))187 (ext:run-program program 188 :arguments args 189 :output :stream 190 :wait nil))) 271 191 (loop for line = (read-line stream nil) 272 192 while line … … 277 197 (with-output-to-string (out-stream) 278 198 (let ((stream 279 (ext:run-shell-command280 (format nil "~A~{ ~A~}" program args281 :output :stream282 :wait nil))))199 (ext:run-shell-command 200 (format nil "~A~{ ~A~}" program args 201 :output :stream 202 :wait nil)))) 283 203 (loop for line = (ignore-errors (read-line stream nil)) 284 204 while line … … 289 209 (with-output-to-string (out-stream) 290 210 (let ((stream 291 (excl:run-shell-command292 #-:mswindows293 (concatenate 'vector294 (list program)295 (cons program args))296 #+:mswindows297 (format nil "~A~{ ~A~}" program args)298 :output :stream299 :wait nil)))211 (excl:run-shell-command 212 #-:mswindows 213 (concatenate 'vector 214 (list program) 215 (cons program args)) 216 #+:mswindows 217 (format nil "~A~{ ~A~}" program args) 218 :output :stream 219 :wait nil))) 300 220 (loop for line = (read-line stream nil) 301 221 while line 302 222 do (write-line line out-stream))))) 223 224 #+:ecl 225 (defun return-output-from-program (program args) 226 (with-output-to-string (out-stream) 227 (let ((stream (ext:run-program program args :output :stream))) 228 (when stream 229 (loop for line = (ignore-errors (read-line stream nil)) 230 while line 231 do (write-line line out-stream)))))) 303 232 304 233 #+:openmcl … … 309 238 :output :stream 310 239 :wait nil))) 311 (loop for line = (read-line (ccl:external-process-output-stream proc) nil nil nil) 240 (loop for line = (read-line 241 (ccl:external-process-output-stream proc) nil nil nil) 312 242 while line 313 243 do (write-line line out-stream))))) … … 317 247 (ccl::call-system (format nil "~A~{ '~A'~} 2>&1" program args))) 318 248 319 ;; why not just use DELETE-FILE?320 249 (defun unlink-file (pathname) 321 #+:sbcl 322 (sb-posix:unlink pathname) 323 #+:cmu 324 (unix:unix-unlink (namestring pathname)) 325 #+:allegro 326 (excl.osi:unlink pathname) 327 #+(or :lispwork :clisp :openmcl :digitool) 250 ;; 20070208 gwking@metabang.com - removed lisp-specific os-level calls 251 ;; in favor of a simple delete 328 252 (delete-file pathname)) 329 253 330 254 (defun symlink-files (old new) 331 #+:sbcl 332 (sb-posix:symlink old new) 333 #+:cmu 334 (unix:unix-symlink (namestring old) 335 (namestring new)) 336 #+:allegro 337 (excl.osi:symlink old new) 338 #+:lispworks 339 ;; we loose if the pathnames contain apostrophes... 340 (sys:call-system (format nil "ln -s '~A' '~A'" 341 (namestring old) 342 (namestring new))) 343 #+:clisp 344 (ext:run-program "ln" 345 :arguments (append '("-s") 346 (list (format nil "~A" (namestring old)) 347 (format nil "~A" (namestring new))))) 348 #+:openmcl 349 (ccl:run-program "ln" (list "-s" (namestring old) (namestring new))) 350 #+:digitool 351 (ccl::call-system (format nil "ln -s '~A' '~A'" 352 (system-namestring old) 353 (system-namestring new)))) 255 (let* ((old (#-scl namestring #+scl ext:unix-namestring old)) 256 (new (#-scl namestring #+scl ext:unix-namestring new #+scl nil)) 257 ;; 20070811 - thanks to Juan Jose Garcia-Ripoll for pointing 258 ;; that ~a would wreck havoc if the working directory had a space 259 ;; in the pathname 260 (command (format nil "ln -s ~s ~s" old new))) 261 (format t "~S~%" command) 262 (shell-command command))) 263 264 (defun maybe-symlink-sysfile (system sysfile) 265 (declare (ignorable system sysfile)) 266 #-(or :win32 :mswindows) 267 (let ((target (merge-pathnames 268 (make-pathname :name (pathname-name sysfile) 269 :type (pathname-type sysfile)) 270 system))) 271 (when (probe-file target) 272 (unlink-file target)) 273 (symlink-files sysfile target))) 274 275 ;;; --------------------------------------------------------------------------- 276 ;;; read-header-line 277 ;;; --------------------------------------------------------------------------- 278 279 #-:digitool 280 (defun read-header-line (stream) 281 (read-line stream)) 282 283 #+:digitool 284 (defun read-header-line (stream &aux (line (make-array 16 285 :element-type 'character 286 :adjustable t 287 :fill-pointer 0)) 288 (byte nil)) 289 (print (multiple-value-bind (reader arg) 290 (ccl::stream-reader stream) 291 (loop (setf byte (funcall reader arg)) 292 (case byte 293 ((nil) 294 (return)) 295 ((#.(char-code #\Return) 296 #.(char-code #\Linefeed)) 297 (case (setf byte (funcall reader arg)) 298 ((nil #.(char-code #\Return) #.(char-code #\Linefeed))) 299 (t (ccl:stream-untyi stream byte))) 300 (return)) 301 (t 302 (vector-push-extend (code-char byte) line)))) 303 (when (or byte (plusp (length line))) 304 line)))) 305 306 (defun open-file-arguments () 307 (append 308 #+sbcl 309 '(:external-format :latin1) 310 #+:scl 311 '(:external-format :iso-8859-1) 312 #+(or :clisp :digitool (and :lispworks :win32)) 313 '(:element-type (unsigned-byte 8)))) 314 315 (defun download-url-to-file (url file-name) 316 "Resolves url and then downloads it to file-name; returns the url actually used." 317 (multiple-value-bind (response headers stream) 318 (loop 319 (destructuring-bind (response headers stream) 320 (url-connection url) 321 (unless (member response '(301 302)) 322 (return (values response headers stream))) 323 (close stream) 324 (setf url (header-value :location headers)))) 325 (when (>= response 400) 326 (error 'download-error :url url :response response)) 327 (let ((length (parse-integer (or (header-value :content-length headers) "") 328 :junk-allowed t))) 329 (installer-msg t "Downloading ~A bytes from ~A to ~A ..." 330 (or length "some unknown number of") 331 url 332 file-name) 333 (force-output) 334 #+:clisp (setf (stream-element-type stream) 335 '(unsigned-byte 8)) 336 (let ((ok? nil) (o nil)) 337 (unwind-protect 338 (progn 339 (setf o (apply #'open file-name 340 :direction :output :if-exists :supersede 341 (open-file-arguments))) 342 #+(or :cmu :digitool) 343 (copy-stream stream o) 344 #-(or :cmu :digitool) 345 (if length 346 (let ((buf (make-array length 347 :element-type 348 (stream-element-type stream)))) 349 #-:clisp (read-sequence buf stream) 350 #+:clisp (ext:read-byte-sequence buf stream :no-hang nil) 351 (write-sequence buf o)) 352 (copy-stream stream o)) 353 (setf ok? t)) 354 (when o (close o :abort (null ok?)))))) 355 (close stream)) 356 (values url)) 357 358 (defun download-url-to-temporary-file (url) 359 "Attempts to download url to a new, temporary file. Returns the resolved url and the file name \(as multiple values\)." 360 (let ((tmp (temp-file-name url))) 361 (pushnew tmp *temporary-files*) 362 (values (download-url-to-file url tmp) tmp))) 363 364 (defun gpg-results (package signature) 365 (let ((tags nil)) 366 (with-input-from-string 367 (gpg-stream 368 (shell-command (format nil "gpg --status-fd 1 --verify ~s ~s" 369 (namestring signature) (namestring package)))) 370 (loop for l = (read-line gpg-stream nil nil) 371 while l 372 do (print l) 373 when (> (mismatch l "[GNUPG:]") 6) 374 do (destructuring-bind (_ tag &rest data) 375 (split-sequence-if (lambda (x) 376 (find x '(#\Space #\Tab))) 377 l) 378 (declare (ignore _)) 379 (pushnew (cons (intern (string-upcase tag) :keyword) 380 data) tags))) 381 tags))) 382 383 #+allegro 384 (defun shell-command (command) 385 (multiple-value-bind (output error status) 386 (excl.osi:command-output command :whole t) 387 (values output error status))) 388 389 #+clisp 390 (defun shell-command (command) 391 ;; BUG: CLisp doesn't allow output to user-specified stream 392 (values 393 nil 394 nil 395 (ext:run-shell-command command :output :terminal :wait t))) 396 397 #+(or :cmu :scl) 398 (defun shell-command (command) 399 (let* ((process (ext:run-program 400 *shell-path* 401 (list "-c" command) 402 :input nil :output :stream :error :stream)) 403 (output (file-to-string-as-lines (ext::process-output process))) 404 (error (file-to-string-as-lines (ext::process-error process)))) 405 (close (ext::process-output process)) 406 (close (ext::process-error process)) 407 (values 408 output 409 error 410 (ext::process-exit-code process)))) 411 412 #+ecl 413 (defun shell-command (command) 414 ;; If we use run-program, we do not get exit codes 415 (values nil nil (ext:system command))) 416 417 #+lispworks 418 (defun shell-command (command) 419 ;; BUG: Lispworks combines output and error streams 420 (let ((output (make-string-output-stream))) 421 (unwind-protect 422 (let ((status 423 (system:call-system-showing-output 424 command 425 :prefix "" 426 :show-cmd nil 427 :output-stream output))) 428 (values (get-output-stream-string output) nil status)) 429 (close output)))) 430 431 #+openmcl 432 (defun shell-command (command) 433 (let* ((process (create-shell-process command t)) 434 (output (file-to-string-as-lines 435 (ccl::external-process-output-stream process))) 436 (error (file-to-string-as-lines 437 (ccl::external-process-error-stream process)))) 438 (close (ccl::external-process-output-stream process)) 439 (close (ccl::external-process-error-stream process)) 440 (values output 441 error 442 (process-exit-code process)))) 443 444 #+openmcl 445 (defun create-shell-process (command wait) 446 (ccl:run-program 447 *shell-path* 448 (list "-c" command) 449 :input nil :output :stream :error :stream 450 :wait wait)) 451 452 #+openmcl 453 (defun process-exit-code (process) 454 (nth-value 1 (ccl:external-process-status process))) 455 456 #+digitool 457 (defun shell-command (command) 458 ;; BUG: I have no idea what this returns 459 (ccl::call-system command)) 460 461 #+sbcl 462 (defun shell-command (command) 463 (let* ((process (sb-ext:run-program 464 *shell-path* 465 (list "-c" command) 466 :input nil :output :stream :error :stream)) 467 (output (file-to-string-as-lines (sb-impl::process-output process))) 468 (error (file-to-string-as-lines (sb-impl::process-error process)))) 469 (close (sb-impl::process-output process)) 470 (close (sb-impl::process-error process)) 471 (values 472 output 473 error 474 (sb-impl::process-exit-code process)))) 475 476 (defgeneric file-to-string-as-lines (pathname) 477 (:documentation "")) 478 479 (defmethod file-to-string-as-lines ((pathname pathname)) 480 (with-open-file (stream pathname :direction :input) 481 (file-to-string-as-lines stream))) 482 483 (defmethod file-to-string-as-lines ((stream stream)) 484 (with-output-to-string (s) 485 (loop for line = (read-line stream nil :eof nil) 486 until (eq line :eof) do 487 (princ line s) 488 (terpri s)))) 489 490 ;; copied from ASDF 491 (defun pathname-sans-name+type (pathname) 492 "Returns a new pathname with same HOST, DEVICE, DIRECTORY as PATHNAME, 493 and NIL NAME and TYPE components" 494 (make-pathname :name nil :type nil :defaults pathname)) 495 -
release/1.2/source/tools/asdf-install/split-sequence.lisp
r928 r9219 4 4 ;;; <URL:http://groups.google.com/groups?as_umsgid=39F36F1A.B8F19D20%40simplex.nl>; 5 5 ;;; 6 ;;; changes include:7 ;;;8 ;;; * altering the behaviour of the :from-end keyword argument to9 ;;; return the subsequences in original order, for consistency with10 ;;; CL:REMOVE, CL:SUBSTITUTE et al. (:from-end being non-NIL only11 ;;; affects the answer if :count is less than the number of12 ;;; subsequences, by analogy with the above-referenced functions).13 ;;;14 ;;; * changing the :maximum keyword argument to :count, by analogy15 ;;; with CL:REMOVE, CL:SUBSTITUTE, and so on.16 ;;;17 ;;; * naming the function SPLIT-SEQUENCE rather than PARTITION rather18 ;;; than SPLIT.19 ;;;20 ;;; * adding SPLIT-SEQUENCE-IF and SPLIT-SEQUENCE-IF-NOT.21 ;;;22 ;;; * The second return value is now an index rather than a copy of a23 ;;; portion of the sequence; this index is the `right' one to feed to24 ;;; CL:SUBSEQ for continued processing.25 6 26 ;;; There's a certain amount of code duplication here, which is kept 27 ;;; to illustrate the relationship between the SPLIT-SEQUENCE 28 ;;; functions and the CL:POSITION functions. 29 30 ;;; Examples: 31 ;;; 32 ;;; * (split-sequence #\; "a;;b;c") 33 ;;; -> ("a" "" "b" "c"), 6 34 ;;; 35 ;;; * (split-sequence #\; "a;;b;c" :from-end t) 36 ;;; -> ("a" "" "b" "c"), 0 37 ;;; 38 ;;; * (split-sequence #\; "a;;b;c" :from-end t :count 1) 39 ;;; -> ("c"), 4 40 ;;; 41 ;;; * (split-sequence #\; "a;;b;c" :remove-empty-subseqs t) 42 ;;; -> ("a" "b" "c"), 6 43 ;;; 44 ;;; * (split-sequence-if (lambda (x) (member x '(#\a #\b))) "abracadabra") 45 ;;; -> ("" "" "r" "c" "d" "" "r" ""), 11 46 ;;; 47 ;;; * (split-sequence-if-not (lambda (x) (member x '(#\a #\b))) "abracadabra") 48 ;;; -> ("ab" "a" "a" "ab" "a"), 11 49 ;;; 50 ;;; * (split-sequence #\; ";oo;bar;ba;" :start 1 :end 9) 51 ;;; -> ("oo" "bar" "b"), 9 52 53 (defpackage "SPLIT-SEQUENCE" 54 (:use "CL") 55 (:nicknames "PARTITION") 56 (:export "SPLIT-SEQUENCE" "SPLIT-SEQUENCE-IF" "SPLIT-SEQUENCE-IF-NOT" 57 "PARTITION" "PARTITION-IF" "PARTITION-IF-NOT") 58 (:documentation "The SPLIT-SEQUENCE package provides functionality for Common Lisp sequences analagous to Perl's split operator.")) 59 60 (in-package "SPLIT-SEQUENCE") 61 62 (defun split-sequence (delimiter seq &key (count nil) (remove-empty-subseqs nil) (from-end nil) (start 0) (end nil) (test nil test-supplied) (test-not nil test-not-supplied) (key nil key-supplied)) 63 "Return a list of subsequences in seq delimited by delimiter. 64 65 If :remove-empty-subseqs is NIL, empty subsequences will be included 66 in the result; otherwise they will be discarded. All other keywords 67 work analogously to those for CL:SUBSTITUTE. In particular, the 68 behaviour of :from-end is possibly different from other versions of 69 this function; :from-end values of NIL and T are equivalent unless 70 :count is supplied. The second return value is an index suitable as an 71 argument to CL:SUBSEQ into the sequence indicating where processing 72 stopped." 73 (let ((len (length seq)) 74 (other-keys (nconc (when test-supplied 75 (list :test test)) 76 (when test-not-supplied 77 (list :test-not test-not)) 78 (when key-supplied 79 (list :key key))))) 80 (unless end (setq end len)) 81 (if from-end 82 (loop for right = end then left 83 for left = (max (or (apply #'position delimiter seq 84 :end right 85 :from-end t 86 other-keys) 87 -1) 88 (1- start)) 89 unless (and (= right (1+ left)) 90 remove-empty-subseqs) ; empty subseq we don't want 91 if (and count (>= nr-elts count)) 92 ;; We can't take any more. Return now. 93 return (values (nreverse subseqs) right) 94 else 95 collect (subseq seq (1+ left) right) into subseqs 96 and sum 1 into nr-elts 97 until (< left start) 98 finally (return (values (nreverse subseqs) (1+ left)))) 99 (loop for left = start then (+ right 1) 100 for right = (min (or (apply #'position delimiter seq 101 :start left 102 other-keys) 103 len) 104 end) 105 unless (and (= right left) 106 remove-empty-subseqs) ; empty subseq we don't want 107 if (and count (>= nr-elts count)) 108 ;; We can't take any more. Return now. 109 return (values subseqs left) 110 else 111 collect (subseq seq left right) into subseqs 112 and sum 1 into nr-elts 113 until (>= right end) 114 finally (return (values subseqs right)))))) 7 (in-package #:asdf-install) 115 8 116 9 (defun split-sequence-if (predicate seq &key (count nil) (remove-empty-subseqs nil) (from-end nil) (start 0) (end nil) (key nil key-supplied)) … … 165 58 finally (return (values subseqs right)))))) 166 59 167 (defun split-sequence-if-not (predicate seq &key (count nil) (remove-empty-subseqs nil) (from-end nil) (start 0) (end nil) (key nil key-supplied))168 "Return a list of subsequences in seq delimited by items satisfying169 (CL:COMPLEMENT predicate).170 171 If :remove-empty-subseqs is NIL, empty subsequences will be included172 in the result; otherwise they will be discarded. All other keywords173 work analogously to those for CL:SUBSTITUTE-IF-NOT. In particular,174 the behaviour of :from-end is possibly different from other versions175 of this function; :from-end values of NIL and T are equivalent unless176 :count is supplied. The second return value is an index suitable as an177 argument to CL:SUBSEQ into the sequence indicating where processing178 stopped."179 (let ((len (length seq))180 (other-keys (when key-supplied181 (list :key key))))182 (unless end (setq end len))183 (if from-end184 (loop for right = end then left185 for left = (max (or (apply #'position-if-not predicate seq186 :end right187 :from-end t188 other-keys)189 -1)190 (1- start))191 unless (and (= right (1+ left))192 remove-empty-subseqs) ; empty subseq we don't want193 if (and count (>= nr-elts count))194 ;; We can't take any more. Return now.195 return (values (nreverse subseqs) right)196 else197 collect (subseq seq (1+ left) right) into subseqs198 and sum 1 into nr-elts199 until (< left start)200 finally (return (values (nreverse subseqs) (1+ left))))201 (loop for left = start then (+ right 1)202 for right = (min (or (apply #'position-if-not predicate seq203 :start left204 other-keys)205 len)206 end)207 unless (and (= right left)208 remove-empty-subseqs) ; empty subseq we don't want209 if (and count (>= nr-elts count))210 ;; We can't take any more. Return now.211 return (values subseqs left)212 else213 collect (subseq seq left right) into subseqs214 and sum 1 into nr-elts215 until (>= right end)216 finally (return (values subseqs right))))))217 218 ;;; clean deprecation219 220 (defun partition (&rest args)221 "PARTITION is deprecated; use SPLIT-SEQUENCE instead."222 (apply #'split-sequence args))223 224 (defun partition-if (&rest args)225 "PARTITION-IF is deprecated; use SPLIT-SEQUENCE-IF instead."226 (apply #'split-sequence-if args))227 228 (defun partition-if-not (&rest args)229 "PARTITION-IF-NOT is deprecated; use SPLIT-SEQUENCE-IF-NOT instead."230 (apply #'split-sequence-if-not args))231 232 (define-compiler-macro partition (&whole form &rest args)233 (declare (ignore args))234 (warn "PARTITION is deprecated; use SPLIT-SEQUENCE instead.")235 form)236 237 (define-compiler-macro partition-if (&whole form &rest args)238 (declare (ignore args))239 (warn "PARTITION-IF is deprecated; use SPLIT-SEQUENCE-IF instead.")240 form)241 242 (define-compiler-macro partition-if-not (&whole form &rest args)243 (declare (ignore args))244 (warn "PARTITION-IF-NOT is deprecated; use SPLIT-SEQUENCE-IF-NOT instead")245 form)246 247 (pushnew :split-sequence *features*) -
release/1.2/source/tools/asdf.lisp
r9202 r9219 1 2 3 4 5 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 6 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 7 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 8 <!-- ViewVC - http://viewvc.org/ 9 by Greg Stein - mailto:gstein@lyra.org --> 10 <head> 11 <title>SourceForge.net Repository - [cclan] View of /asdf/asdf.lisp</title> 12 <meta name="generator" content="ViewVC 1.0.3" /> 13 <link rel="stylesheet" href="/*docroot*/styles.css" type="text/css" /> 14 </head> 15 <body> 16 <table style="padding:0.1em;"> 17 <tr> 18 <td> 19 <strong> 20 21 <a href="/cclan/"> 22 23 [cclan]</a> 24 / 25 26 <a href="/cclan/asdf/"> 27 28 asdf</a> 29 / 30 31 <a href="/cclan/asdf/asdf.lisp?view=log"> 32 33 asdf.lisp</a> 34 35 36 </strong> 37 38 </td> 39 </tr> 40 </table> 41 42 43 <div style="float: right; padding: 5px;"><a href="http://sourceforge.net"><img src="/*docroot*/images/sflogo-210pxtrans.png" alt="(logo)" border=0 width=210 height=62></a></div> 44 <h1>View of /asdf/asdf.lisp</h1> 45 46 <p style="margin:0;"> 47 48 <a href="/cclan/asdf/"><img src="/*docroot*/images/back_small.png" width="16" height="16" alt="Parent Directory" /> Parent Directory</a> 49 50 | <a href="/cclan/asdf/asdf.lisp?view=log#rev1.115"><img src="/*docroot*/images/log.png" width="16" height="16" alt="Revision Log" /> Revision Log</a> 51 52 53 54 55 </p> 56 57 <hr /> 58 <div class="vc_summary"> 59 Revision <strong>1.115</strong> - 60 (<a href="/*checkout*/cclan/asdf/asdf.lisp?revision=1.115"><strong>download</strong></a>) 61 62 (<a href="/cclan/asdf/asdf.lisp?annotate=1.115"><strong>annotate</strong></a>) 63 64 <br /><em>Fri Feb 15 12:14:48 2008 UTC</em> 65 (2 months ago) 66 by <em>demoss</em> 67 68 69 <br />Branch: <strong>MAIN</strong> 70 71 72 <br />CVS Tags: <strong>HEAD</strong> 73 74 75 76 77 <br />Changes since <strong>1.114: +2 -2 lines</strong> 78 79 80 81 82 83 <pre class="vc_log">fix CVS revision magic in *asdf-revision* 84 85 gah. 86 </pre> 87 88 </div> 89 <div id="vc_markup"><pre><a id="l_1"></a><span class="hl line"> 1 </span><span class="hl slc">;;; This is asdf: Another System Definition Facility. $Revision$</span> 90 <a id="l_2"></a><span class="hl line"> 2 </span><span class="hl slc">;;;</span> 91 <a id="l_3"></a><span class="hl line"> 3 </span><span class="hl slc">;;; Feedback, bug reports, and patches are all welcome: please mail to</span> 92 <a id="l_4"></a><span class="hl line"> 4 </span><span class="hl slc">;;; <cclan-list@lists.sf.net>. But note first that the canonical</span> 93 <a id="l_5"></a><span class="hl line"> 5 </span><span class="hl slc">;;; source for asdf is presently the cCLan CVS repository at</span> 94 <a id="l_6"></a><span class="hl line"> 6 </span><span class="hl slc">;;; <URL:http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/cclan/asdf/></span> 95 <a id="l_7"></a><span class="hl line"> 7 </span><span class="hl slc">;;;</span> 96 <a id="l_8"></a><span class="hl line"> 8 </span><span class="hl slc">;;; If you obtained this copy from anywhere else, and you experience</span> 97 <a id="l_9"></a><span class="hl line"> 9 </span><span class="hl slc">;;; trouble using it, or find bugs, you may want to check at the</span> 98 <a id="l_10"></a><span class="hl line"> 10 </span><span class="hl slc">;;; location above for a more recent version (and for documentation</span> 99 <a id="l_11"></a><span class="hl line"> 11 </span><span class="hl slc">;;; and test files, if your copy came without them) before reporting</span> 100 <a id="l_12"></a><span class="hl line"> 12 </span><span class="hl slc">;;; bugs. There are usually two "supported" revisions - the CVS HEAD</span> 101 <a id="l_13"></a><span class="hl line"> 13 </span><span class="hl slc">;;; is the latest development version, whereas the revision tagged</span> 102 <a id="l_14"></a><span class="hl line"> 14 </span><span class="hl slc">;;; RELEASE may be slightly older but is considered `stable'</span> 103 <a id="l_15"></a><span class="hl line"> 15 </span> 104 <a id="l_16"></a><span class="hl line"> 16 </span><span class="hl slc">;;; Copyright (c) 2001-2007 Daniel Barlow and contributors</span> 105 <a id="l_17"></a><span class="hl line"> 17 </span><span class="hl slc">;;;</span> 106 <a id="l_18"></a><span class="hl line"> 18 </span><span class="hl slc">;;; Permission is hereby granted, free of charge, to any person obtaining</span> 107 <a id="l_19"></a><span class="hl line"> 19 </span><span class="hl slc">;;; a copy of this software and associated documentation files (the</span> 108 <a id="l_20"></a><span class="hl line"> 20 </span><span class="hl slc">;;; "Software"), to deal in the Software without restriction, including</span> 109 <a id="l_21"></a><span class="hl line"> 21 </span><span class="hl slc">;;; without limitation the rights to use, copy, modify, merge, publish,</span> 110 <a id="l_22"></a><span class="hl line"> 22 </span><span class="hl slc">;;; distribute, sublicense, and/or sell copies of the Software, and to</span> 111 <a id="l_23"></a><span class="hl line"> 23 </span><span class="hl slc">;;; permit persons to whom the Software is furnished to do so, subject to</span> 112 <a id="l_24"></a><span class="hl line"> 24 </span><span class="hl slc">;;; the following conditions:</span> 113 <a id="l_25"></a><span class="hl line"> 25 </span><span class="hl slc">;;;</span> 114 <a id="l_26"></a><span class="hl line"> 26 </span><span class="hl slc">;;; The above copyright notice and this permission notice shall be</span> 115 <a id="l_27"></a><span class="hl line"> 27 </span><span class="hl slc">;;; included in all copies or substantial portions of the Software.</span> 116 <a id="l_28"></a><span class="hl line"> 28 </span><span class="hl slc">;;;</span> 117 <a id="l_29"></a><span class="hl line"> 29 </span><span class="hl slc">;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,</span> 118 <a id="l_30"></a><span class="hl line"> 30 </span><span class="hl slc">;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF</span> 119 <a id="l_31"></a><span class="hl line"> 31 </span><span class="hl slc">;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND</span> 120 <a id="l_32"></a><span class="hl line"> 32 </span><span class="hl slc">;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE</span> 121 <a id="l_33"></a><span class="hl line"> 33 </span><span class="hl slc">;;; LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION</span> 122 <a id="l_34"></a><span class="hl line"> 34 </span><span class="hl slc">;;; OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION</span> 123 <a id="l_35"></a><span class="hl line"> 35 </span><span class="hl slc">;;; WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</span> 124 <a id="l_36"></a><span class="hl line"> 36 </span> 125 <a id="l_37"></a><span class="hl line"> 37 </span><span class="hl slc">;;; the problem with writing a defsystem replacement is bootstrapping:</span> 126 <a id="l_38"></a><span class="hl line"> 38 </span><span class="hl slc">;;; we can't use defsystem to compile it. Hence, all in one file</span> 127 <a id="l_39"></a><span class="hl line"> 39 </span> 128 <a id="l_40"></a><span class="hl line"> 40 </span><span class="hl sym">(</span>defpackage #<span class="hl sym">:</span>asdf 129 <a id="l_41"></a><span class="hl line"> 41 </span> <span class="hl sym">(:</span>export #<span class="hl sym">:</span>defsystem #<span class="hl sym">:</span>oos #<span class="hl sym">:</span>operate #<span class="hl sym">:</span>find-system #<span class="hl sym">:</span>run-shell-<span class="hl kwa">command</span> 130 <a id="l_42"></a><span class="hl line"> 42 </span> #<span class="hl sym">:</span>system-definition-pathname #<span class="hl sym">:</span>find-component <span class="hl slc">; miscellaneous</span> 131 <a id="l_43"></a><span class="hl line"> 43 </span> #<span class="hl sym">:</span>hyperdocumentation #<span class="hl sym">:</span>hyperdoc 132 <a id="l_44"></a><span class="hl line"> 44 </span> 133 <a id="l_45"></a><span class="hl line"> 45 </span> #<span class="hl sym">:</span>compile-op #<span class="hl sym">:</span><span class="hl kwa">load</span>-op #<span class="hl sym">:</span><span class="hl kwa">load</span>-source-op #<span class="hl sym">:</span>test-system-version 134 <a id="l_46"></a><span class="hl line"> 46 </span> #<span class="hl sym">:</span>test-op 135 <a id="l_47"></a><span class="hl line"> 47 </span> #<span class="hl sym">:</span>operation <span class="hl slc">; operations</span> 136 <a id="l_48"></a><span class="hl line"> 48 </span> #<span class="hl sym">:</span>feature <span class="hl slc">; sort-of operation</span> 137 <a id="l_49"></a><span class="hl line"> 49 </span> #<span class="hl sym">:</span>version <span class="hl slc">; metaphorically sort-of an operation</span> 138 <a id="l_50"></a><span class="hl line"> 50 </span> 139 <a id="l_51"></a><span class="hl line"> 51 </span> #<span class="hl sym">:</span>input-files #<span class="hl sym">:</span>output-files #<span class="hl sym">:</span>perform <span class="hl slc">; operation methods</span> 140 <a id="l_52"></a><span class="hl line"> 52 </span> #<span class="hl sym">:</span>operation-done-p #<span class="hl sym">:</span>explain 141 <a id="l_53"></a><span class="hl line"> 53 </span> 142 <a id="l_54"></a><span class="hl line"> 54 </span> #<span class="hl sym">:</span>component #<span class="hl sym">:</span>source-file 143 <a id="l_55"></a><span class="hl line"> 55 </span> #<span class="hl sym">:</span>c-source-file #<span class="hl sym">:</span>cl-source-file #<span class="hl sym">:</span>java-source-file 144 <a id="l_56"></a><span class="hl line"> 56 </span> #<span class="hl sym">:</span>static-file 145 <a id="l_57"></a><span class="hl line"> 57 </span> #<span class="hl sym">:</span>doc-file 146 <a id="l_58"></a><span class="hl line"> 58 </span> #<span class="hl sym">:</span>html-file 147 <a id="l_59"></a><span class="hl line"> 59 </span> #<span class="hl sym">:</span>text-file 148 <a id="l_60"></a><span class="hl line"> 60 </span> #<span class="hl sym">:</span>source-file-<span class="hl kwa">type</span> 149 <a id="l_61"></a><span class="hl line"> 61 </span> #<span class="hl sym">:</span>module <span class="hl slc">; components</span> 150 <a id="l_62"></a><span class="hl line"> 62 </span> #<span class="hl sym">:</span>system 151 <a id="l_63"></a><span class="hl line"> 63 </span> #<span class="hl sym">:</span>unix-dso 152 <a id="l_64"></a><span class="hl line"> 64 </span> 153 <a id="l_65"></a><span class="hl line"> 65 </span> #<span class="hl sym">:</span>module-components <span class="hl slc">; component accessors</span> 154 <a id="l_66"></a><span class="hl line"> 66 </span> #<span class="hl sym">:</span>component-pathname 155 <a id="l_67"></a><span class="hl line"> 67 </span> #<span class="hl sym">:</span>component-relative-pathname 156 <a id="l_68"></a><span class="hl line"> 68 </span> #<span class="hl sym">:</span>component-name 157 <a id="l_69"></a><span class="hl line"> 69 </span> #<span class="hl sym">:</span>component-version 158 <a id="l_70"></a><span class="hl line"> 70 </span> #<span class="hl sym">:</span>component-parent 159 <a id="l_71"></a><span class="hl line"> 71 </span> #<span class="hl sym">:</span>component-property 160 <a id="l_72"></a><span class="hl line"> 72 </span> #<span class="hl sym">:</span>component-system 161 <a id="l_73"></a><span class="hl line"> 73 </span> 162 <a id="l_74"></a><span class="hl line"> 74 </span> #<span class="hl sym">:</span>component-depends-on 163 <a id="l_75"></a><span class="hl line"> 75 </span> 164 <a id="l_76"></a><span class="hl line"> 76 </span> #<span class="hl sym">:</span>system-description 165 <a id="l_77"></a><span class="hl line"> 77 </span> #<span class="hl sym">:</span>system-long-description 166 <a id="l_78"></a><span class="hl line"> 78 </span> #<span class="hl sym">:</span>system-author 167 <a id="l_79"></a><span class="hl line"> 79 </span> #<span class="hl sym">:</span>system-maintainer 168 <a id="l_80"></a><span class="hl line"> 80 </span> #<span class="hl sym">:</span>system-license 169 <a id="l_81"></a><span class="hl line"> 81 </span> #<span class="hl sym">:</span>system-licence 170 <a id="l_82"></a><span class="hl line"> 82 </span> #<span class="hl sym">:</span>system-source-file 171 <a id="l_83"></a><span class="hl line"> 83 </span> #<span class="hl sym">:</span>system-relative-pathname 172 <a id="l_84"></a><span class="hl line"> 84 </span> 173 <a id="l_85"></a><span class="hl line"> 85 </span> #<span class="hl sym">:</span>operation-on-warnings 174 <a id="l_86"></a><span class="hl line"> 86 </span> #<span class="hl sym">:</span>operation-on-failure 175 <a id="l_87"></a><span class="hl line"> 87 </span> 176 <a id="l_88"></a><span class="hl line"> 88 </span> <span class="hl slc">;#:*component-parent-pathname*</span> 177 <a id="l_89"></a><span class="hl line"> 89 </span> #<span class="hl sym">:*</span>system-definition-search-functions<span class="hl sym">*</span> 178 <a id="l_90"></a><span class="hl line"> 90 </span> #<span class="hl sym">:*</span>central-registry<span class="hl sym">*</span> <span class="hl slc">; variables</span> 179 <a id="l_91"></a><span class="hl line"> 91 </span> #<span class="hl sym">:*</span>compile-file-warnings-behaviour<span class="hl sym">*</span> 180 <a id="l_92"></a><span class="hl line"> 92 </span> #<span class="hl sym">:*</span>compile-file-failure-behaviour<span class="hl sym">*</span> 181 <a id="l_93"></a><span class="hl line"> 93 </span> #<span class="hl sym">:*</span>asdf-revision<span class="hl sym">*</span> 182 <a id="l_94"></a><span class="hl line"> 94 </span> 183 <a id="l_95"></a><span class="hl line"> 95 </span> #<span class="hl sym">:</span>operation-error #<span class="hl sym">:</span>compile-failed #<span class="hl sym">:</span>compile-warned #<span class="hl sym">:</span>compile-error 184 <a id="l_96"></a><span class="hl line"> 96 </span> #<span class="hl sym">:</span>error-component #<span class="hl sym">:</span>error-operation 185 <a id="l_97"></a><span class="hl line"> 97 </span> #<span class="hl sym">:</span>system-definition-error 186 <a id="l_98"></a><span class="hl line"> 98 </span> #<span class="hl sym">:</span>missing-component 187 <a id="l_99"></a><span class="hl line"> 99 </span> #<span class="hl sym">:</span>missing-dependency 188 <a id="l_100"></a><span class="hl line"> 100 </span> #<span class="hl sym">:</span>circular-dependency <span class="hl slc">; errors</span> 189 <a id="l_101"></a><span class="hl line"> 101 </span> #<span class="hl sym">:</span>duplicate-names 190 <a id="l_102"></a><span class="hl line"> 102 </span> 191 <a id="l_103"></a><span class="hl line"> 103 </span> #<span class="hl sym">:</span>retry 192 <a id="l_104"></a><span class="hl line"> 104 </span> #<span class="hl sym">:</span>accept <span class="hl slc">; restarts</span> 193 <a id="l_105"></a><span class="hl line"> 105 </span> 194 <a id="l_106"></a><span class="hl line"> 106 </span> #<span class="hl sym">:</span>preference-file-for-system<span class="hl sym">/</span>operation 195 <a id="l_107"></a><span class="hl line"> 107 </span> #<span class="hl sym">:</span><span class="hl kwa">load</span>-preferences 196 <a id="l_108"></a><span class="hl line"> 108 </span> <span class="hl sym">)</span> 197 <a id="l_109"></a><span class="hl line"> 109 </span> <span class="hl sym">(:</span>use <span class="hl sym">:</span>cl<span class="hl sym">))</span> 198 <a id="l_110"></a><span class="hl line"> 110 </span> 199 <a id="l_111"></a><span class="hl line"> 111 </span> 200 <a id="l_112"></a><span class="hl line"> 112 </span>#<span class="hl sym">+</span>nil 201 <a id="l_113"></a><span class="hl line"> 113 </span><span class="hl sym">(</span>error <span class="hl str">"The author of this file habitually uses #+nil to comment out ~</span> 202 <a id="l_114"></a><span class="hl line"> 114 </span><span class="hl str"> forms. But don't worry, it was unlikely to work in the New ~</span> 203 <a id="l_115"></a><span class="hl line"> 115 </span><span class="hl str"> Implementation of Lisp anyway"</span><span class="hl sym">)</span> 204 <a id="l_116"></a><span class="hl line"> 116 </span> 205 <a id="l_117"></a><span class="hl line"> 117 </span><span class="hl sym">(</span>in-package #<span class="hl sym">:</span>asdf<span class="hl sym">)</span> 206 <a id="l_118"></a><span class="hl line"> 118 </span> 207 <a id="l_119"></a><span class="hl line"> 119 </span><span class="hl sym">(</span>defvar <span class="hl sym">*</span>asdf-revision<span class="hl sym">* (</span>let<span class="hl sym">* ((</span>v <span class="hl str">"$Revision$"</span><span class="hl sym">)</span> 208 <a id="l_120"></a><span class="hl line"> 120 </span> <span class="hl sym">(</span>colon <span class="hl sym">(</span><span class="hl kwa">or</span> <span class="hl sym">(</span>position #\: v<span class="hl sym">)</span> -<span class="hl num">1</span><span class="hl sym">))</span> 209 <a id="l_121"></a><span class="hl line"> 121 </span> <span class="hl sym">(</span>dot <span class="hl sym">(</span>position #\. v<span class="hl sym">)))</span> 210 <a id="l_122"></a><span class="hl line"> 122 </span> <span class="hl sym">(</span><span class="hl kwa">and</span> v colon dot 211 <a id="l_123"></a><span class="hl line"> 123 </span> <span class="hl sym">(</span><span class="hl kwa">list</span> <span class="hl sym">(</span>parse-integer v <span class="hl sym">:</span>start <span class="hl sym">(</span><span class="hl num">1</span><span class="hl sym">+</span> colon<span class="hl sym">)</span> 212 <a id="l_124"></a><span class="hl line"> 124 </span> <span class="hl sym">:</span>junk-allowed t<span class="hl sym">)</span> 213 <a id="l_125"></a><span class="hl line"> 125 </span> <span class="hl sym">(</span>parse-integer v <span class="hl sym">:</span>start <span class="hl sym">(</span><span class="hl num">1</span><span class="hl sym">+</span> dot<span class="hl sym">)</span> 214 <a id="l_126"></a><span class="hl line"> 126 </span> <span class="hl sym">:</span>junk-allowed t<span class="hl sym">)))))</span> 215 <a id="l_127"></a><span class="hl line"> 127 </span> 216 <a id="l_128"></a><span class="hl line"> 128 </span><span class="hl sym">(</span>defvar <span class="hl sym">*</span>compile-file-warnings-behaviour<span class="hl sym">* :</span>warn<span class="hl sym">)</span> 217 <a id="l_129"></a><span class="hl line"> 129 </span> 218 <a id="l_130"></a><span class="hl line"> 130 </span><span class="hl sym">(</span>defvar <span class="hl sym">*</span>compile-file-failure-behaviour<span class="hl sym">*</span> #<span class="hl sym">+</span>sbcl <span class="hl sym">:</span>error #-sbcl <span class="hl sym">:</span>warn<span class="hl sym">)</span> 219 <a id="l_131"></a><span class="hl line"> 131 </span> 220 <a id="l_132"></a><span class="hl line"> 132 </span><span class="hl sym">(</span>defvar <span class="hl sym">*</span>verbose-out<span class="hl sym">*</span> nil<span class="hl sym">)</span> 221 <a id="l_133"></a><span class="hl line"> 133 </span> 222 <a id="l_134"></a><span class="hl line"> 134 </span><span class="hl sym">(</span>defparameter <span class="hl sym">+</span>asdf-methods<span class="hl sym">+</span> 223 <a id="l_135"></a><span class="hl line"> 135 </span> <span class="hl sym">'(</span>perform explain output-files operation-done-p<span class="hl sym">))</span> 224 <a id="l_136"></a><span class="hl line"> 136 </span> 225 <a id="l_137"></a><span class="hl line"> 137 </span><span class="hl slc">;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</span> 226 <a id="l_138"></a><span class="hl line"> 138 </span><span class="hl slc">;; utility stuff</span> 227 <a id="l_139"></a><span class="hl line"> 139 </span> 228 <a id="l_140"></a><span class="hl line"> 140 </span><span class="hl sym">(</span>defmacro aif <span class="hl sym">(</span>test then <span class="hl sym">&</span>optional else<span class="hl sym">)</span> 229 <a id="l_141"></a><span class="hl line"> 141 </span> `<span class="hl sym">(</span>let <span class="hl sym">((</span>it <span class="hl sym">,</span>test<span class="hl sym">)) (</span><span class="hl kwa">if</span> it <span class="hl sym">,</span>then <span class="hl sym">,</span>else<span class="hl sym">)))</span> 230 <a id="l_142"></a><span class="hl line"> 142 </span> 231 <a id="l_143"></a><span class="hl line"> 143 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> pathname-sans-name<span class="hl sym">+</span><span class="hl kwa">type</span> <span class="hl sym">(</span>pathname<span class="hl sym">)</span> 232 <a id="l_144"></a><span class="hl line"> 144 </span> <span class="hl str">"Returns a new pathname with same HOST, DEVICE, DIRECTORY as PATHNAME,</span> 233 <a id="l_145"></a><span class="hl line"> 145 </span><span class="hl str">and NIL NAME and TYPE components"</span> 234 <a id="l_146"></a><span class="hl line"> 146 </span> <span class="hl sym">(</span>make-pathname <span class="hl sym">:</span>name nil <span class="hl sym">:</span><span class="hl kwa">type</span> nil <span class="hl sym">:</span>defaults pathname<span class="hl sym">))</span> 235 <a id="l_147"></a><span class="hl line"> 147 </span> 236 <a id="l_148"></a><span class="hl line"> 148 </span><span class="hl sym">(</span>define-modify-macro appendf <span class="hl sym">(&</span>rest args<span class="hl sym">)</span> 237 <a id="l_149"></a><span class="hl line"> 149 </span> <span class="hl kwa">append</span> <span class="hl str">"Append onto list"</span><span class="hl sym">)</span> 238 <a id="l_150"></a><span class="hl line"> 150 </span> 239 <a id="l_151"></a><span class="hl line"> 151 </span><span class="hl slc">;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</span> 240 <a id="l_152"></a><span class="hl line"> 152 </span><span class="hl slc">;; classes, condiitons</span> 241 <a id="l_153"></a><span class="hl line"> 153 </span> 242 <a id="l_154"></a><span class="hl line"> 154 </span><span class="hl sym">(</span>define-condition system-definition-error <span class="hl sym">(</span>error<span class="hl sym">) ()</span> 243 <a id="l_155"></a><span class="hl line"> 155 </span> <span class="hl slc">;; [this use of :report should be redundant, but unfortunately it's not.</span> 244 <a id="l_156"></a><span class="hl line"> 156 </span> <span class="hl slc">;; cmucl's lisp::output-instance prefers the kernel:slot-class-print-function</span> 245 <a id="l_157"></a><span class="hl line"> 157 </span> <span class="hl slc">;; over print-object; this is always conditions::%print-condition for</span> 246 <a id="l_158"></a><span class="hl line"> 158 </span> <span class="hl slc">;; condition objects, which in turn does inheritance of :report options at</span> 247 <a id="l_159"></a><span class="hl line"> 159 </span> <span class="hl slc">;; run-time. fortunately, inheritance means we only need this kludge here in</span> 248 <a id="l_160"></a><span class="hl line"> 160 </span> <span class="hl slc">;; order to fix all conditions that build on it. -- rgr, 28-Jul-02.]</span> 249 <a id="l_161"></a><span class="hl line"> 161 </span> #<span class="hl sym">+</span>cmu <span class="hl sym">(:</span>report <span class="hl kwa">print</span>-object<span class="hl sym">))</span> 250 <a id="l_162"></a><span class="hl line"> 162 </span> 251 <a id="l_163"></a><span class="hl line"> 163 </span><span class="hl sym">(</span>define-condition formatted-system-definition-error <span class="hl sym">(</span>system-definition-error<span class="hl sym">)</span> 252 <a id="l_164"></a><span class="hl line"> 164 </span> <span class="hl sym">((</span>format-control <span class="hl sym">:</span>initarg <span class="hl sym">:</span>format-control <span class="hl sym">:</span>reader format-control<span class="hl sym">)</span> 253 <a id="l_165"></a><span class="hl line"> 165 </span> <span class="hl sym">(</span>format-arguments <span class="hl sym">:</span>initarg <span class="hl sym">:</span>format-arguments <span class="hl sym">:</span>reader format-arguments<span class="hl sym">))</span> 254 <a id="l_166"></a><span class="hl line"> 166 </span> <span class="hl sym">(:</span>report <span class="hl sym">(</span><span class="hl kwa">lambda</span> <span class="hl sym">(</span>c s<span class="hl sym">)</span> 255 <a id="l_167"></a><span class="hl line"> 167 </span> <span class="hl sym">(</span><span class="hl kwa">apply</span> #<span class="hl sym">'</span>format s <span class="hl sym">(</span>format-control c<span class="hl sym">) (</span>format-arguments c<span class="hl sym">)))))</span> 256 <a id="l_168"></a><span class="hl line"> 168 </span> 257 <a id="l_169"></a><span class="hl line"> 169 </span><span class="hl sym">(</span>define-condition circular-dependency <span class="hl sym">(</span>system-definition-error<span class="hl sym">)</span> 258 <a id="l_170"></a><span class="hl line"> 170 </span> <span class="hl sym">((</span>components <span class="hl sym">:</span>initarg <span class="hl sym">:</span>components <span class="hl sym">:</span>reader circular-dependency-components<span class="hl sym">)))</span> 259 <a id="l_171"></a><span class="hl line"> 171 </span> 260 <a id="l_172"></a><span class="hl line"> 172 </span><span class="hl sym">(</span>define-condition duplicate-names <span class="hl sym">(</span>system-definition-error<span class="hl sym">)</span> 261 <a id="l_173"></a><span class="hl line"> 173 </span> <span class="hl sym">((</span>name <span class="hl sym">:</span>initarg <span class="hl sym">:</span>name <span class="hl sym">:</span>reader duplicate-names-name<span class="hl sym">)))</span> 262 <a id="l_174"></a><span class="hl line"> 174 </span> 263 <a id="l_175"></a><span class="hl line"> 175 </span><span class="hl sym">(</span>define-condition missing-component <span class="hl sym">(</span>system-definition-error<span class="hl sym">)</span> 264 <a id="l_176"></a><span class="hl line"> 176 </span> <span class="hl sym">((</span>requires <span class="hl sym">:</span>initform <span class="hl str">"(unnamed)"</span> <span class="hl sym">:</span>reader missing-requires <span class="hl sym">:</span>initarg <span class="hl sym">:</span>requires<span class="hl sym">)</span> 265 <a id="l_177"></a><span class="hl line"> 177 </span> <span class="hl sym">(</span>version <span class="hl sym">:</span>initform nil <span class="hl sym">:</span>reader missing-version <span class="hl sym">:</span>initarg <span class="hl sym">:</span>version<span class="hl sym">)</span> 266 <a id="l_178"></a><span class="hl line"> 178 </span> <span class="hl sym">(</span>parent <span class="hl sym">:</span>initform nil <span class="hl sym">:</span>reader missing-parent <span class="hl sym">:</span>initarg <span class="hl sym">:</span>parent<span class="hl sym">)))</span> 267 <a id="l_179"></a><span class="hl line"> 179 </span> 268 <a id="l_180"></a><span class="hl line"> 180 </span><span class="hl sym">(</span>define-condition missing-dependency <span class="hl sym">(</span>missing-component<span class="hl sym">)</span> 269 <a id="l_181"></a><span class="hl line"> 181 </span> <span class="hl sym">((</span>required-by <span class="hl sym">:</span>initarg <span class="hl sym">:</span>required-by <span class="hl sym">:</span>reader missing-required-by<span class="hl sym">)))</span> 270 <a id="l_182"></a><span class="hl line"> 182 </span> 271 <a id="l_183"></a><span class="hl line"> 183 </span><span class="hl sym">(</span>define-condition operation-error <span class="hl sym">(</span>error<span class="hl sym">)</span> 272 <a id="l_184"></a><span class="hl line"> 184 </span> <span class="hl sym">((</span>component <span class="hl sym">:</span>reader error-component <span class="hl sym">:</span>initarg <span class="hl sym">:</span>component<span class="hl sym">)</span> 273 <a id="l_185"></a><span class="hl line"> 185 </span> <span class="hl sym">(</span>operation <span class="hl sym">:</span>reader error-operation <span class="hl sym">:</span>initarg <span class="hl sym">:</span>operation<span class="hl sym">))</span> 274 <a id="l_186"></a><span class="hl line"> 186 </span> <span class="hl sym">(:</span>report <span class="hl sym">(</span><span class="hl kwa">lambda</span> <span class="hl sym">(</span>c s<span class="hl sym">)</span> 275 <a id="l_187"></a><span class="hl line"> 187 </span> <span class="hl sym">(</span>format s <span class="hl str">"~@<erred while invoking ~A on ~A~@:>"</span> 276 <a id="l_188"></a><span class="hl line"> 188 </span> <span class="hl sym">(</span>error-operation c<span class="hl sym">) (</span>error-component c<span class="hl sym">)))))</span> 277 <a id="l_189"></a><span class="hl line"> 189 </span><span class="hl sym">(</span>define-condition compile-error <span class="hl sym">(</span>operation-error<span class="hl sym">) ())</span> 278 <a id="l_190"></a><span class="hl line"> 190 </span><span class="hl sym">(</span>define-condition compile-failed <span class="hl sym">(</span>compile-error<span class="hl sym">) ())</span> 279 <a id="l_191"></a><span class="hl line"> 191 </span><span class="hl sym">(</span>define-condition compile-warned <span class="hl sym">(</span>compile-error<span class="hl sym">) ())</span> 280 <a id="l_192"></a><span class="hl line"> 192 </span> 281 <a id="l_193"></a><span class="hl line"> 193 </span><span class="hl sym">(</span>defclass component <span class="hl sym">()</span> 282 <a id="l_194"></a><span class="hl line"> 194 </span> <span class="hl sym">((</span>name <span class="hl sym">:</span>accessor component-name <span class="hl sym">:</span>initarg <span class="hl sym">:</span>name <span class="hl sym">:</span>documentation 283 <a id="l_195"></a><span class="hl line"> 195 </span> <span class="hl str">"Component name: designator for a string composed of portable pathname characters"</span><span class="hl sym">)</span> 284 <a id="l_196"></a><span class="hl line"> 196 </span> <span class="hl sym">(</span>version <span class="hl sym">:</span>accessor component-version <span class="hl sym">:</span>initarg <span class="hl sym">:</span>version<span class="hl sym">)</span> 285 <a id="l_197"></a><span class="hl line"> 197 </span> <span class="hl sym">(</span>in-order-to <span class="hl sym">:</span>initform nil <span class="hl sym">:</span>initarg <span class="hl sym">:</span>in-order-to<span class="hl sym">)</span> 286 <a id="l_198"></a><span class="hl line"> 198 </span> <span class="hl slc">;; XXX crap name</span> 287 <a id="l_199"></a><span class="hl line"> 199 </span> <span class="hl sym">(</span>do-first <span class="hl sym">:</span>initform nil <span class="hl sym">:</span>initarg <span class="hl sym">:</span>do-first<span class="hl sym">)</span> 288 <a id="l_200"></a><span class="hl line"> 200 </span> <span class="hl slc">;; methods defined using the "inline" style inside a defsystem form:</span> 289 <a id="l_201"></a><span class="hl line"> 201 </span> <span class="hl slc">;; need to store them somewhere so we can delete them when the system</span> 290 <a id="l_202"></a><span class="hl line"> 202 </span> <span class="hl slc">;; is re-evaluated</span> 291 <a id="l_203"></a><span class="hl line"> 203 </span> <span class="hl sym">(</span>inline-methods <span class="hl sym">:</span>accessor component-inline-methods <span class="hl sym">:</span>initform nil<span class="hl sym">)</span> 292 <a id="l_204"></a><span class="hl line"> 204 </span> <span class="hl sym">(</span>parent <span class="hl sym">:</span>initarg <span class="hl sym">:</span>parent <span class="hl sym">:</span>initform nil <span class="hl sym">:</span>reader component-parent<span class="hl sym">)</span> 293 <a id="l_205"></a><span class="hl line"> 205 </span> <span class="hl slc">;; no direct accessor for pathname, we do this as a method to allow</span> 294 <a id="l_206"></a><span class="hl line"> 206 </span> <span class="hl slc">;; it to default in funky ways if not supplied</span> 295 <a id="l_207"></a><span class="hl line"> 207 </span> <span class="hl sym">(</span>relative-pathname <span class="hl sym">:</span>initarg <span class="hl sym">:</span>pathname<span class="hl sym">)</span> 296 <a id="l_208"></a><span class="hl line"> 208 </span> <span class="hl sym">(</span>operation-times <span class="hl sym">:</span>initform <span class="hl sym">(</span>make-hash-table <span class="hl sym">)</span> 297 <a id="l_209"></a><span class="hl line"> 209 </span> <span class="hl sym">:</span>accessor component-operation-times<span class="hl sym">)</span> 298 <a id="l_210"></a><span class="hl line"> 210 </span> <span class="hl slc">;; XXX we should provide some atomic interface for updating the</span> 299 <a id="l_211"></a><span class="hl line"> 211 </span> <span class="hl slc">;; component properties</span> 300 <a id="l_212"></a><span class="hl line"> 212 </span> <span class="hl sym">(</span>properties <span class="hl sym">:</span>accessor component-properties <span class="hl sym">:</span>initarg <span class="hl sym">:</span>properties 301 <a id="l_213"></a><span class="hl line"> 213 </span> <span class="hl sym">:</span>initform nil<span class="hl sym">)))</span> 302 <a id="l_214"></a><span class="hl line"> 214 </span> 303 <a id="l_215"></a><span class="hl line"> 215 </span><span class="hl slc">;;;; methods: conditions</span> 304 <a id="l_216"></a><span class="hl line"> 216 </span> 305 <a id="l_217"></a><span class="hl line"> 217 </span><span class="hl sym">(</span>defmethod <span class="hl kwa">print</span>-object <span class="hl sym">((</span>c missing-dependency<span class="hl sym">)</span> s<span class="hl sym">)</span> 306 <a id="l_218"></a><span class="hl line"> 218 </span> <span class="hl sym">(</span>format s <span class="hl str">"~@<~A, required by ~A~@:>"</span> 307 <a id="l_219"></a><span class="hl line"> 219 </span> <span class="hl sym">(</span>call-next-method c nil<span class="hl sym">) (</span>missing-required-by c<span class="hl sym">)))</span> 308 <a id="l_220"></a><span class="hl line"> 220 </span> 309 <a id="l_221"></a><span class="hl line"> 221 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> sysdef-error <span class="hl sym">(</span>format <span class="hl sym">&</span>rest arguments<span class="hl sym">)</span> 310 <a id="l_222"></a><span class="hl line"> 222 </span> <span class="hl sym">(</span>error <span class="hl sym">'</span>formatted-system-definition-error <span class="hl sym">:</span>format-control format <span class="hl sym">:</span>format-arguments arguments<span class="hl sym">))</span> 311 <a id="l_223"></a><span class="hl line"> 223 </span> 312 <a id="l_224"></a><span class="hl line"> 224 </span><span class="hl slc">;;;; methods: components</span> 313 <a id="l_225"></a><span class="hl line"> 225 </span> 314 <a id="l_226"></a><span class="hl line"> 226 </span><span class="hl sym">(</span>defmethod <span class="hl kwa">print</span>-object <span class="hl sym">((</span>c missing-component<span class="hl sym">)</span> s<span class="hl sym">)</span> 315 <a id="l_227"></a><span class="hl line"> 227 </span> <span class="hl sym">(</span>format s <span class="hl str">"~@<component ~S not found~</span> 316 <a id="l_228"></a><span class="hl line"> 228 </span><span class="hl str"> ~@[ or does not match version ~A~]~</span> 317 <a id="l_229"></a><span class="hl line"> 229 </span><span class="hl str"> ~@[ in ~A~]~@:>"</span> 318 <a id="l_230"></a><span class="hl line"> 230 </span> <span class="hl sym">(</span>missing-requires c<span class="hl sym">)</span> 319 <a id="l_231"></a><span class="hl line"> 231 </span> <span class="hl sym">(</span>missing-version c<span class="hl sym">)</span> 320 <a id="l_232"></a><span class="hl line"> 232 </span> <span class="hl sym">(</span>when <span class="hl sym">(</span>missing-parent c<span class="hl sym">)</span> 321 <a id="l_233"></a><span class="hl line"> 233 </span> <span class="hl sym">(</span>component-name <span class="hl sym">(</span>missing-parent c<span class="hl sym">)))))</span> 322 <a id="l_234"></a><span class="hl line"> 234 </span> 323 <a id="l_235"></a><span class="hl line"> 235 </span><span class="hl sym">(</span>defgeneric component-system <span class="hl sym">(</span>component<span class="hl sym">)</span> 324 <a id="l_236"></a><span class="hl line"> 236 </span> <span class="hl sym">(:</span>documentation <span class="hl str">"Find the top-level system containing COMPONENT"</span><span class="hl sym">))</span> 325 <a id="l_237"></a><span class="hl line"> 237 </span> 326 <a id="l_238"></a><span class="hl line"> 238 </span><span class="hl sym">(</span>defmethod component-system <span class="hl sym">((</span>component component<span class="hl sym">))</span> 327 <a id="l_239"></a><span class="hl line"> 239 </span> <span class="hl sym">(</span>aif <span class="hl sym">(</span>component-parent component<span class="hl sym">)</span> 328 <a id="l_240"></a><span class="hl line"> 240 </span> <span class="hl sym">(</span>component-system it<span class="hl sym">)</span> 329 <a id="l_241"></a><span class="hl line"> 241 </span> component<span class="hl sym">))</span> 330 <a id="l_242"></a><span class="hl line"> 242 </span> 331 <a id="l_243"></a><span class="hl line"> 243 </span><span class="hl sym">(</span>defmethod <span class="hl kwa">print</span>-object <span class="hl sym">((</span>c component<span class="hl sym">)</span> stream<span class="hl sym">)</span> 332 <a id="l_244"></a><span class="hl line"> 244 </span> <span class="hl sym">(</span><span class="hl kwa">print</span>-unreadable-object <span class="hl sym">(</span>c stream <span class="hl sym">:</span><span class="hl kwa">type</span> t <span class="hl sym">:</span>identity t<span class="hl sym">)</span> 333 <a id="l_245"></a><span class="hl line"> 245 </span> <span class="hl sym">(</span>ignore-errors 334 <a id="l_246"></a><span class="hl line"> 246 </span> <span class="hl sym">(</span><span class="hl kwa">prin1</span> <span class="hl sym">(</span>component-name c<span class="hl sym">)</span> stream<span class="hl sym">))))</span> 335 <a id="l_247"></a><span class="hl line"> 247 </span> 336 <a id="l_248"></a><span class="hl line"> 248 </span><span class="hl sym">(</span>defclass module <span class="hl sym">(</span>component<span class="hl sym">)</span> 337 <a id="l_249"></a><span class="hl line"> 249 </span> <span class="hl sym">((</span>components <span class="hl sym">:</span>initform nil <span class="hl sym">:</span>accessor module-components <span class="hl sym">:</span>initarg <span class="hl sym">:</span>components<span class="hl sym">)</span> 338 <a id="l_250"></a><span class="hl line"> 250 </span> <span class="hl slc">;; what to do if we can't satisfy a dependency of one of this module's</span> 339 <a id="l_251"></a><span class="hl line"> 251 </span> <span class="hl slc">;; components. This allows a limited form of conditional processing</span> 340 <a id="l_252"></a><span class="hl line"> 252 </span> <span class="hl sym">(</span><span class="hl kwa">if</span>-component-dep-fails <span class="hl sym">:</span>initform <span class="hl sym">:</span>fail 341 <a id="l_253"></a><span class="hl line"> 253 </span> <span class="hl sym">:</span>accessor module-<span class="hl kwa">if</span>-component-dep-fails 342 <a id="l_254"></a><span class="hl line"> 254 </span> <span class="hl sym">:</span>initarg <span class="hl sym">:</span><span class="hl kwa">if</span>-component-dep-fails<span class="hl sym">)</span> 343 <a id="l_255"></a><span class="hl line"> 255 </span> <span class="hl sym">(</span>default-component-class <span class="hl sym">:</span>accessor module-default-component-class 344 <a id="l_256"></a><span class="hl line"> 256 </span> <span class="hl sym">:</span>initform <span class="hl sym">'</span>cl-source-file <span class="hl sym">:</span>initarg <span class="hl sym">:</span>default-component-class<span class="hl sym">)))</span> 345 <a id="l_257"></a><span class="hl line"> 257 </span> 346 <a id="l_258"></a><span class="hl line"> 258 </span><span class="hl sym">(</span>defgeneric component-pathname <span class="hl sym">(</span>component<span class="hl sym">)</span> 347 <a id="l_259"></a><span class="hl line"> 259 </span> <span class="hl sym">(:</span>documentation <span class="hl str">"Extracts the pathname applicable for a particular component."</span><span class="hl sym">))</span> 348 <a id="l_260"></a><span class="hl line"> 260 </span> 349 <a id="l_261"></a><span class="hl line"> 261 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> component-parent-pathname <span class="hl sym">(</span>component<span class="hl sym">)</span> 350 <a id="l_262"></a><span class="hl line"> 262 </span> <span class="hl sym">(</span>aif <span class="hl sym">(</span>component-parent component<span class="hl sym">)</span> 351 <a id="l_263"></a><span class="hl line"> 263 </span> <span class="hl sym">(</span>component-pathname it<span class="hl sym">)</span> 352 <a id="l_264"></a><span class="hl line"> 264 </span> <span class="hl sym">*</span>default-pathname-defaults<span class="hl sym">*))</span> 353 <a id="l_265"></a><span class="hl line"> 265 </span> 354 <a id="l_266"></a><span class="hl line"> 266 </span><span class="hl sym">(</span>defgeneric component-relative-pathname <span class="hl sym">(</span>component<span class="hl sym">)</span> 355 <a id="l_267"></a><span class="hl line"> 267 </span> <span class="hl sym">(:</span>documentation <span class="hl str">"Extracts the relative pathname applicable for a particular component."</span><span class="hl sym">))</span> 356 <a id="l_268"></a><span class="hl line"> 268 </span> 357 <a id="l_269"></a><span class="hl line"> 269 </span><span class="hl sym">(</span>defmethod component-relative-pathname <span class="hl sym">((</span>component module<span class="hl sym">))</span> 358 <a id="l_270"></a><span class="hl line"> 270 </span> <span class="hl sym">(</span><span class="hl kwa">or</span> <span class="hl sym">(</span>slot-value component <span class="hl sym">'</span>relative-pathname<span class="hl sym">)</span> 359 <a id="l_271"></a><span class="hl line"> 271 </span> <span class="hl sym">(</span>make-pathname 360 <a id="l_272"></a><span class="hl line"> 272 </span> <span class="hl sym">:</span>directory `<span class="hl sym">(:</span>relative <span class="hl sym">,(</span>component-name component<span class="hl sym">))</span> 361 <a id="l_273"></a><span class="hl line"> 273 </span> <span class="hl sym">:</span>host <span class="hl sym">(</span>pathname-host <span class="hl sym">(</span>component-parent-pathname component<span class="hl sym">)))))</span> 362 <a id="l_274"></a><span class="hl line"> 274 </span> 363 <a id="l_275"></a><span class="hl line"> 275 </span><span class="hl sym">(</span>defmethod component-pathname <span class="hl sym">((</span>component component<span class="hl sym">))</span> 364 <a id="l_276"></a><span class="hl line"> 276 </span> <span class="hl sym">(</span>let <span class="hl sym">((*</span>default-pathname-defaults<span class="hl sym">* (</span>component-parent-pathname component<span class="hl sym">)))</span> 365 <a id="l_277"></a><span class="hl line"> 277 </span> <span class="hl sym">(</span>merge-pathnames <span class="hl sym">(</span>component-relative-pathname component<span class="hl sym">))))</span> 366 <a id="l_278"></a><span class="hl line"> 278 </span> 367 <a id="l_279"></a><span class="hl line"> 279 </span><span class="hl sym">(</span>defgeneric component-property <span class="hl sym">(</span>component property<span class="hl sym">))</span> 368 <a id="l_280"></a><span class="hl line"> 280 </span> 369 <a id="l_281"></a><span class="hl line"> 281 </span><span class="hl sym">(</span>defmethod component-property <span class="hl sym">((</span>c component<span class="hl sym">)</span> property<span class="hl sym">)</span> 370 <a id="l_282"></a><span class="hl line"> 282 </span> <span class="hl sym">(</span><span class="hl kwa">cdr</span> <span class="hl sym">(</span><span class="hl kwa">assoc</span> property <span class="hl sym">(</span>slot-value c <span class="hl sym">'</span>properties<span class="hl sym">) :</span>test #<span class="hl sym">'</span><span class="hl kwa">equal</span><span class="hl sym">)))</span> 371 <a id="l_283"></a><span class="hl line"> 283 </span> 372 <a id="l_284"></a><span class="hl line"> 284 </span><span class="hl sym">(</span>defgeneric <span class="hl sym">(</span>setf component-property<span class="hl sym">) (</span>new-value component property<span class="hl sym">))</span> 373 <a id="l_285"></a><span class="hl line"> 285 </span> 374 <a id="l_286"></a><span class="hl line"> 286 </span><span class="hl sym">(</span>defmethod <span class="hl sym">(</span>setf component-property<span class="hl sym">) (</span>new-value <span class="hl sym">(</span>c component<span class="hl sym">)</span> property<span class="hl sym">)</span> 375 <a id="l_287"></a><span class="hl line"> 287 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>a <span class="hl sym">(</span><span class="hl kwa">assoc</span> property <span class="hl sym">(</span>slot-value c <span class="hl sym">'</span>properties<span class="hl sym">) :</span>test #<span class="hl sym">'</span><span class="hl kwa">equal</span><span class="hl sym">)))</span> 376 <a id="l_288"></a><span class="hl line"> 288 </span> <span class="hl sym">(</span><span class="hl kwa">if</span> a 377 <a id="l_289"></a><span class="hl line"> 289 </span> <span class="hl sym">(</span>setf <span class="hl sym">(</span><span class="hl kwa">cdr</span> a<span class="hl sym">)</span> new-value<span class="hl sym">)</span> 378 <a id="l_290"></a><span class="hl line"> 290 </span> <span class="hl sym">(</span>setf <span class="hl sym">(</span>slot-value c <span class="hl sym">'</span>properties<span class="hl sym">)</span> 379 <a id="l_291"></a><span class="hl line"> 291 </span> <span class="hl sym">(</span>acons property new-value <span class="hl sym">(</span>slot-value c <span class="hl sym">'</span>properties<span class="hl sym">))))))</span> 380 <a id="l_292"></a><span class="hl line"> 292 </span> 381 <a id="l_293"></a><span class="hl line"> 293 </span><span class="hl sym">(</span>defclass system <span class="hl sym">(</span>module<span class="hl sym">)</span> 382 <a id="l_294"></a><span class="hl line"> 294 </span> <span class="hl sym">((</span>description <span class="hl sym">:</span>accessor system-description <span class="hl sym">:</span>initarg <span class="hl sym">:</span>description<span class="hl sym">)</span> 383 <a id="l_295"></a><span class="hl line"> 295 </span> <span class="hl sym">(</span>long-description 384 <a id="l_296"></a><span class="hl line"> 296 </span> <span class="hl sym">:</span>accessor system-long-description <span class="hl sym">:</span>initarg <span class="hl sym">:</span>long-description<span class="hl sym">)</span> 385 <a id="l_297"></a><span class="hl line"> 297 </span> <span class="hl sym">(</span>author <span class="hl sym">:</span>accessor system-author <span class="hl sym">:</span>initarg <span class="hl sym">:</span>author<span class="hl sym">)</span> 386 <a id="l_298"></a><span class="hl line"> 298 </span> <span class="hl sym">(</span>maintainer <span class="hl sym">:</span>accessor system-maintainer <span class="hl sym">:</span>initarg <span class="hl sym">:</span>maintainer<span class="hl sym">)</span> 387 <a id="l_299"></a><span class="hl line"> 299 </span> <span class="hl sym">(</span>licence <span class="hl sym">:</span>accessor system-licence <span class="hl sym">:</span>initarg <span class="hl sym">:</span>licence 388 <a id="l_300"></a><span class="hl line"> 300 </span> <span class="hl sym">:</span>accessor system-license <span class="hl sym">:</span>initarg <span class="hl sym">:</span>license<span class="hl sym">)))</span> 389 <a id="l_301"></a><span class="hl line"> 301 </span> 390 <a id="l_302"></a><span class="hl line"> 302 </span><span class="hl slc">;;; version-satisfies</span> 391 <a id="l_303"></a><span class="hl line"> 303 </span> 392 <a id="l_304"></a><span class="hl line"> 304 </span><span class="hl slc">;;; with apologies to christophe rhodes ...</span> 393 <a id="l_305"></a><span class="hl line"> 305 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> split <span class="hl sym">(</span>string <span class="hl sym">&</span>optional <span class="hl kwa">max</span> <span class="hl sym">(</span>ws <span class="hl sym">'(</span>#\Space #\Tab<span class="hl sym">)))</span> 394 <a id="l_306"></a><span class="hl line"> 306 </span> <span class="hl sym">(</span>flet <span class="hl sym">((</span>is-ws <span class="hl sym">(</span>char<span class="hl sym">) (</span>find char ws<span class="hl sym">)))</span> 395 <a id="l_307"></a><span class="hl line"> 307 </span> <span class="hl sym">(</span>nreverse 396 <a id="l_308"></a><span class="hl line"> 308 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span><span class="hl kwa">list</span> nil<span class="hl sym">) (</span>start <span class="hl num">0</span><span class="hl sym">) (</span>words <span class="hl num">0</span><span class="hl sym">)</span> end<span class="hl sym">)</span> 397 <a id="l_309"></a><span class="hl line"> 309 </span> <span class="hl sym">(</span>loop 398 <a id="l_310"></a><span class="hl line"> 310 </span> <span class="hl sym">(</span>when <span class="hl sym">(</span><span class="hl kwa">and max</span> <span class="hl sym">(>=</span> words <span class="hl sym">(</span><span class="hl num">1</span>- <span class="hl kwa">max</span><span class="hl sym">)))</span> 399 <a id="l_311"></a><span class="hl line"> 311 </span> <span class="hl sym">(</span>return <span class="hl sym">(</span><span class="hl kwa">cons</span> <span class="hl sym">(</span>subseq string start<span class="hl sym">)</span> <span class="hl kwa">list</span><span class="hl sym">)))</span> 400 <a id="l_312"></a><span class="hl line"> 312 </span> <span class="hl sym">(</span>setf end <span class="hl sym">(</span>position-<span class="hl kwa">if</span> #<span class="hl sym">'</span>is-ws string <span class="hl sym">:</span>start start<span class="hl sym">))</span> 401 <a id="l_313"></a><span class="hl line"> 313 </span> <span class="hl sym">(</span>push <span class="hl sym">(</span>subseq string start end<span class="hl sym">)</span> <span class="hl kwa">list</span><span class="hl sym">)</span> 402 <a id="l_314"></a><span class="hl line"> 314 </span> <span class="hl sym">(</span>incf words<span class="hl sym">)</span> 403 <a id="l_315"></a><span class="hl line"> 315 </span> <span class="hl sym">(</span>unless end <span class="hl sym">(</span>return <span class="hl kwa">list</span><span class="hl sym">))</span> 404 <a id="l_316"></a><span class="hl line"> 316 </span> <span class="hl sym">(</span>setf start <span class="hl sym">(</span><span class="hl num">1</span><span class="hl sym">+</span> end<span class="hl sym">)))))))</span> 405 <a id="l_317"></a><span class="hl line"> 317 </span> 406 <a id="l_318"></a><span class="hl line"> 318 </span><span class="hl sym">(</span>defgeneric version-satisfies <span class="hl sym">(</span>component version<span class="hl sym">))</span> 407 <a id="l_319"></a><span class="hl line"> 319 </span> 408 <a id="l_320"></a><span class="hl line"> 320 </span><span class="hl sym">(</span>defmethod version-satisfies <span class="hl sym">((</span>c component<span class="hl sym">)</span> version<span class="hl sym">)</span> 409 <a id="l_321"></a><span class="hl line"> 321 </span> <span class="hl sym">(</span>unless <span class="hl sym">(</span><span class="hl kwa">and</span> version <span class="hl sym">(</span>slot-<span class="hl kwa">boundp</span> c <span class="hl sym">'</span>version<span class="hl sym">))</span> 410 <a id="l_322"></a><span class="hl line"> 322 </span> <span class="hl sym">(</span>return-from version-satisfies t<span class="hl sym">))</span> 411 <a id="l_323"></a><span class="hl line"> 323 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>x <span class="hl sym">(</span><span class="hl kwa">mapcar</span> #<span class="hl sym">'</span>parse-integer 412 <a id="l_324"></a><span class="hl line"> 324 </span> <span class="hl sym">(</span>split <span class="hl sym">(</span>component-version c<span class="hl sym">)</span> nil <span class="hl sym">'(</span>#\.<span class="hl sym">))))</span> 413 <a id="l_325"></a><span class="hl line"> 325 </span> <span class="hl sym">(</span>y <span class="hl sym">(</span><span class="hl kwa">mapcar</span> #<span class="hl sym">'</span>parse-integer 414 <a id="l_326"></a><span class="hl line"> 326 </span> <span class="hl sym">(</span>split version nil <span class="hl sym">'(</span>#\.<span class="hl sym">)))))</span> 415 <a id="l_327"></a><span class="hl line"> 327 </span> <span class="hl sym">(</span>labels <span class="hl sym">((</span>bigger <span class="hl sym">(</span>x y<span class="hl sym">)</span> 416 <a id="l_328"></a><span class="hl line"> 328 </span> <span class="hl sym">(</span><span class="hl kwa">cond</span> <span class="hl sym">((</span><span class="hl kwa">not</span> y<span class="hl sym">)</span> t<span class="hl sym">)</span> 417 <a id="l_329"></a><span class="hl line"> 329 </span> <span class="hl sym">((</span><span class="hl kwa">not</span> x<span class="hl sym">)</span> nil<span class="hl sym">)</span> 418 <a id="l_330"></a><span class="hl line"> 330 </span> <span class="hl sym">((> (</span><span class="hl kwa">car</span> x<span class="hl sym">) (</span><span class="hl kwa">car</span> y<span class="hl sym">))</span> t<span class="hl sym">)</span> 419 <a id="l_331"></a><span class="hl line"> 331 </span> <span class="hl sym">((= (</span><span class="hl kwa">car</span> x<span class="hl sym">) (</span><span class="hl kwa">car</span> y<span class="hl sym">))</span> 420 <a id="l_332"></a><span class="hl line"> 332 </span> <span class="hl sym">(</span>bigger <span class="hl sym">(</span><span class="hl kwa">cdr</span> x<span class="hl sym">) (</span><span class="hl kwa">cdr</span> y<span class="hl sym">))))))</span> 421 <a id="l_333"></a><span class="hl line"> 333 </span> <span class="hl sym">(</span><span class="hl kwa">and</span> <span class="hl sym">(= (</span><span class="hl kwa">car</span> x<span class="hl sym">) (</span><span class="hl kwa">car</span> y<span class="hl sym">))</span> 422 <a id="l_334"></a><span class="hl line"> 334 </span> <span class="hl sym">(</span><span class="hl kwa">or</span> <span class="hl sym">(</span><span class="hl kwa">not</span> <span class="hl sym">(</span><span class="hl kwa">cdr</span> y<span class="hl sym">)) (</span>bigger <span class="hl sym">(</span><span class="hl kwa">cdr</span> x<span class="hl sym">) (</span><span class="hl kwa">cdr</span> y<span class="hl sym">)))))))</span> 423 <a id="l_335"></a><span class="hl line"> 335 </span> 424 <a id="l_336"></a><span class="hl line"> 336 </span><span class="hl slc">;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</span> 425 <a id="l_337"></a><span class="hl line"> 337 </span><span class="hl slc">;;; finding systems</span> 426 <a id="l_338"></a><span class="hl line"> 338 </span> 427 <a id="l_339"></a><span class="hl line"> 339 </span><span class="hl sym">(</span>defvar <span class="hl sym">*</span>defined-systems<span class="hl sym">* (</span>make-hash-table <span class="hl sym">:</span>test <span class="hl sym">'</span><span class="hl kwa">equal</span><span class="hl sym">))</span> 428 <a id="l_340"></a><span class="hl line"> 340 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> coerce-name <span class="hl sym">(</span>name<span class="hl sym">)</span> 429 <a id="l_341"></a><span class="hl line"> 341 </span> <span class="hl sym">(</span>typecase name 430 <a id="l_342"></a><span class="hl line"> 342 </span> <span class="hl sym">(</span>component <span class="hl sym">(</span>component-name name<span class="hl sym">))</span> 431 <a id="l_343"></a><span class="hl line"> 343 </span> <span class="hl sym">(</span>symbol <span class="hl sym">(</span>string-downcase <span class="hl sym">(</span>symbol-name name<span class="hl sym">)))</span> 432 <a id="l_344"></a><span class="hl line"> 344 </span> <span class="hl sym">(</span>string name<span class="hl sym">)</span> 433 <a id="l_345"></a><span class="hl line"> 345 </span> <span class="hl sym">(</span>t <span class="hl sym">(</span>sysdef-error <span class="hl str">"~@<invalid component designator ~A~@:>"</span> name<span class="hl sym">))))</span> 434 <a id="l_346"></a><span class="hl line"> 346 </span> 435 <a id="l_347"></a><span class="hl line"> 347 </span><span class="hl slc">;;; for the sake of keeping things reasonably neat, we adopt a</span> 436 <a id="l_348"></a><span class="hl line"> 348 </span><span class="hl slc">;;; convention that functions in this list are prefixed SYSDEF-</span> 437 <a id="l_349"></a><span class="hl line"> 349 </span> 438 <a id="l_350"></a><span class="hl line"> 350 </span><span class="hl sym">(</span>defvar <span class="hl sym">*</span>system-definition-search-functions<span class="hl sym">*</span> 439 <a id="l_351"></a><span class="hl line"> 351 </span> <span class="hl sym">'(</span>sysdef-central-registry-search<span class="hl sym">))</span> 440 <a id="l_352"></a><span class="hl line"> 352 </span> 441 <a id="l_353"></a><span class="hl line"> 353 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> system-definition-pathname <span class="hl sym">(</span>system<span class="hl sym">)</span> 442 <a id="l_354"></a><span class="hl line"> 354 </span> <span class="hl sym">(</span>some <span class="hl sym">(</span><span class="hl kwa">lambda</span> <span class="hl sym">(</span>x<span class="hl sym">) (</span>funcall x system<span class="hl sym">))</span> 443 <a id="l_355"></a><span class="hl line"> 355 </span> <span class="hl sym">*</span>system-definition-search-functions<span class="hl sym">*))</span> 444 <a id="l_356"></a><span class="hl line"> 356 </span> 445 <a id="l_357"></a><span class="hl line"> 357 </span><span class="hl sym">(</span>defvar <span class="hl sym">*</span>central-registry<span class="hl sym">*</span> 446 <a id="l_358"></a><span class="hl line"> 358 </span> <span class="hl sym">'(*</span>default-pathname-defaults<span class="hl sym">*</span> 447 <a id="l_359"></a><span class="hl line"> 359 </span> #<span class="hl sym">+</span>nil <span class="hl str">"/home/dan/src/sourceforge/cclan/asdf/systems/"</span> 448 <a id="l_360"></a><span class="hl line"> 360 </span> #<span class="hl sym">+</span>nil <span class="hl str">"telent:asdf;systems;"</span><span class="hl sym">))</span> 449 <a id="l_361"></a><span class="hl line"> 361 </span> 450 <a id="l_362"></a><span class="hl line"> 362 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> sysdef-central-registry-search <span class="hl sym">(</span>system<span class="hl sym">)</span> 451 <a id="l_363"></a><span class="hl line"> 363 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>name <span class="hl sym">(</span>coerce-name system<span class="hl sym">)))</span> 452 <a id="l_364"></a><span class="hl line"> 364 </span> <span class="hl sym">(</span>block nil 453 <a id="l_365"></a><span class="hl line"> 365 </span> <span class="hl sym">(</span>dolist <span class="hl sym">(</span>dir <span class="hl sym">*</span>central-registry<span class="hl sym">*)</span> 454 <a id="l_366"></a><span class="hl line"> 366 </span> <span class="hl sym">(</span>let<span class="hl sym">* ((</span>defaults <span class="hl sym">(</span><span class="hl kwa">eval</span> dir<span class="hl sym">))</span> 455 <a id="l_367"></a><span class="hl line"> 367 </span> <span class="hl sym">(</span>file <span class="hl sym">(</span><span class="hl kwa">and</span> defaults 456 <a id="l_368"></a><span class="hl line"> 368 </span> <span class="hl sym">(</span>make-pathname 457 <a id="l_369"></a><span class="hl line"> 369 </span> <span class="hl sym">:</span>defaults defaults <span class="hl sym">:</span>version <span class="hl sym">:</span>newest 458 <a id="l_370"></a><span class="hl line"> 370 </span> <span class="hl sym">:</span>name name <span class="hl sym">:</span><span class="hl kwa">type</span> <span class="hl str">"asd"</span> <span class="hl sym">:</span>case <span class="hl sym">:</span>local<span class="hl sym">))))</span> 459 <a id="l_371"></a><span class="hl line"> 371 </span> <span class="hl sym">(</span><span class="hl kwa">if</span> <span class="hl sym">(</span><span class="hl kwa">and</span> file <span class="hl sym">(</span>probe-file file<span class="hl sym">))</span> 460 <a id="l_372"></a><span class="hl line"> 372 </span> <span class="hl sym">(</span>return file<span class="hl sym">)))))))</span> 461 <a id="l_373"></a><span class="hl line"> 373 </span> 462 <a id="l_374"></a><span class="hl line"> 374 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> make-temporary-package <span class="hl sym">()</span> 463 <a id="l_375"></a><span class="hl line"> 375 </span> <span class="hl sym">(</span>flet <span class="hl sym">((</span>try <span class="hl sym">(</span>counter<span class="hl sym">)</span> 464 <a id="l_376"></a><span class="hl line"> 376 </span> <span class="hl sym">(</span>ignore-errors 465 <a id="l_377"></a><span class="hl line"> 377 </span> <span class="hl sym">(</span>make-package <span class="hl sym">(</span>format nil <span class="hl str">"ASDF~D"</span> counter<span class="hl sym">)</span> 466 <a id="l_378"></a><span class="hl line"> 378 </span> <span class="hl sym">:</span>use <span class="hl sym">'(:</span>cl <span class="hl sym">:</span>asdf<span class="hl sym">)))))</span> 467 <a id="l_379"></a><span class="hl line"> 379 </span> <span class="hl sym">(</span>do<span class="hl sym">* ((</span>counter <span class="hl num">0</span> <span class="hl sym">(+</span> counter <span class="hl num">1</span><span class="hl sym">))</span> 468 <a id="l_380"></a><span class="hl line"> 380 </span> <span class="hl sym">(</span>package <span class="hl sym">(</span>try counter<span class="hl sym">) (</span>try counter<span class="hl sym">)))</span> 469 <a id="l_381"></a><span class="hl line"> 381 </span> <span class="hl sym">(</span>package package<span class="hl sym">))))</span> 470 <a id="l_382"></a><span class="hl line"> 382 </span> 471 <a id="l_383"></a><span class="hl line"> 383 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> find-system <span class="hl sym">(</span>name <span class="hl sym">&</span>optional <span class="hl sym">(</span>error-p t<span class="hl sym">))</span> 472 <a id="l_384"></a><span class="hl line"> 384 </span> <span class="hl sym">(</span>let<span class="hl sym">* ((</span>name <span class="hl sym">(</span>coerce-name name<span class="hl sym">))</span> 473 <a id="l_385"></a><span class="hl line"> 385 </span> <span class="hl sym">(</span>in-memory <span class="hl sym">(</span>gethash name <span class="hl sym">*</span>defined-systems<span class="hl sym">*))</span> 474 <a id="l_386"></a><span class="hl line"> 386 </span> <span class="hl sym">(</span>on-disk <span class="hl sym">(</span>system-definition-pathname name<span class="hl sym">)))</span> 475 <a id="l_387"></a><span class="hl line"> 387 </span> <span class="hl sym">(</span>when <span class="hl sym">(</span><span class="hl kwa">and</span> on-disk 476 <a id="l_388"></a><span class="hl line"> 388 </span> <span class="hl sym">(</span><span class="hl kwa">or</span> <span class="hl sym">(</span><span class="hl kwa">not</span> in-memory<span class="hl sym">)</span> 477 <a id="l_389"></a><span class="hl line"> 389 </span> <span class="hl sym">(< (</span><span class="hl kwa">car</span> in-memory<span class="hl sym">) (</span>file-write-date on-disk<span class="hl sym">))))</span> 478 <a id="l_390"></a><span class="hl line"> 390 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>package <span class="hl sym">(</span>make-temporary-package<span class="hl sym">)))</span> 479 <a id="l_391"></a><span class="hl line"> 391 </span> <span class="hl sym">(</span>unwind-protect 480 <a id="l_392"></a><span class="hl line"> 392 </span> <span class="hl sym">(</span>let <span class="hl sym">((*</span>package<span class="hl sym">*</span> package<span class="hl sym">))</span> 481 <a id="l_393"></a><span class="hl line"> 393 </span> <span class="hl sym">(</span>format 482 <a id="l_394"></a><span class="hl line"> 394 </span> <span class="hl sym">*</span>verbose-out<span class="hl sym">*</span> 483 <a id="l_395"></a><span class="hl line"> 395 </span> <span class="hl str">"~&~@<; ~@;loading system definition from ~A into ~A~@:>~%"</span> 484 <a id="l_396"></a><span class="hl line"> 396 </span> <span class="hl slc">;; FIXME: This wants to be (ENOUGH-NAMESTRING</span> 485 <a id="l_397"></a><span class="hl line"> 397 </span> <span class="hl slc">;; ON-DISK), but CMUCL barfs on that.</span> 486 <a id="l_398"></a><span class="hl line"> 398 </span> on-disk 487 <a id="l_399"></a><span class="hl line"> 399 </span> <span class="hl sym">*</span>package<span class="hl sym">*)</span> 488 <a id="l_400"></a><span class="hl line"> 400 </span> <span class="hl sym">(</span><span class="hl kwa">load</span> on-disk<span class="hl sym">))</span> 489 <a id="l_401"></a><span class="hl line"> 401 </span> <span class="hl sym">(</span>delete-package package<span class="hl sym">))))</span> 490 <a id="l_402"></a><span class="hl line"> 402 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>in-memory <span class="hl sym">(</span>gethash name <span class="hl sym">*</span>defined-systems<span class="hl sym">*)))</span> 491 <a id="l_403"></a><span class="hl line"> 403 </span> <span class="hl sym">(</span><span class="hl kwa">if</span> in-memory 492 <a id="l_404"></a><span class="hl line"> 404 </span> <span class="hl sym">(</span><span class="hl kwa">progn</span> <span class="hl sym">(</span><span class="hl kwa">if</span> on-disk <span class="hl sym">(</span>setf <span class="hl sym">(</span><span class="hl kwa">car</span> in-memory<span class="hl sym">) (</span>file-write-date on-disk<span class="hl sym">)))</span> 493 <a id="l_405"></a><span class="hl line"> 405 </span> <span class="hl sym">(</span><span class="hl kwa">cdr</span> in-memory<span class="hl sym">))</span> 494 <a id="l_406"></a><span class="hl line"> 406 </span> <span class="hl sym">(</span><span class="hl kwa">if</span> error-p <span class="hl sym">(</span>error <span class="hl sym">'</span>missing-component <span class="hl sym">:</span>requires name<span class="hl sym">))))))</span> 495 <a id="l_407"></a><span class="hl line"> 407 </span> 496 <a id="l_408"></a><span class="hl line"> 408 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> register-system <span class="hl sym">(</span>name system<span class="hl sym">)</span> 497 <a id="l_409"></a><span class="hl line"> 409 </span> <span class="hl sym">(</span>format <span class="hl sym">*</span>verbose-out<span class="hl sym">*</span> <span class="hl str">"~&~@<; ~@;registering ~A as ~A~@:>~%"</span> system name<span class="hl sym">)</span> 498 <a id="l_410"></a><span class="hl line"> 410 </span> <span class="hl sym">(</span>setf <span class="hl sym">(</span>gethash <span class="hl sym">(</span>coerce-name name<span class="hl sym">) *</span>defined-systems<span class="hl sym">*)</span> 499 <a id="l_411"></a><span class="hl line"> 411 </span> <span class="hl sym">(</span><span class="hl kwa">cons</span> <span class="hl sym">(</span>get-universal-time<span class="hl sym">)</span> system<span class="hl sym">)))</span> 500 <a id="l_412"></a><span class="hl line"> 412 </span> 501 <a id="l_413"></a><span class="hl line"> 413 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> system-registered-p <span class="hl sym">(</span>name<span class="hl sym">)</span> 502 <a id="l_414"></a><span class="hl line"> 414 </span> <span class="hl sym">(</span>gethash <span class="hl sym">(</span>coerce-name name<span class="hl sym">) *</span>defined-systems<span class="hl sym">*))</span> 503 <a id="l_415"></a><span class="hl line"> 415 </span> 504 <a id="l_416"></a><span class="hl line"> 416 </span><span class="hl slc">;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</span> 505 <a id="l_417"></a><span class="hl line"> 417 </span><span class="hl slc">;;; finding components</span> 506 <a id="l_418"></a><span class="hl line"> 418 </span> 507 <a id="l_419"></a><span class="hl line"> 419 </span><span class="hl sym">(</span>defgeneric find-component <span class="hl sym">(</span>module name <span class="hl sym">&</span>optional version<span class="hl sym">)</span> 508 <a id="l_420"></a><span class="hl line"> 420 </span> <span class="hl sym">(:</span>documentation <span class="hl str">"Finds the component with name NAME present in the</span> 509 <a id="l_421"></a><span class="hl line"> 421 </span><span class="hl str">MODULE module; if MODULE is nil, then the component is assumed to be a</span> 510 <a id="l_422"></a><span class="hl line"> 422 </span><span class="hl str">system."</span><span class="hl sym">))</span> 511 <a id="l_423"></a><span class="hl line"> 423 </span> 512 <a id="l_424"></a><span class="hl line"> 424 </span><span class="hl sym">(</span>defmethod find-component <span class="hl sym">((</span>module module<span class="hl sym">)</span> name <span class="hl sym">&</span>optional version<span class="hl sym">)</span> 513 <a id="l_425"></a><span class="hl line"> 425 </span> <span class="hl sym">(</span><span class="hl kwa">if</span> <span class="hl sym">(</span>slot-<span class="hl kwa">boundp</span> module <span class="hl sym">'</span>components<span class="hl sym">)</span> 514 <a id="l_426"></a><span class="hl line"> 426 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>m <span class="hl sym">(</span>find name <span class="hl sym">(</span>module-components module<span class="hl sym">)</span> 515 <a id="l_427"></a><span class="hl line"> 427 </span> <span class="hl sym">:</span>test #<span class="hl sym">'</span><span class="hl kwa">equal</span> <span class="hl sym">:</span>key #<span class="hl sym">'</span>component-name<span class="hl sym">)))</span> 516 <a id="l_428"></a><span class="hl line"> 428 </span> <span class="hl sym">(</span><span class="hl kwa">if</span> <span class="hl sym">(</span><span class="hl kwa">and</span> m <span class="hl sym">(</span>version-satisfies m version<span class="hl sym">))</span> m<span class="hl sym">))))</span> 517 <a id="l_429"></a><span class="hl line"> 429 </span> 518 <a id="l_430"></a><span class="hl line"> 430 </span> 519 <a id="l_431"></a><span class="hl line"> 431 </span><span class="hl slc">;;; a component with no parent is a system</span> 520 <a id="l_432"></a><span class="hl line"> 432 </span><span class="hl sym">(</span>defmethod find-component <span class="hl sym">((</span>module <span class="hl sym">(</span>eql nil<span class="hl sym">))</span> name <span class="hl sym">&</span>optional version<span class="hl sym">)</span> 521 <a id="l_433"></a><span class="hl line"> 433 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>m <span class="hl sym">(</span>find-system name nil<span class="hl sym">)))</span> 522 <a id="l_434"></a><span class="hl line"> 434 </span> <span class="hl sym">(</span><span class="hl kwa">if</span> <span class="hl sym">(</span><span class="hl kwa">and</span> m <span class="hl sym">(</span>version-satisfies m version<span class="hl sym">))</span> m<span class="hl sym">)))</span> 523 <a id="l_435"></a><span class="hl line"> 435 </span> 524 <a id="l_436"></a><span class="hl line"> 436 </span><span class="hl slc">;;; component subclasses</span> 525 <a id="l_437"></a><span class="hl line"> 437 </span> 526 <a id="l_438"></a><span class="hl line"> 438 </span><span class="hl sym">(</span>defclass source-file <span class="hl sym">(</span>component<span class="hl sym">) ())</span> 527 <a id="l_439"></a><span class="hl line"> 439 </span> 528 <a id="l_440"></a><span class="hl line"> 440 </span><span class="hl sym">(</span>defclass cl-source-file <span class="hl sym">(</span>source-file<span class="hl sym">) ())</span> 529 <a id="l_441"></a><span class="hl line"> 441 </span><span class="hl sym">(</span>defclass c-source-file <span class="hl sym">(</span>source-file<span class="hl sym">) ())</span> 530 <a id="l_442"></a><span class="hl line"> 442 </span><span class="hl sym">(</span>defclass java-source-file <span class="hl sym">(</span>source-file<span class="hl sym">) ())</span> 531 <a id="l_443"></a><span class="hl line"> 443 </span><span class="hl sym">(</span>defclass static-file <span class="hl sym">(</span>source-file<span class="hl sym">) ())</span> 532 <a id="l_444"></a><span class="hl line"> 444 </span><span class="hl sym">(</span>defclass doc-file <span class="hl sym">(</span>static-file<span class="hl sym">) ())</span> 533 <a id="l_445"></a><span class="hl line"> 445 </span><span class="hl sym">(</span>defclass html-file <span class="hl sym">(</span>doc-file<span class="hl sym">) ())</span> 534 <a id="l_446"></a><span class="hl line"> 446 </span> 535 <a id="l_447"></a><span class="hl line"> 447 </span><span class="hl sym">(</span>defgeneric source-file-<span class="hl kwa">type</span> <span class="hl sym">(</span>component system<span class="hl sym">))</span> 536 <a id="l_448"></a><span class="hl line"> 448 </span><span class="hl sym">(</span>defmethod source-file-<span class="hl kwa">type</span> <span class="hl sym">((</span>c cl-source-file<span class="hl sym">) (</span>s module<span class="hl sym">))</span> <span class="hl str">"lisp"</span><span class="hl sym">)</span> 537 <a id="l_449"></a><span class="hl line"> 449 </span><span class="hl sym">(</span>defmethod source-file-<span class="hl kwa">type</span> <span class="hl sym">((</span>c c-source-file<span class="hl sym">) (</span>s module<span class="hl sym">))</span> <span class="hl str">"c"</span><span class="hl sym">)</span> 538 <a id="l_450"></a><span class="hl line"> 450 </span><span class="hl sym">(</span>defmethod source-file-<span class="hl kwa">type</span> <span class="hl sym">((</span>c java-source-file<span class="hl sym">) (</span>s module<span class="hl sym">))</span> <span class="hl str">"java"</span><span class="hl sym">)</span> 539 <a id="l_451"></a><span class="hl line"> 451 </span><span class="hl sym">(</span>defmethod source-file-<span class="hl kwa">type</span> <span class="hl sym">((</span>c html-file<span class="hl sym">) (</span>s module<span class="hl sym">))</span> <span class="hl str">"html"</span><span class="hl sym">)</span> 540 <a id="l_452"></a><span class="hl line"> 452 </span><span class="hl sym">(</span>defmethod source-file-<span class="hl kwa">type</span> <span class="hl sym">((</span>c static-file<span class="hl sym">) (</span>s module<span class="hl sym">))</span> nil<span class="hl sym">)</span> 541 <a id="l_453"></a><span class="hl line"> 453 </span> 542 <a id="l_454"></a><span class="hl line"> 454 </span><span class="hl sym">(</span>defmethod component-relative-pathname <span class="hl sym">((</span>component source-file<span class="hl sym">))</span> 543 <a id="l_455"></a><span class="hl line"> 455 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>relative-pathname <span class="hl sym">(</span>slot-value component <span class="hl sym">'</span>relative-pathname<span class="hl sym">)))</span> 544 <a id="l_456"></a><span class="hl line"> 456 </span> <span class="hl sym">(</span><span class="hl kwa">if</span> relative-pathname 545 <a id="l_457"></a><span class="hl line"> 457 </span> <span class="hl sym">(</span>merge-pathnames 546 <a id="l_458"></a><span class="hl line"> 458 </span> relative-pathname 547 <a id="l_459"></a><span class="hl line"> 459 </span> <span class="hl sym">(</span>make-pathname 548 <a id="l_460"></a><span class="hl line"> 460 </span> <span class="hl sym">:</span><span class="hl kwa">type</span> <span class="hl sym">(</span>source-file-<span class="hl kwa">type</span> component <span class="hl sym">(</span>component-system component<span class="hl sym">))))</span> 549 <a id="l_461"></a><span class="hl line"> 461 </span> <span class="hl sym">(</span>let<span class="hl sym">* ((*</span>default-pathname-defaults<span class="hl sym">*</span> 550 <a id="l_462"></a><span class="hl line"> 462 </span> <span class="hl sym">(</span>component-parent-pathname component<span class="hl sym">))</span> 551 <a id="l_463"></a><span class="hl line"> 463 </span> <span class="hl sym">(</span>name-<span class="hl kwa">type</span> 552 <a id="l_464"></a><span class="hl line"> 464 </span> <span class="hl sym">(</span>make-pathname 553 <a id="l_465"></a><span class="hl line"> 465 </span> <span class="hl sym">:</span>name <span class="hl sym">(</span>component-name component<span class="hl sym">)</span> 554 <a id="l_466"></a><span class="hl line"> 466 </span> <span class="hl sym">:</span><span class="hl kwa">type</span> <span class="hl sym">(</span>source-file-<span class="hl kwa">type</span> component 555 <a id="l_467"></a><span class="hl line"> 467 </span> <span class="hl sym">(</span>component-system component<span class="hl sym">)))))</span> 556 <a id="l_468"></a><span class="hl line"> 468 </span> name-<span class="hl kwa">type</span><span class="hl sym">))))</span> 557 <a id="l_469"></a><span class="hl line"> 469 </span> 558 <a id="l_470"></a><span class="hl line"> 470 </span><span class="hl slc">;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</span> 559 <a id="l_471"></a><span class="hl line"> 471 </span><span class="hl slc">;;; operations</span> 560 <a id="l_472"></a><span class="hl line"> 472 </span> 561 <a id="l_473"></a><span class="hl line"> 473 </span><span class="hl slc">;;; one of these is instantiated whenever (operate ) is called</span> 562 <a id="l_474"></a><span class="hl line"> 474 </span> 563 <a id="l_475"></a><span class="hl line"> 475 </span><span class="hl sym">(</span>defclass operation <span class="hl sym">()</span> 564 <a id="l_476"></a><span class="hl line"> 476 </span> <span class="hl sym">((</span>forced <span class="hl sym">:</span>initform nil <span class="hl sym">:</span>initarg <span class="hl sym">:</span>force <span class="hl sym">:</span>accessor operation-forced<span class="hl sym">)</span> 565 <a id="l_477"></a><span class="hl line"> 477 </span> <span class="hl sym">(</span>original-initargs <span class="hl sym">:</span>initform nil <span class="hl sym">:</span>initarg <span class="hl sym">:</span>original-initargs 566 <a id="l_478"></a><span class="hl line"> 478 </span> <span class="hl sym">:</span>accessor operation-original-initargs<span class="hl sym">)</span> 567 <a id="l_479"></a><span class="hl line"> 479 </span> <span class="hl sym">(</span>visited-nodes <span class="hl sym">:</span>initform nil <span class="hl sym">:</span>accessor operation-visited-nodes<span class="hl sym">)</span> 568 <a id="l_480"></a><span class="hl line"> 480 </span> <span class="hl sym">(</span>visiting-nodes <span class="hl sym">:</span>initform nil <span class="hl sym">:</span>accessor operation-visiting-nodes<span class="hl sym">)</span> 569 <a id="l_481"></a><span class="hl line"> 481 </span> <span class="hl sym">(</span>parent <span class="hl sym">:</span>initform nil <span class="hl sym">:</span>initarg <span class="hl sym">:</span>parent <span class="hl sym">:</span>accessor operation-parent<span class="hl sym">)))</span> 570 <a id="l_482"></a><span class="hl line"> 482 </span> 571 <a id="l_483"></a><span class="hl line"> 483 </span><span class="hl sym">(</span>defmethod <span class="hl kwa">print</span>-object <span class="hl sym">((</span>o operation<span class="hl sym">)</span> stream<span class="hl sym">)</span> 572 <a id="l_484"></a><span class="hl line"> 484 </span> <span class="hl sym">(</span><span class="hl kwa">print</span>-unreadable-object <span class="hl sym">(</span>o stream <span class="hl sym">:</span><span class="hl kwa">type</span> t <span class="hl sym">:</span>identity t<span class="hl sym">)</span> 573 <a id="l_485"></a><span class="hl line"> 485 </span> <span class="hl sym">(</span>ignore-errors 574 <a id="l_486"></a><span class="hl line"> 486 </span> <span class="hl sym">(</span><span class="hl kwa">prin1</span> <span class="hl sym">(</span>operation-original-initargs o<span class="hl sym">)</span> stream<span class="hl sym">))))</span> 575 <a id="l_487"></a><span class="hl line"> 487 </span> 576 <a id="l_488"></a><span class="hl line"> 488 </span><span class="hl sym">(</span>defmethod shared-initialize <span class="hl sym">:</span>after <span class="hl sym">((</span>operation operation<span class="hl sym">)</span> slot-names 577 <a id="l_489"></a><span class="hl line"> 489 </span> <span class="hl sym">&</span>key force 578 <a id="l_490"></a><span class="hl line"> 490 </span> <span class="hl sym">&</span>allow-other-keys<span class="hl sym">)</span> 579 <a id="l_491"></a><span class="hl line"> 491 </span> <span class="hl sym">(</span>declare <span class="hl sym">(</span>ignore slot-names force<span class="hl sym">))</span> 580 <a id="l_492"></a><span class="hl line"> 492 </span> <span class="hl slc">;; empty method to disable initarg validity checking</span> 581 <a id="l_493"></a><span class="hl line"> 493 </span> <span class="hl sym">)</span> 582 <a id="l_494"></a><span class="hl line"> 494 </span> 583 <a id="l_495"></a><span class="hl line"> 495 </span><span class="hl sym">(</span>defgeneric perform <span class="hl sym">(</span>operation component<span class="hl sym">))</span> 584 <a id="l_496"></a><span class="hl line"> 496 </span><span class="hl sym">(</span>defgeneric operation-done-p <span class="hl sym">(</span>operation component<span class="hl sym">))</span> 585 <a id="l_497"></a><span class="hl line"> 497 </span><span class="hl sym">(</span>defgeneric explain <span class="hl sym">(</span>operation component<span class="hl sym">))</span> 586 <a id="l_498"></a><span class="hl line"> 498 </span><span class="hl sym">(</span>defgeneric output-files <span class="hl sym">(</span>operation component<span class="hl sym">))</span> 587 <a id="l_499"></a><span class="hl line"> 499 </span><span class="hl sym">(</span>defgeneric input-files <span class="hl sym">(</span>operation component<span class="hl sym">))</span> 588 <a id="l_500"></a><span class="hl line"> 500 </span> 589 <a id="l_501"></a><span class="hl line"> 501 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> node-for <span class="hl sym">(</span>o c<span class="hl sym">)</span> 590 <a id="l_502"></a><span class="hl line"> 502 </span> <span class="hl sym">(</span><span class="hl kwa">cons</span> <span class="hl sym">(</span>class-name <span class="hl sym">(</span>class-of o<span class="hl sym">))</span> c<span class="hl sym">))</span> 591 <a id="l_503"></a><span class="hl line"> 503 </span> 592 <a id="l_504"></a><span class="hl line"> 504 </span><span class="hl sym">(</span>defgeneric operation-ancestor <span class="hl sym">(</span>operation<span class="hl sym">)</span> 593 <a id="l_505"></a><span class="hl line"> 505 </span> <span class="hl sym">(:</span>documentation 594 <a id="l_506"></a><span class="hl line"> 506 </span> <span class="hl str">"Recursively chase the operation's parent pointer until we get to</span> 595 <a id="l_507"></a><span class="hl line"> 507 </span><span class="hl str">the head of the tree"</span><span class="hl sym">))</span> 596 <a id="l_508"></a><span class="hl line"> 508 </span> 597 <a id="l_509"></a><span class="hl line"> 509 </span><span class="hl sym">(</span>defmethod operation-ancestor <span class="hl sym">((</span>operation operation<span class="hl sym">))</span> 598 <a id="l_510"></a><span class="hl line"> 510 </span> <span class="hl sym">(</span>aif <span class="hl sym">(</span>operation-parent operation<span class="hl sym">)</span> 599 <a id="l_511"></a><span class="hl line"> 511 </span> <span class="hl sym">(</span>operation-ancestor it<span class="hl sym">)</span> 600 <a id="l_512"></a><span class="hl line"> 512 </span> operation<span class="hl sym">))</span> 601 <a id="l_513"></a><span class="hl line"> 513 </span> 602 <a id="l_514"></a><span class="hl line"> 514 </span> 603 <a id="l_515"></a><span class="hl line"> 515 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> make-sub-operation <span class="hl sym">(</span>c o dep-c dep-o<span class="hl sym">)</span> 604 <a id="l_516"></a><span class="hl line"> 516 </span> <span class="hl sym">(</span>let<span class="hl sym">* ((</span>args <span class="hl sym">(</span>copy-<span class="hl kwa">list</span> <span class="hl sym">(</span>operation-original-initargs o<span class="hl sym">)))</span> 605 <a id="l_517"></a><span class="hl line"> 517 </span> <span class="hl sym">(</span>force-p <span class="hl sym">(</span>getf args <span class="hl sym">:</span>force<span class="hl sym">)))</span> 606 <a id="l_518"></a><span class="hl line"> 518 </span> <span class="hl slc">;; note explicit comparison with T: any other non-NIL force value</span> 607 <a id="l_519"></a><span class="hl line"> 519 </span> <span class="hl slc">;; (e.g. :recursive) will pass through</span> 608 <a id="l_520"></a><span class="hl line"> 520 </span> <span class="hl sym">(</span><span class="hl kwa">cond</span> <span class="hl sym">((</span><span class="hl kwa">and</span> <span class="hl sym">(</span><span class="hl kwa">null</span> <span class="hl sym">(</span>component-parent c<span class="hl sym">))</span> 609 <a id="l_521"></a><span class="hl line"> 521 </span> <span class="hl sym">(</span><span class="hl kwa">null</span> <span class="hl sym">(</span>component-parent dep-c<span class="hl sym">))</span> 610 <a id="l_522"></a><span class="hl line"> 522 </span> <span class="hl sym">(</span><span class="hl kwa">not</span> <span class="hl sym">(</span>eql c dep-c<span class="hl sym">)))</span> 611 <a id="l_523"></a><span class="hl line"> 523 </span> <span class="hl sym">(</span>when <span class="hl sym">(</span>eql force-p t<span class="hl sym">)</span> 612 <a id="l_524"></a><span class="hl line"> 524 </span> <span class="hl sym">(</span>setf <span class="hl sym">(</span>getf args <span class="hl sym">:</span>force<span class="hl sym">)</span> nil<span class="hl sym">))</span> 613 <a id="l_525"></a><span class="hl line"> 525 </span> <span class="hl sym">(</span><span class="hl kwa">apply</span> #<span class="hl sym">'</span>make-instance dep-o 614 <a id="l_526"></a><span class="hl line"> 526 </span> <span class="hl sym">:</span>parent o 615 <a id="l_527"></a><span class="hl line"> 527 </span> <span class="hl sym">:</span>original-initargs args args<span class="hl sym">))</span> 616 <a id="l_528"></a><span class="hl line"> 528 </span> <span class="hl sym">((</span>subtypep <span class="hl sym">(</span><span class="hl kwa">type</span>-of o<span class="hl sym">)</span> dep-o<span class="hl sym">)</span> 617 <a id="l_529"></a><span class="hl line"> 529 </span> o<span class="hl sym">)</span> 618 <a id="l_530"></a><span class="hl line"> 530 </span> <span class="hl sym">(</span>t 619 <a id="l_531"></a><span class="hl line"> 531 </span> <span class="hl sym">(</span><span class="hl kwa">apply</span> #<span class="hl sym">'</span>make-instance dep-o 620 <a id="l_532"></a><span class="hl line"> 532 </span> <span class="hl sym">:</span>parent o <span class="hl sym">:</span>original-initargs args args<span class="hl sym">)))))</span> 621 <a id="l_533"></a><span class="hl line"> 533 </span> 622 <a id="l_534"></a><span class="hl line"> 534 </span> 623 <a id="l_535"></a><span class="hl line"> 535 </span><span class="hl sym">(</span>defgeneric visit-component <span class="hl sym">(</span>operation component data<span class="hl sym">))</span> 624 <a id="l_536"></a><span class="hl line"> 536 </span> 625 <a id="l_537"></a><span class="hl line"> 537 </span><span class="hl sym">(</span>defmethod visit-component <span class="hl sym">((</span>o operation<span class="hl sym">) (</span>c component<span class="hl sym">)</span> data<span class="hl sym">)</span> 626 <a id="l_538"></a><span class="hl line"> 538 </span> <span class="hl sym">(</span>unless <span class="hl sym">(</span>component-visited-p o c<span class="hl sym">)</span> 627 <a id="l_539"></a><span class="hl line"> 539 </span> <span class="hl sym">(</span>push <span class="hl sym">(</span><span class="hl kwa">cons</span> <span class="hl sym">(</span>node-for o c<span class="hl sym">)</span> data<span class="hl sym">)</span> 628 <a id="l_540"></a><span class="hl line"> 540 </span> <span class="hl sym">(</span>operation-visited-nodes <span class="hl sym">(</span>operation-ancestor o<span class="hl sym">)))))</span> 629 <a id="l_541"></a><span class="hl line"> 541 </span> 630 <a id="l_542"></a><span class="hl line"> 542 </span><span class="hl sym">(</span>defgeneric component-visited-p <span class="hl sym">(</span>operation component<span class="hl sym">))</span> 631 <a id="l_543"></a><span class="hl line"> 543 </span> 632 <a id="l_544"></a><span class="hl line"> 544 </span><span class="hl sym">(</span>defmethod component-visited-p <span class="hl sym">((</span>o operation<span class="hl sym">) (</span>c component<span class="hl sym">))</span> 633 <a id="l_545"></a><span class="hl line"> 545 </span> <span class="hl sym">(</span><span class="hl kwa">assoc</span> <span class="hl sym">(</span>node-for o c<span class="hl sym">)</span> 634 <a id="l_546"></a><span class="hl line"> 546 </span> <span class="hl sym">(</span>operation-visited-nodes <span class="hl sym">(</span>operation-ancestor o<span class="hl sym">))</span> 635 <a id="l_547"></a><span class="hl line"> 547 </span> <span class="hl sym">:</span>test <span class="hl sym">'</span><span class="hl kwa">equal</span><span class="hl sym">))</span> 636 <a id="l_548"></a><span class="hl line"> 548 </span> 637 <a id="l_549"></a><span class="hl line"> 549 </span><span class="hl sym">(</span>defgeneric <span class="hl sym">(</span>setf visiting-component<span class="hl sym">) (</span>new-value operation component<span class="hl sym">))</span> 638 <a id="l_550"></a><span class="hl line"> 550 </span> 639 <a id="l_551"></a><span class="hl line"> 551 </span><span class="hl sym">(</span>defmethod <span class="hl sym">(</span>setf visiting-component<span class="hl sym">) (</span>new-value operation component<span class="hl sym">)</span> 640 <a id="l_552"></a><span class="hl line"> 552 </span> <span class="hl slc">;; MCL complains about unused lexical variables</span> 641 <a id="l_553"></a><span class="hl line"> 553 </span> <span class="hl sym">(</span>declare <span class="hl sym">(</span>ignorable new-value operation component<span class="hl sym">)))</span> 642 <a id="l_554"></a><span class="hl line"> 554 </span> 643 <a id="l_555"></a><span class="hl line"> 555 </span><span class="hl sym">(</span>defmethod <span class="hl sym">(</span>setf visiting-component<span class="hl sym">) (</span>new-value <span class="hl sym">(</span>o operation<span class="hl sym">) (</span>c component<span class="hl sym">))</span> 644 <a id="l_556"></a><span class="hl line"> 556 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>node <span class="hl sym">(</span>node-for o c<span class="hl sym">))</span> 645 <a id="l_557"></a><span class="hl line"> 557 </span> <span class="hl sym">(</span>a <span class="hl sym">(</span>operation-ancestor o<span class="hl sym">)))</span> 646 <a id="l_558"></a><span class="hl line"> 558 </span> <span class="hl sym">(</span><span class="hl kwa">if</span> new-value 647 <a id="l_559"></a><span class="hl line"> 559 </span> <span class="hl sym">(</span>pushnew node <span class="hl sym">(</span>operation-visiting-nodes a<span class="hl sym">) :</span>test <span class="hl sym">'</span><span class="hl kwa">equal</span><span class="hl sym">)</span> 648 <a id="l_560"></a><span class="hl line"> 560 </span> <span class="hl sym">(</span>setf <span class="hl sym">(</span>operation-visiting-nodes a<span class="hl sym">)</span> 649 <a id="l_561"></a><span class="hl line"> 561 </span> <span class="hl sym">(</span>remove node <span class="hl sym">(</span>operation-visiting-nodes a<span class="hl sym">) :</span>test <span class="hl sym">'</span><span class="hl kwa">equal</span><span class="hl sym">)))))</span> 650 <a id="l_562"></a><span class="hl line"> 562 </span> 651 <a id="l_563"></a><span class="hl line"> 563 </span><span class="hl sym">(</span>defgeneric component-visiting-p <span class="hl sym">(</span>operation component<span class="hl sym">))</span> 652 <a id="l_564"></a><span class="hl line"> 564 </span> 653 <a id="l_565"></a><span class="hl line"> 565 </span><span class="hl sym">(</span>defmethod component-visiting-p <span class="hl sym">((</span>o operation<span class="hl sym">) (</span>c component<span class="hl sym">))</span> 654 <a id="l_566"></a><span class="hl line"> 566 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>node <span class="hl sym">(</span><span class="hl kwa">cons</span> o c<span class="hl sym">)))</span> 655 <a id="l_567"></a><span class="hl line"> 567 </span> <span class="hl sym">(</span><span class="hl kwa">member</span> node <span class="hl sym">(</span>operation-visiting-nodes <span class="hl sym">(</span>operation-ancestor o<span class="hl sym">))</span> 656 <a id="l_568"></a><span class="hl line"> 568 </span> <span class="hl sym">:</span>test <span class="hl sym">'</span><span class="hl kwa">equal</span><span class="hl sym">)))</span> 657 <a id="l_569"></a><span class="hl line"> 569 </span> 658 <a id="l_570"></a><span class="hl line"> 570 </span><span class="hl sym">(</span>defgeneric component-depends-on <span class="hl sym">(</span>operation component<span class="hl sym">)</span> 659 <a id="l_571"></a><span class="hl line"> 571 </span> <span class="hl sym">(:</span>documentation 660 <a id="l_572"></a><span class="hl line"> 572 </span> <span class="hl str">"Returns a list of dependencies needed by the component to perform</span> 661 <a id="l_573"></a><span class="hl line"> 573 </span><span class="hl str"> the operation. A dependency has one of the following forms:</span> 662 <a id="l_574"></a><span class="hl line"> 574 </span><span class="hl str"></span> 663 <a id="l_575"></a><span class="hl line"> 575 </span><span class="hl str"> (<operation> <component>*), where <operation> is a class</span> 664 <a id="l_576"></a><span class="hl line"> 576 </span><span class="hl str"> designator and each <component> is a component</span> 665 <a id="l_577"></a><span class="hl line"> 577 </span><span class="hl str"> designator, which means that the component depends on</span> 666 <a id="l_578"></a><span class="hl line"> 578 </span><span class="hl str"> <operation> having been performed on each <component>; or</span> 667 <a id="l_579"></a><span class="hl line"> 579 </span><span class="hl str"></span> 668 <a id="l_580"></a><span class="hl line"> 580 </span><span class="hl str"> (FEATURE <feature>), which means that the component depends</span> 669 <a id="l_581"></a><span class="hl line"> 581 </span><span class="hl str"> on <feature>'s presence in *FEATURES*.</span> 670 <a id="l_582"></a><span class="hl line"> 582 </span><span class="hl str"></span> 671 <a id="l_583"></a><span class="hl line"> 583 </span><span class="hl str"> Methods specialized on subclasses of existing component types</span> 672 <a id="l_584"></a><span class="hl line"> 584 </span><span class="hl str"> should usually append the results of CALL-NEXT-METHOD to the</span> 673 <a id="l_585"></a><span class="hl line"> 585 </span><span class="hl str"> list."</span><span class="hl sym">))</span> 674 <a id="l_586"></a><span class="hl line"> 586 </span> 675 <a id="l_587"></a><span class="hl line"> 587 </span><span class="hl sym">(</span>defmethod component-depends-on <span class="hl sym">((</span>op-spec symbol<span class="hl sym">) (</span>c component<span class="hl sym">))</span> 676 <a id="l_588"></a><span class="hl line"> 588 </span> <span class="hl sym">(</span>component-depends-on <span class="hl sym">(</span>make-instance op-spec<span class="hl sym">)</span> c<span class="hl sym">))</span> 677 <a id="l_589"></a><span class="hl line"> 589 </span> 678 <a id="l_590"></a><span class="hl line"> 590 </span><span class="hl sym">(</span>defmethod component-depends-on <span class="hl sym">((</span>o operation<span class="hl sym">) (</span>c component<span class="hl sym">))</span> 679 <a id="l_591"></a><span class="hl line"> 591 </span> <span class="hl sym">(</span><span class="hl kwa">cdr</span> <span class="hl sym">(</span><span class="hl kwa">assoc</span> <span class="hl sym">(</span>class-name <span class="hl sym">(</span>class-of o<span class="hl sym">))</span> 680 <a id="l_592"></a><span class="hl line"> 592 </span> <span class="hl sym">(</span>slot-value c <span class="hl sym">'</span>in-order-to<span class="hl sym">))))</span> 681 <a id="l_593"></a><span class="hl line"> 593 </span> 682 <a id="l_594"></a><span class="hl line"> 594 </span><span class="hl sym">(</span>defgeneric component-self-dependencies <span class="hl sym">(</span>operation component<span class="hl sym">))</span> 683 <a id="l_595"></a><span class="hl line"> 595 </span> 684 <a id="l_596"></a><span class="hl line"> 596 </span><span class="hl sym">(</span>defmethod component-self-dependencies <span class="hl sym">((</span>o operation<span class="hl sym">) (</span>c component<span class="hl sym">))</span> 685 <a id="l_597"></a><span class="hl line"> 597 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>all-deps <span class="hl sym">(</span>component-depends-on o c<span class="hl sym">)))</span> 686 <a id="l_598"></a><span class="hl line"> 598 </span> <span class="hl sym">(</span>remove-<span class="hl kwa">if</span>-<span class="hl kwa">not</span> <span class="hl sym">(</span><span class="hl kwa">lambda</span> <span class="hl sym">(</span>x<span class="hl sym">)</span> 687 <a id="l_599"></a><span class="hl line"> 599 </span> <span class="hl sym">(</span><span class="hl kwa">member</span> <span class="hl sym">(</span>component-name c<span class="hl sym">) (</span><span class="hl kwa">cdr</span> x<span class="hl sym">) :</span>test #<span class="hl sym">'</span>string<span class="hl sym">=))</span> 688 <a id="l_600"></a><span class="hl line"> 600 </span> all-deps<span class="hl sym">)))</span> 689 <a id="l_601"></a><span class="hl line"> 601 </span> 690 <a id="l_602"></a><span class="hl line"> 602 </span><span class="hl sym">(</span>defmethod input-files <span class="hl sym">((</span>operation operation<span class="hl sym">) (</span>c component<span class="hl sym">))</span> 691 <a id="l_603"></a><span class="hl line"> 603 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>parent <span class="hl sym">(</span>component-parent c<span class="hl sym">))</span> 692 <a id="l_604"></a><span class="hl line"> 604 </span> <span class="hl sym">(</span>self-deps <span class="hl sym">(</span>component-self-dependencies operation c<span class="hl sym">)))</span> 693 <a id="l_605"></a><span class="hl line"> 605 </span> <span class="hl sym">(</span><span class="hl kwa">if</span> self-deps 694 <a id="l_606"></a><span class="hl line"> 606 </span> <span class="hl sym">(</span>mapcan <span class="hl sym">(</span><span class="hl kwa">lambda</span> <span class="hl sym">(</span>dep<span class="hl sym">)</span> 695 <a id="l_607"></a><span class="hl line"> 607 </span> <span class="hl sym">(</span>destructuring-bind <span class="hl sym">(</span>op name<span class="hl sym">)</span> dep 696 <a id="l_608"></a><span class="hl line"> 608 </span> <span class="hl sym">(</span>output-files <span class="hl sym">(</span>make-instance op<span class="hl sym">)</span> 697 <a id="l_609"></a><span class="hl line"> 609 </span> <span class="hl sym">(</span>find-component parent name<span class="hl sym">))))</span> 698 <a id="l_610"></a><span class="hl line"> 610 </span> self-deps<span class="hl sym">)</span> 699 <a id="l_611"></a><span class="hl line"> 611 </span> <span class="hl slc">;; no previous operations needed? I guess we work with the</span> 700 <a id="l_612"></a><span class="hl line"> 612 </span> <span class="hl slc">;; original source file, then</span> 701 <a id="l_613"></a><span class="hl line"> 613 </span> <span class="hl sym">(</span><span class="hl kwa">list</span> <span class="hl sym">(</span>component-pathname c<span class="hl sym">)))))</span> 702 <a id="l_614"></a><span class="hl line"> 614 </span> 703 <a id="l_615"></a><span class="hl line"> 615 </span><span class="hl sym">(</span>defmethod input-files <span class="hl sym">((</span>operation operation<span class="hl sym">) (</span>c module<span class="hl sym">))</span> nil<span class="hl sym">)</span> 704 <a id="l_616"></a><span class="hl line"> 616 </span> 705 <a id="l_617"></a><span class="hl line"> 617 </span><span class="hl sym">(</span>defmethod operation-done-p <span class="hl sym">((</span>o operation<span class="hl sym">) (</span>c component<span class="hl sym">))</span> 706 <a id="l_618"></a><span class="hl line"> 618 </span> <span class="hl sym">(</span>flet <span class="hl sym">((</span>fwd-<span class="hl kwa">or</span>-return-t <span class="hl sym">(</span>file<span class="hl sym">)</span> 707 <a id="l_619"></a><span class="hl line"> 619 </span> <span class="hl slc">;; if FILE-WRITE-DATE returns NIL, it's possible that the</span> 708 <a id="l_620"></a><span class="hl line"> 620 </span> <span class="hl slc">;; user or some other agent has deleted an input file. If</span> 709 <a id="l_621"></a><span class="hl line"> 621 </span> <span class="hl slc">;; that's the case, well, that's not good, but as long as</span> 710 <a id="l_622"></a><span class="hl line"> 622 </span> <span class="hl slc">;; the operation is otherwise considered to be done we</span> 711 <a id="l_623"></a><span class="hl line"> 623 </span> <span class="hl slc">;; could continue and survive.</span> 712 <a id="l_624"></a><span class="hl line"> 624 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>date <span class="hl sym">(</span>file-write-date file<span class="hl sym">)))</span> 713 <a id="l_625"></a><span class="hl line"> 625 </span> <span class="hl sym">(</span><span class="hl kwa">cond</span> 714 <a id="l_626"></a><span class="hl line"> 626 </span> <span class="hl sym">(</span>date<span class="hl sym">)</span> 715 <a id="l_627"></a><span class="hl line"> 627 </span> <span class="hl sym">(</span>t 716 <a id="l_628"></a><span class="hl line"> 628 </span> <span class="hl sym">(</span>warn <span class="hl str">"~@<Missing FILE-WRITE-DATE for ~S: treating ~</span> 717 <a id="l_629"></a><span class="hl line"> 629 </span><span class="hl str"> operation ~S on component ~S as done.~@:>"</span> 718 <a id="l_630"></a><span class="hl line"> 630 </span> file o c<span class="hl sym">)</span> 719 <a id="l_631"></a><span class="hl line"> 631 </span> <span class="hl sym">(</span>return-from operation-done-p t<span class="hl sym">))))))</span> 720 <a id="l_632"></a><span class="hl line"> 632 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>out-files <span class="hl sym">(</span>output-files o c<span class="hl sym">))</span> 721 <a id="l_633"></a><span class="hl line"> 633 </span> <span class="hl sym">(</span>in-files <span class="hl sym">(</span>input-files o c<span class="hl sym">)))</span> 722 <a id="l_634"></a><span class="hl line"> 634 </span> <span class="hl sym">(</span><span class="hl kwa">cond</span> <span class="hl sym">((</span><span class="hl kwa">and</span> <span class="hl sym">(</span><span class="hl kwa">not</span> in-files<span class="hl sym">) (</span><span class="hl kwa">not</span> out-files<span class="hl sym">))</span> 723 <a id="l_635"></a><span class="hl line"> 635 </span> <span class="hl slc">;; arbitrary decision: an operation that uses nothing to</span> 724 <a id="l_636"></a><span class="hl line"> 636 </span> <span class="hl slc">;; produce nothing probably isn't doing much</span> 725 <a id="l_637"></a><span class="hl line"> 637 </span> t<span class="hl sym">)</span> 726 <a id="l_638"></a><span class="hl line"> 638 </span> <span class="hl sym">((</span><span class="hl kwa">not</span> out-files<span class="hl sym">)</span> 727 <a id="l_639"></a><span class="hl line"> 639 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>op-done 728 <a id="l_640"></a><span class="hl line"> 640 </span> <span class="hl sym">(</span>gethash <span class="hl sym">(</span><span class="hl kwa">type</span>-of o<span class="hl sym">)</span> 729 <a id="l_641"></a><span class="hl line"> 641 </span> <span class="hl sym">(</span>component-operation-times c<span class="hl sym">))))</span> 730 <a id="l_642"></a><span class="hl line"> 642 </span> <span class="hl sym">(</span><span class="hl kwa">and</span> op-done 731 <a id="l_643"></a><span class="hl line"> 643 </span> <span class="hl sym">(>=</span> op-done 732 <a id="l_644"></a><span class="hl line"> 644 </span> <span class="hl sym">(</span><span class="hl kwa">apply</span> #<span class="hl sym">'</span><span class="hl kwa">max</span> 733 <a id="l_645"></a><span class="hl line"> 645 </span> <span class="hl sym">(</span><span class="hl kwa">mapcar</span> #<span class="hl sym">'</span>fwd-<span class="hl kwa">or</span>-return-t in-files<span class="hl sym">))))))</span> 734 <a id="l_646"></a><span class="hl line"> 646 </span> <span class="hl sym">((</span><span class="hl kwa">not</span> in-files<span class="hl sym">)</span> nil<span class="hl sym">)</span> 735 <a id="l_647"></a><span class="hl line"> 647 </span> <span class="hl sym">(</span>t 736 <a id="l_648"></a><span class="hl line"> 648 </span> <span class="hl sym">(</span><span class="hl kwa">and</span> 737 <a id="l_649"></a><span class="hl line"> 649 </span> <span class="hl sym">(</span>every #<span class="hl sym">'</span>probe-file out-files<span class="hl sym">)</span> 738 <a id="l_650"></a><span class="hl line"> 650 </span> <span class="hl sym">(> (</span><span class="hl kwa">apply</span> #<span class="hl sym">'</span><span class="hl kwa">min</span> <span class="hl sym">(</span><span class="hl kwa">mapcar</span> #<span class="hl sym">'</span>file-write-date out-files<span class="hl sym">))</span> 739 <a id="l_651"></a><span class="hl line"> 651 </span> <span class="hl sym">(</span><span class="hl kwa">apply</span> #<span class="hl sym">'</span><span class="hl kwa">max</span> <span class="hl sym">(</span><span class="hl kwa">mapcar</span> #<span class="hl sym">'</span>fwd-<span class="hl kwa">or</span>-return-t in-files<span class="hl sym">)))))))))</span> 740 <a id="l_652"></a><span class="hl line"> 652 </span> 741 <a id="l_653"></a><span class="hl line"> 653 </span><span class="hl slc">;;; So you look at this code and think "why isn't it a bunch of</span> 742 <a id="l_654"></a><span class="hl line"> 654 </span><span class="hl slc">;;; methods". And the answer is, because standard method combination</span> 743 <a id="l_655"></a><span class="hl line"> 655 </span><span class="hl slc">;;; runs :before methods most->least-specific, which is back to front</span> 744 <a id="l_656"></a><span class="hl line"> 656 </span><span class="hl slc">;;; for our purposes. And CLISP doesn't have non-standard method</span> 745 <a id="l_657"></a><span class="hl line"> 657 </span><span class="hl slc">;;; combinations, so let's keep it simple and aspire to portability</span> 746 <a id="l_658"></a><span class="hl line"> 658 </span> 747 <a id="l_659"></a><span class="hl line"> 659 </span><span class="hl sym">(</span>defgeneric traverse <span class="hl sym">(</span>operation component<span class="hl sym">))</span> 748 <a id="l_660"></a><span class="hl line"> 660 </span><span class="hl sym">(</span>defmethod traverse <span class="hl sym">((</span>operation operation<span class="hl sym">) (</span>c component<span class="hl sym">))</span> 749 <a id="l_661"></a><span class="hl line"> 661 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>forced nil<span class="hl sym">))</span> 750 <a id="l_662"></a><span class="hl line"> 662 </span> <span class="hl sym">(</span>labels <span class="hl sym">((</span>do-one-dep <span class="hl sym">(</span>required-op required-c required-v<span class="hl sym">)</span> 751 <a id="l_663"></a><span class="hl line"> 663 </span> <span class="hl sym">(</span>let<span class="hl sym">* ((</span>dep-c <span class="hl sym">(</span><span class="hl kwa">or</span> <span class="hl sym">(</span>find-component 752 <a id="l_664"></a><span class="hl line"> 664 </span> <span class="hl sym">(</span>component-parent c<span class="hl sym">)</span> 753 <a id="l_665"></a><span class="hl line"> 665 </span> <span class="hl slc">;; XXX tacky. really we should build the</span> 754 <a id="l_666"></a><span class="hl line"> 666 </span> <span class="hl slc">;; in-order-to slot with canonicalized</span> 755 <a id="l_667"></a><span class="hl line"> 667 </span> <span class="hl slc">;; names instead of coercing this late</span> 756 <a id="l_668"></a><span class="hl line"> 668 </span> <span class="hl sym">(</span>coerce-name required-c<span class="hl sym">)</span> required-v<span class="hl sym">)</span> 757 <a id="l_669"></a><span class="hl line"> 669 </span> <span class="hl sym">(</span>error <span class="hl sym">'</span>missing-dependency 758 <a id="l_670"></a><span class="hl line"> 670 </span> <span class="hl sym">:</span>required-by c 759 <a id="l_671"></a><span class="hl line"> 671 </span> <span class="hl sym">:</span>version required-v 760 <a id="l_672"></a><span class="hl line"> 672 </span> <span class="hl sym">:</span>requires required-c<span class="hl sym">)))</span> 761 <a id="l_673"></a><span class="hl line"> 673 </span> <span class="hl sym">(</span>op <span class="hl sym">(</span>make-sub-operation c operation dep-c required-op<span class="hl sym">)))</span> 762 <a id="l_674"></a><span class="hl line"> 674 </span> <span class="hl sym">(</span>traverse op dep-c<span class="hl sym">)))</span> 763 <a id="l_675"></a><span class="hl line"> 675 </span> <span class="hl sym">(</span>do-dep <span class="hl sym">(</span>op dep<span class="hl sym">)</span> 764 <a id="l_676"></a><span class="hl line"> 676 </span> <span class="hl sym">(</span><span class="hl kwa">cond</span> <span class="hl sym">((</span><span class="hl kwa">eq</span> op <span class="hl sym">'</span>feature<span class="hl sym">)</span> 765 <a id="l_677"></a><span class="hl line"> 677 </span> <span class="hl sym">(</span><span class="hl kwa">or</span> <span class="hl sym">(</span><span class="hl kwa">member</span> <span class="hl sym">(</span><span class="hl kwa">car</span> dep<span class="hl sym">) *</span>features<span class="hl sym">*)</span> 766 <a id="l_678"></a><span class="hl line"> 678 </span> <span class="hl sym">(</span>error <span class="hl sym">'</span>missing-dependency 767 <a id="l_679"></a><span class="hl line"> 679 </span> <span class="hl sym">:</span>required-by c 768 <a id="l_680"></a><span class="hl line"> 680 </span> <span class="hl sym">:</span>requires <span class="hl sym">(</span><span class="hl kwa">car</span> dep<span class="hl sym">)</span> 769 <a id="l_681"></a><span class="hl line"> 681 </span> <span class="hl sym">:</span>version nil<span class="hl sym">)))</span> 770 <a id="l_682"></a><span class="hl line"> 682 </span> <span class="hl sym">(</span>t 771 <a id="l_683"></a><span class="hl line"> 683 </span> <span class="hl sym">(</span>dolist <span class="hl sym">(</span>d dep<span class="hl sym">)</span> 772 <a id="l_684"></a><span class="hl line"> 684 </span> <span class="hl sym">(</span><span class="hl kwa">cond</span> <span class="hl sym">((</span>consp d<span class="hl sym">)</span> 773 <a id="l_685"></a><span class="hl line"> 685 </span> <span class="hl sym">(</span>assert <span class="hl sym">(</span>string-<span class="hl kwa">equal</span> 774 <a id="l_686"></a><span class="hl line"> 686 </span> <span class="hl sym">(</span>symbol-name <span class="hl sym">(</span>first d<span class="hl sym">))</span> 775 <a id="l_687"></a><span class="hl line"> 687 </span> <span class="hl str">"VERSION"</span><span class="hl sym">))</span> 776 <a id="l_688"></a><span class="hl line"> 688 </span> <span class="hl sym">(</span>appendf forced 777 <a id="l_689"></a><span class="hl line"> 689 </span> <span class="hl sym">(</span>do-one-dep op <span class="hl sym">(</span>second d<span class="hl sym">) (</span>third d<span class="hl sym">))))</span> 778 <a id="l_690"></a><span class="hl line"> 690 </span> <span class="hl sym">(</span>t 779 <a id="l_691"></a><span class="hl line"> 691 </span> <span class="hl sym">(</span>appendf forced <span class="hl sym">(</span>do-one-dep op d nil<span class="hl sym">)))))))))</span> 780 <a id="l_692"></a><span class="hl line"> 692 </span> <span class="hl sym">(</span>aif <span class="hl sym">(</span>component-visited-p operation c<span class="hl sym">)</span> 781 <a id="l_693"></a><span class="hl line"> 693 </span> <span class="hl sym">(</span>return-from traverse 782 <a id="l_694"></a><span class="hl line"> 694 </span> <span class="hl sym">(</span><span class="hl kwa">if</span> <span class="hl sym">(</span><span class="hl kwa">cdr</span> it<span class="hl sym">) (</span><span class="hl kwa">list</span> <span class="hl sym">(</span><span class="hl kwa">cons</span> <span class="hl sym">'</span>pruned-op c<span class="hl sym">))</span> nil<span class="hl sym">)))</span> 783 <a id="l_695"></a><span class="hl line"> 695 </span> <span class="hl slc">;; dependencies</span> 784 <a id="l_696"></a><span class="hl line"> 696 </span> <span class="hl sym">(</span><span class="hl kwa">if</span> <span class="hl sym">(</span>component-visiting-p operation c<span class="hl sym">)</span> 785 <a id="l_697"></a><span class="hl line"> 697 </span> <span class="hl sym">(</span>error <span class="hl sym">'</span>circular-dependency <span class="hl sym">:</span>components <span class="hl sym">(</span><span class="hl kwa">list</span> c<span class="hl sym">)))</span> 786 <a id="l_698"></a><span class="hl line"> 698 </span> <span class="hl sym">(</span>setf <span class="hl sym">(</span>visiting-component operation c<span class="hl sym">)</span> t<span class="hl sym">)</span> 787 <a id="l_699"></a><span class="hl line"> 699 </span> <span class="hl sym">(</span>loop for <span class="hl sym">(</span>required-op . deps<span class="hl sym">)</span> in <span class="hl sym">(</span>component-depends-on operation c<span class="hl sym">)</span> 788 <a id="l_700"></a><span class="hl line"> 700 </span> do <span class="hl sym">(</span>do-dep required-op deps<span class="hl sym">))</span> 789 <a id="l_701"></a><span class="hl line"> 701 </span> <span class="hl slc">;; constituent bits</span> 790 <a id="l_702"></a><span class="hl line"> 702 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>module-ops 791 <a id="l_703"></a><span class="hl line"> 703 </span> <span class="hl sym">(</span>when <span class="hl sym">(</span>typep c <span class="hl sym">'</span>module<span class="hl sym">)</span> 792 <a id="l_704"></a><span class="hl line"> 704 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>at-least-one nil<span class="hl sym">)</span> 793 <a id="l_705"></a><span class="hl line"> 705 </span> <span class="hl sym">(</span>forced nil<span class="hl sym">)</span> 794 <a id="l_706"></a><span class="hl line"> 706 </span> <span class="hl sym">(</span>error nil<span class="hl sym">))</span> 795 <a id="l_707"></a><span class="hl line"> 707 </span> <span class="hl sym">(</span>loop for kid in <span class="hl sym">(</span>module-components c<span class="hl sym">)</span> 796 <a id="l_708"></a><span class="hl line"> 708 </span> do <span class="hl sym">(</span>handler-case 797 <a id="l_709"></a><span class="hl line"> 709 </span> <span class="hl sym">(</span>appendf forced <span class="hl sym">(</span>traverse operation kid <span class="hl sym">))</span> 798 <a id="l_710"></a><span class="hl line"> 710 </span> <span class="hl sym">(</span>missing-dependency <span class="hl sym">(</span>condition<span class="hl sym">)</span> 799 <a id="l_711"></a><span class="hl line"> 711 </span> <span class="hl sym">(</span><span class="hl kwa">if</span> <span class="hl sym">(</span><span class="hl kwa">eq</span> <span class="hl sym">(</span>module-<span class="hl kwa">if</span>-component-dep-fails c<span class="hl sym">) :</span>fail<span class="hl sym">)</span> 800 <a id="l_712"></a><span class="hl line"> 712 </span> <span class="hl sym">(</span>error condition<span class="hl sym">))</span> 801 <a id="l_713"></a><span class="hl line"> 713 </span> <span class="hl sym">(</span>setf error condition<span class="hl sym">))</span> 802 <a id="l_714"></a><span class="hl line"> 714 </span> <span class="hl sym">(:</span>no-error <span class="hl sym">(</span>c<span class="hl sym">)</span> 803 <a id="l_715"></a><span class="hl line"> 715 </span> <span class="hl sym">(</span>declare <span class="hl sym">(</span>ignore c<span class="hl sym">))</span> 804 <a id="l_716"></a><span class="hl line"> 716 </span> <span class="hl sym">(</span>setf at-least-one t<span class="hl sym">))))</span> 805 <a id="l_717"></a><span class="hl line"> 717 </span> <span class="hl sym">(</span>when <span class="hl sym">(</span><span class="hl kwa">and</span> <span class="hl sym">(</span><span class="hl kwa">eq</span> <span class="hl sym">(</span>module-<span class="hl kwa">if</span>-component-dep-fails c<span class="hl sym">) :</span>try-next<span class="hl sym">)</span> 806 <a id="l_718"></a><span class="hl line"> 718 </span> <span class="hl sym">(</span><span class="hl kwa">not</span> at-least-one<span class="hl sym">))</span> 807 <a id="l_719"></a><span class="hl line"> 719 </span> <span class="hl sym">(</span>error error<span class="hl sym">))</span> 808 <a id="l_720"></a><span class="hl line"> 720 </span> forced<span class="hl sym">))))</span> 809 <a id="l_721"></a><span class="hl line"> 721 </span> <span class="hl slc">;; now the thing itself</span> 810 <a id="l_722"></a><span class="hl line"> 722 </span> <span class="hl sym">(</span>when <span class="hl sym">(</span><span class="hl kwa">or</span> forced module-ops 811 <a id="l_723"></a><span class="hl line"> 723 </span> <span class="hl sym">(</span><span class="hl kwa">not</span> <span class="hl sym">(</span>operation-done-p operation c<span class="hl sym">))</span> 812 <a id="l_724"></a><span class="hl line"> 724 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>f <span class="hl sym">(</span>operation-forced <span class="hl sym">(</span>operation-ancestor operation<span class="hl sym">))))</span> 813 <a id="l_725"></a><span class="hl line"> 725 </span> <span class="hl sym">(</span><span class="hl kwa">and</span> f <span class="hl sym">(</span><span class="hl kwa">or</span> <span class="hl sym">(</span><span class="hl kwa">not</span> <span class="hl sym">(</span>consp f<span class="hl sym">))</span> 814 <a id="l_726"></a><span class="hl line"> 726 </span> <span class="hl sym">(</span><span class="hl kwa">member</span> <span class="hl sym">(</span>component-name 815 <a id="l_727"></a><span class="hl line"> 727 </span> <span class="hl sym">(</span>operation-ancestor operation<span class="hl sym">))</span> 816 <a id="l_728"></a><span class="hl line"> 728 </span> <span class="hl sym">(</span><span class="hl kwa">mapcar</span> #<span class="hl sym">'</span>coerce-name f<span class="hl sym">)</span> 817 <a id="l_729"></a><span class="hl line"> 729 </span> <span class="hl sym">:</span>test #<span class="hl sym">'</span>string<span class="hl sym">=)))))</span> 818 <a id="l_730"></a><span class="hl line"> 730 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>do-first <span class="hl sym">(</span><span class="hl kwa">cdr</span> <span class="hl sym">(</span><span class="hl kwa">assoc</span> <span class="hl sym">(</span>class-name <span class="hl sym">(</span>class-of operation<span class="hl sym">))</span> 819 <a id="l_731"></a><span class="hl line"> 731 </span> <span class="hl sym">(</span>slot-value c <span class="hl sym">'</span>do-first<span class="hl sym">)))))</span> 820 <a id="l_732"></a><span class="hl line"> 732 </span> <span class="hl sym">(</span>loop for <span class="hl sym">(</span>required-op . deps<span class="hl sym">)</span> in do-first 821 <a id="l_733"></a><span class="hl line"> 733 </span> do <span class="hl sym">(</span>do-dep required-op deps<span class="hl sym">)))</span> 822 <a id="l_734"></a><span class="hl line"> 734 </span> <span class="hl sym">(</span>setf forced <span class="hl sym">(</span><span class="hl kwa">append</span> <span class="hl sym">(</span>delete <span class="hl sym">'</span>pruned-op forced <span class="hl sym">:</span>key #<span class="hl sym">'</span><span class="hl kwa">car</span><span class="hl sym">)</span> 823 <a id="l_735"></a><span class="hl line"> 735 </span> <span class="hl sym">(</span>delete <span class="hl sym">'</span>pruned-op module-ops <span class="hl sym">:</span>key #<span class="hl sym">'</span><span class="hl kwa">car</span><span class="hl sym">)</span> 824 <a id="l_736"></a><span class="hl line"> 736 </span> <span class="hl sym">(</span><span class="hl kwa">list</span> <span class="hl sym">(</span><span class="hl kwa">cons</span> operation c<span class="hl sym">))))))</span> 825 <a id="l_737"></a><span class="hl line"> 737 </span> <span class="hl sym">(</span>setf <span class="hl sym">(</span>visiting-component operation c<span class="hl sym">)</span> nil<span class="hl sym">)</span> 826 <a id="l_738"></a><span class="hl line"> 738 </span> <span class="hl sym">(</span>visit-component operation c <span class="hl sym">(</span><span class="hl kwa">and</span> forced t<span class="hl sym">))</span> 827 <a id="l_739"></a><span class="hl line"> 739 </span> forced<span class="hl sym">)))</span> 828 <a id="l_740"></a><span class="hl line"> 740 </span> 829 <a id="l_741"></a><span class="hl line"> 741 </span> 830 <a id="l_742"></a><span class="hl line"> 742 </span><span class="hl sym">(</span>defmethod perform <span class="hl sym">((</span>operation operation<span class="hl sym">) (</span>c source-file<span class="hl sym">))</span> 831 <a id="l_743"></a><span class="hl line"> 743 </span> <span class="hl sym">(</span>sysdef-error 832 <a id="l_744"></a><span class="hl line"> 744 </span> <span class="hl str">"~@<required method PERFORM not implemented ~</span> 833 <a id="l_745"></a><span class="hl line"> 745 </span><span class="hl str"> for operation ~A, component ~A~@:>"</span> 834 <a id="l_746"></a><span class="hl line"> 746 </span> <span class="hl sym">(</span>class-of operation<span class="hl sym">) (</span>class-of c<span class="hl sym">)))</span> 835 <a id="l_747"></a><span class="hl line"> 747 </span> 836 <a id="l_748"></a><span class="hl line"> 748 </span><span class="hl sym">(</span>defmethod perform <span class="hl sym">((</span>operation operation<span class="hl sym">) (</span>c module<span class="hl sym">))</span> 837 <a id="l_749"></a><span class="hl line"> 749 </span> nil<span class="hl sym">)</span> 838 <a id="l_750"></a><span class="hl line"> 750 </span> 839 <a id="l_751"></a><span class="hl line"> 751 </span><span class="hl sym">(</span>defmethod explain <span class="hl sym">((</span>operation operation<span class="hl sym">) (</span>component component<span class="hl sym">))</span> 840 <a id="l_752"></a><span class="hl line"> 752 </span> <span class="hl sym">(</span>format <span class="hl sym">*</span>verbose-out<span class="hl sym">*</span> <span class="hl str">"~&;;; ~A on ~A~%"</span> operation component<span class="hl sym">))</span> 841 <a id="l_753"></a><span class="hl line"> 753 </span> 842 <a id="l_754"></a><span class="hl line"> 754 </span><span class="hl slc">;;; compile-op</span> 843 <a id="l_755"></a><span class="hl line"> 755 </span> 844 <a id="l_756"></a><span class="hl line"> 756 </span><span class="hl sym">(</span>defclass compile-op <span class="hl sym">(</span>operation<span class="hl sym">)</span> 845 <a id="l_757"></a><span class="hl line"> 757 </span> <span class="hl sym">((</span>proclamations <span class="hl sym">:</span>initarg <span class="hl sym">:</span>proclamations <span class="hl sym">:</span>accessor compile-op-proclamations <span class="hl sym">:</span>initform nil<span class="hl sym">)</span> 846 <a id="l_758"></a><span class="hl line"> 758 </span> <span class="hl sym">(</span>on-warnings <span class="hl sym">:</span>initarg <span class="hl sym">:</span>on-warnings <span class="hl sym">:</span>accessor operation-on-warnings 847 <a id="l_759"></a><span class="hl line"> 759 </span> <span class="hl sym">:</span>initform <span class="hl sym">*</span>compile-file-warnings-behaviour<span class="hl sym">*)</span> 848 <a id="l_760"></a><span class="hl line"> 760 </span> <span class="hl sym">(</span>on-failure <span class="hl sym">:</span>initarg <span class="hl sym">:</span>on-failure <span class="hl sym">:</span>accessor operation-on-failure 849 <a id="l_761"></a><span class="hl line"> 761 </span> <span class="hl sym">:</span>initform <span class="hl sym">*</span>compile-file-failure-behaviour<span class="hl sym">*)))</span> 850 <a id="l_762"></a><span class="hl line"> 762 </span> 851 <a id="l_763"></a><span class="hl line"> 763 </span><span class="hl sym">(</span>defmethod perform <span class="hl sym">:</span>before <span class="hl sym">((</span>operation compile-op<span class="hl sym">) (</span>c source-file<span class="hl sym">))</span> 852 <a id="l_764"></a><span class="hl line"> 764 </span> <span class="hl sym">(</span>map nil #<span class="hl sym">'</span>ensure-directories-exist <span class="hl sym">(</span>output-files operation c<span class="hl sym">)))</span> 853 <a id="l_765"></a><span class="hl line"> 765 </span> 854 <a id="l_766"></a><span class="hl line"> 766 </span><span class="hl sym">(</span>defmethod perform <span class="hl sym">:</span>after <span class="hl sym">((</span>operation operation<span class="hl sym">) (</span>c component<span class="hl sym">))</span> 855 <a id="l_767"></a><span class="hl line"> 767 </span> <span class="hl sym">(</span>setf <span class="hl sym">(</span>gethash <span class="hl sym">(</span><span class="hl kwa">type</span>-of operation<span class="hl sym">) (</span>component-operation-times c<span class="hl sym">))</span> 856 <a id="l_768"></a><span class="hl line"> 768 </span> <span class="hl sym">(</span>get-universal-time<span class="hl sym">))</span> 857 <a id="l_769"></a><span class="hl line"> 769 </span> <span class="hl sym">(</span><span class="hl kwa">load</span>-preferences c operation<span class="hl sym">))</span> 858 <a id="l_770"></a><span class="hl line"> 770 </span> 859 <a id="l_771"></a><span class="hl line"> 771 </span><span class="hl slc">;;; perform is required to check output-files to find out where to put</span> 860 <a id="l_772"></a><span class="hl line"> 772 </span><span class="hl slc">;;; its answers, in case it has been overridden for site policy</span> 861 <a id="l_773"></a><span class="hl line"> 773 </span><span class="hl sym">(</span>defmethod perform <span class="hl sym">((</span>operation compile-op<span class="hl sym">) (</span>c cl-source-file<span class="hl sym">))</span> 862 <a id="l_774"></a><span class="hl line"> 774 </span> #-<span class="hl sym">:</span>broken-fasl-loader 863 <a id="l_775"></a><span class="hl line"> 775 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>source-file <span class="hl sym">(</span>component-pathname c<span class="hl sym">))</span> 864 <a id="l_776"></a><span class="hl line"> 776 </span> <span class="hl sym">(</span>output-file <span class="hl sym">(</span><span class="hl kwa">car</span> <span class="hl sym">(</span>output-files operation c<span class="hl sym">))))</span> 865 <a id="l_777"></a><span class="hl line"> 777 </span> <span class="hl sym">(</span>multiple-value-bind <span class="hl sym">(</span>output warnings-p failure-p<span class="hl sym">)</span> 866 <a id="l_778"></a><span class="hl line"> 778 </span> <span class="hl sym">(</span>compile-file source-file <span class="hl sym">:</span>output-file output-file<span class="hl sym">)</span> 867 <a id="l_779"></a><span class="hl line"> 779 </span> <span class="hl sym">(</span>when warnings-p 868 <a id="l_780"></a><span class="hl line"> 780 </span> <span class="hl sym">(</span>case <span class="hl sym">(</span>operation-on-warnings operation<span class="hl sym">)</span> 869 <a id="l_781"></a><span class="hl line"> 781 </span> <span class="hl sym">(:</span>warn <span class="hl sym">(</span>warn 870 <a id="l_782"></a><span class="hl line"> 782 </span> <span class="hl str">"~@<COMPILE-FILE warned while performing ~A on ~A.~@:>"</span> 871 <a id="l_783"></a><span class="hl line"> 783 </span> operation c<span class="hl sym">))</span> 872 <a id="l_784"></a><span class="hl line"> 784 </span> <span class="hl sym">(:</span>error <span class="hl sym">(</span>error <span class="hl sym">'</span>compile-warned <span class="hl sym">:</span>component c <span class="hl sym">:</span>operation operation<span class="hl sym">))</span> 873 <a id="l_785"></a><span class="hl line"> 785 </span> <span class="hl sym">(:</span>ignore nil<span class="hl sym">)))</span> 874 <a id="l_786"></a><span class="hl line"> 786 </span> <span class="hl sym">(</span>when failure-p 875 <a id="l_787"></a><span class="hl line"> 787 </span> <span class="hl sym">(</span>case <span class="hl sym">(</span>operation-on-failure operation<span class="hl sym">)</span> 876 <a id="l_788"></a><span class="hl line"> 788 </span> <span class="hl sym">(:</span>warn <span class="hl sym">(</span>warn 877 <a id="l_789"></a><span class="hl line"> 789 </span> <span class="hl str">"~@<COMPILE-FILE failed while performing ~A on ~A.~@:>"</span> 878 <a id="l_790"></a><span class="hl line"> 790 </span> operation c<span class="hl sym">))</span> 879 <a id="l_791"></a><span class="hl line"> 791 </span> <span class="hl sym">(:</span>error <span class="hl sym">(</span>error <span class="hl sym">'</span>compile-failed <span class="hl sym">:</span>component c <span class="hl sym">:</span>operation operation<span class="hl sym">))</span> 880 <a id="l_792"></a><span class="hl line"> 792 </span> <span class="hl sym">(:</span>ignore nil<span class="hl sym">)))</span> 881 <a id="l_793"></a><span class="hl line"> 793 </span> <span class="hl sym">(</span>unless output 882 <a id="l_794"></a><span class="hl line"> 794 </span> <span class="hl sym">(</span>error <span class="hl sym">'</span>compile-error <span class="hl sym">:</span>component c <span class="hl sym">:</span>operation operation<span class="hl sym">)))))</span> 883 <a id="l_795"></a><span class="hl line"> 795 </span> 884 <a id="l_796"></a><span class="hl line"> 796 </span><span class="hl sym">(</span>defmethod output-files <span class="hl sym">((</span>operation compile-op<span class="hl sym">) (</span>c cl-source-file<span class="hl sym">))</span> 885 <a id="l_797"></a><span class="hl line"> 797 </span> #-<span class="hl sym">:</span>broken-fasl-loader <span class="hl sym">(</span><span class="hl kwa">list</span> <span class="hl sym">(</span>compile-file-pathname <span class="hl sym">(</span>component-pathname c<span class="hl sym">)))</span> 886 <a id="l_798"></a><span class="hl line"> 798 </span> #<span class="hl sym">+:</span>broken-fasl-loader <span class="hl sym">(</span><span class="hl kwa">list</span> <span class="hl sym">(</span>component-pathname c<span class="hl sym">)))</span> 887 <a id="l_799"></a><span class="hl line"> 799 </span> 888 <a id="l_800"></a><span class="hl line"> 800 </span><span class="hl sym">(</span>defmethod perform <span class="hl sym">((</span>operation compile-op<span class="hl sym">) (</span>c static-file<span class="hl sym">))</span> 889 <a id="l_801"></a><span class="hl line"> 801 </span> nil<span class="hl sym">)</span> 890 <a id="l_802"></a><span class="hl line"> 802 </span> 891 <a id="l_803"></a><span class="hl line"> 803 </span><span class="hl sym">(</span>defmethod output-files <span class="hl sym">((</span>operation compile-op<span class="hl sym">) (</span>c static-file<span class="hl sym">))</span> 892 <a id="l_804"></a><span class="hl line"> 804 </span> nil<span class="hl sym">)</span> 893 <a id="l_805"></a><span class="hl line"> 805 </span> 894 <a id="l_806"></a><span class="hl line"> 806 </span><span class="hl sym">(</span>defmethod input-files <span class="hl sym">((</span>op compile-op<span class="hl sym">) (</span>c static-file<span class="hl sym">))</span> 895 <a id="l_807"></a><span class="hl line"> 807 </span> nil<span class="hl sym">)</span> 896 <a id="l_808"></a><span class="hl line"> 808 </span> 897 <a id="l_809"></a><span class="hl line"> 809 </span> 898 <a id="l_810"></a><span class="hl line"> 810 </span><span class="hl slc">;;; load-op</span> 899 <a id="l_811"></a><span class="hl line"> 811 </span> 900 <a id="l_812"></a><span class="hl line"> 812 </span><span class="hl sym">(</span>defclass basic-<span class="hl kwa">load</span>-op <span class="hl sym">(</span>operation<span class="hl sym">) ())</span> 901 <a id="l_813"></a><span class="hl line"> 813 </span> 902 <a id="l_814"></a><span class="hl line"> 814 </span><span class="hl sym">(</span>defclass <span class="hl kwa">load</span>-op <span class="hl sym">(</span>basic-<span class="hl kwa">load</span>-op<span class="hl sym">) ())</span> 903 <a id="l_815"></a><span class="hl line"> 815 </span> 904 <a id="l_816"></a><span class="hl line"> 816 </span><span class="hl sym">(</span>defmethod perform <span class="hl sym">((</span>o <span class="hl kwa">load</span>-op<span class="hl sym">) (</span>c cl-source-file<span class="hl sym">))</span> 905 <a id="l_817"></a><span class="hl line"> 817 </span> <span class="hl sym">(</span><span class="hl kwa">mapcar</span> #<span class="hl sym">'</span><span class="hl kwa">load</span> <span class="hl sym">(</span>input-files o c<span class="hl sym">)))</span> 906 <a id="l_818"></a><span class="hl line"> 818 </span> 907 <a id="l_819"></a><span class="hl line"> 819 </span><span class="hl sym">(</span>defmethod perform <span class="hl sym">((</span>operation <span class="hl kwa">load</span>-op<span class="hl sym">) (</span>c static-file<span class="hl sym">))</span> 908 <a id="l_820"></a><span class="hl line"> 820 </span> nil<span class="hl sym">)</span> 909 <a id="l_821"></a><span class="hl line"> 821 </span><span class="hl sym">(</span>defmethod operation-done-p <span class="hl sym">((</span>operation <span class="hl kwa">load</span>-op<span class="hl sym">) (</span>c static-file<span class="hl sym">))</span> 910 <a id="l_822"></a><span class="hl line"> 822 </span> t<span class="hl sym">)</span> 911 <a id="l_823"></a><span class="hl line"> 823 </span> 912 <a id="l_824"></a><span class="hl line"> 824 </span><span class="hl sym">(</span>defmethod output-files <span class="hl sym">((</span>o operation<span class="hl sym">) (</span>c component<span class="hl sym">))</span> 913 <a id="l_825"></a><span class="hl line"> 825 </span> nil<span class="hl sym">)</span> 914 <a id="l_826"></a><span class="hl line"> 826 </span> 915 <a id="l_827"></a><span class="hl line"> 827 </span><span class="hl sym">(</span>defmethod component-depends-on <span class="hl sym">((</span>operation <span class="hl kwa">load</span>-op<span class="hl sym">) (</span>c component<span class="hl sym">))</span> 916 <a id="l_828"></a><span class="hl line"> 828 </span> <span class="hl sym">(</span><span class="hl kwa">cons</span> <span class="hl sym">(</span><span class="hl kwa">list</span> <span class="hl sym">'</span>compile-op <span class="hl sym">(</span>component-name c<span class="hl sym">))</span> 917 <a id="l_829"></a><span class="hl line"> 829 </span> <span class="hl sym">(</span>call-next-method<span class="hl sym">)))</span> 918 <a id="l_830"></a><span class="hl line"> 830 </span> 919 <a id="l_831"></a><span class="hl line"> 831 </span><span class="hl slc">;;; load-source-op</span> 920 <a id="l_832"></a><span class="hl line"> 832 </span> 921 <a id="l_833"></a><span class="hl line"> 833 </span><span class="hl sym">(</span>defclass <span class="hl kwa">load</span>-source-op <span class="hl sym">(</span>basic-<span class="hl kwa">load</span>-op<span class="hl sym">) ())</span> 922 <a id="l_834"></a><span class="hl line"> 834 </span> 923 <a id="l_835"></a><span class="hl line"> 835 </span><span class="hl sym">(</span>defmethod perform <span class="hl sym">((</span>o <span class="hl kwa">load</span>-source-op<span class="hl sym">) (</span>c cl-source-file<span class="hl sym">))</span> 924 <a id="l_836"></a><span class="hl line"> 836 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>source <span class="hl sym">(</span>component-pathname c<span class="hl sym">)))</span> 925 <a id="l_837"></a><span class="hl line"> 837 </span> <span class="hl sym">(</span>setf <span class="hl sym">(</span>component-property c <span class="hl sym">'</span><span class="hl kwa">last</span>-loaded-as-source<span class="hl sym">)</span> 926 <a id="l_838"></a><span class="hl line"> 838 </span> <span class="hl sym">(</span><span class="hl kwa">and</span> <span class="hl sym">(</span><span class="hl kwa">load</span> source<span class="hl sym">)</span> 927 <a id="l_839"></a><span class="hl line"> 839 </span> <span class="hl sym">(</span>get-universal-time<span class="hl sym">)))))</span> 928 <a id="l_840"></a><span class="hl line"> 840 </span> 929 <a id="l_841"></a><span class="hl line"> 841 </span><span class="hl sym">(</span>defmethod perform <span class="hl sym">((</span>operation <span class="hl kwa">load</span>-source-op<span class="hl sym">) (</span>c static-file<span class="hl sym">))</span> 930 <a id="l_842"></a><span class="hl line"> 842 </span> nil<span class="hl sym">)</span> 931 <a id="l_843"></a><span class="hl line"> 843 </span> 932 <a id="l_844"></a><span class="hl line"> 844 </span><span class="hl sym">(</span>defmethod output-files <span class="hl sym">((</span>operation <span class="hl kwa">load</span>-source-op<span class="hl sym">) (</span>c component<span class="hl sym">))</span> 933 <a id="l_845"></a><span class="hl line"> 845 </span> nil<span class="hl sym">)</span> 934 <a id="l_846"></a><span class="hl line"> 846 </span> 935 <a id="l_847"></a><span class="hl line"> 847 </span><span class="hl slc">;;; FIXME: we simply copy load-op's dependencies. this is Just Not Right.</span> 936 <a id="l_848"></a><span class="hl line"> 848 </span><span class="hl sym">(</span>defmethod component-depends-on <span class="hl sym">((</span>o <span class="hl kwa">load</span>-source-op<span class="hl sym">) (</span>c component<span class="hl sym">))</span> 937 <a id="l_849"></a><span class="hl line"> 849 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>what-would-<span class="hl kwa">load</span>-op-do <span class="hl sym">(</span><span class="hl kwa">cdr</span> <span class="hl sym">(</span><span class="hl kwa">assoc</span> <span class="hl sym">'</span><span class="hl kwa">load</span>-op 938 <a id="l_850"></a><span class="hl line"> 850 </span> <span class="hl sym">(</span>slot-value c <span class="hl sym">'</span>in-order-to<span class="hl sym">)))))</span> 939 <a id="l_851"></a><span class="hl line"> 851 </span> <span class="hl sym">(</span><span class="hl kwa">mapcar</span> <span class="hl sym">(</span><span class="hl kwa">lambda</span> <span class="hl sym">(</span>dep<span class="hl sym">)</span> 940 <a id="l_852"></a><span class="hl line"> 852 </span> <span class="hl sym">(</span><span class="hl kwa">if</span> <span class="hl sym">(</span><span class="hl kwa">eq</span> <span class="hl sym">(</span><span class="hl kwa">car</span> dep<span class="hl sym">) '</span><span class="hl kwa">load</span>-op<span class="hl sym">)</span> 941 <a id="l_853"></a><span class="hl line"> 853 </span> <span class="hl sym">(</span><span class="hl kwa">cons</span> <span class="hl sym">'</span><span class="hl kwa">load</span>-source-op <span class="hl sym">(</span><span class="hl kwa">cdr</span> dep<span class="hl sym">))</span> 942 <a id="l_854"></a><span class="hl line"> 854 </span> dep<span class="hl sym">))</span> 943 <a id="l_855"></a><span class="hl line"> 855 </span> what-would-<span class="hl kwa">load</span>-op-do<span class="hl sym">)))</span> 944 <a id="l_856"></a><span class="hl line"> 856 </span> 945 <a id="l_857"></a><span class="hl line"> 857 </span><span class="hl sym">(</span>defmethod operation-done-p <span class="hl sym">((</span>o <span class="hl kwa">load</span>-source-op<span class="hl sym">) (</span>c source-file<span class="hl sym">))</span> 946 <a id="l_858"></a><span class="hl line"> 858 </span> <span class="hl sym">(</span><span class="hl kwa">if</span> <span class="hl sym">(</span><span class="hl kwa">or</span> <span class="hl sym">(</span><span class="hl kwa">not</span> <span class="hl sym">(</span>component-property c <span class="hl sym">'</span><span class="hl kwa">last</span>-loaded-as-source<span class="hl sym">))</span> 947 <a id="l_859"></a><span class="hl line"> 859 </span> <span class="hl sym">(> (</span>file-write-date <span class="hl sym">(</span>component-pathname c<span class="hl sym">))</span> 948 <a id="l_860"></a><span class="hl line"> 860 </span> <span class="hl sym">(</span>component-property c <span class="hl sym">'</span><span class="hl kwa">last</span>-loaded-as-source<span class="hl sym">)))</span> 949 <a id="l_861"></a><span class="hl line"> 861 </span> nil t<span class="hl sym">))</span> 950 <a id="l_862"></a><span class="hl line"> 862 </span> 951 <a id="l_863"></a><span class="hl line"> 863 </span><span class="hl sym">(</span>defclass test-op <span class="hl sym">(</span>operation<span class="hl sym">) ())</span> 952 <a id="l_864"></a><span class="hl line"> 864 </span> 953 <a id="l_865"></a><span class="hl line"> 865 </span><span class="hl sym">(</span>defmethod perform <span class="hl sym">((</span>operation test-op<span class="hl sym">) (</span>c component<span class="hl sym">))</span> 954 <a id="l_866"></a><span class="hl line"> 866 </span> nil<span class="hl sym">)</span> 955 <a id="l_867"></a><span class="hl line"> 867 </span> 956 <a id="l_868"></a><span class="hl line"> 868 </span><span class="hl sym">(</span>defgeneric <span class="hl kwa">load</span>-preferences <span class="hl sym">(</span>system operation<span class="hl sym">)</span> 957 <a id="l_869"></a><span class="hl line"> 869 </span> <span class="hl sym">(:</span>documentation 958 <a id="l_870"></a><span class="hl line"> 870 </span> <span class="hl str">"Called to load system preferences after <perform operation</span> 959 <a id="l_871"></a><span class="hl line"> 871 </span><span class="hl str">system>. Typical uses are to set parameters that don't exist until</span> 960 <a id="l_872"></a><span class="hl line"> 872 </span><span class="hl str">after the system has been loaded."</span><span class="hl sym">))</span> 961 <a id="l_873"></a><span class="hl line"> 873 </span> 962 <a id="l_874"></a><span class="hl line"> 874 </span><span class="hl sym">(</span>defgeneric preference-file-for-system<span class="hl sym">/</span>operation <span class="hl sym">(</span>system operation<span class="hl sym">)</span> 963 <a id="l_875"></a><span class="hl line"> 875 </span> <span class="hl sym">(:</span>documentation 964 <a id="l_876"></a><span class="hl line"> 876 </span> <span class="hl str">"Returns the pathname of the preference file for this system.</span> 965 <a id="l_877"></a><span class="hl line"> 877 </span><span class="hl str">Called by 'load-preferences to determine what file to load."</span><span class="hl sym">))</span> 966 <a id="l_878"></a><span class="hl line"> 878 </span> 967 <a id="l_879"></a><span class="hl line"> 879 </span><span class="hl sym">(</span>defmethod <span class="hl kwa">load</span>-preferences <span class="hl sym">((</span>s t<span class="hl sym">) (</span>operation t<span class="hl sym">))</span> 968 <a id="l_880"></a><span class="hl line"> 880 </span> <span class="hl slc">;; do nothing</span> 969 <a id="l_881"></a><span class="hl line"> 881 </span> <span class="hl sym">(</span>values<span class="hl sym">))</span> 970 <a id="l_882"></a><span class="hl line"> 882 </span> 971 <a id="l_883"></a><span class="hl line"> 883 </span><span class="hl sym">(</span>defmethod <span class="hl kwa">load</span>-preferences <span class="hl sym">((</span>s system<span class="hl sym">) (</span>operation basic-<span class="hl kwa">load</span>-op<span class="hl sym">))</span> 972 <a id="l_884"></a><span class="hl line"> 884 </span> <span class="hl sym">(</span>let<span class="hl sym">* ((*</span>package<span class="hl sym">* (</span>find-package <span class="hl sym">:</span>common-lisp<span class="hl sym">))</span> 973 <a id="l_885"></a><span class="hl line"> 885 </span> <span class="hl sym">(</span>file <span class="hl sym">(</span>probe-file <span class="hl sym">(</span>preference-file-for-system<span class="hl sym">/</span>operation s operation<span class="hl sym">))))</span> 974 <a id="l_886"></a><span class="hl line"> 886 </span> <span class="hl sym">(</span>when file 975 <a id="l_887"></a><span class="hl line"> 887 </span> <span class="hl sym">(</span>when <span class="hl sym">*</span>verbose-out<span class="hl sym">*</span> 976 <a id="l_888"></a><span class="hl line"> 888 </span> <span class="hl sym">(</span>format <span class="hl sym">*</span>verbose-out<span class="hl sym">*</span> 977 <a id="l_889"></a><span class="hl line"> 889 </span> <span class="hl str">"~&~@<; ~@;loading preferences for ~A/~(~A~) from ~A~@:>~%"</span> 978 <a id="l_890"></a><span class="hl line"> 890 </span> <span class="hl sym">(</span>component-name s<span class="hl sym">)</span> 979 <a id="l_891"></a><span class="hl line"> 891 </span> <span class="hl sym">(</span><span class="hl kwa">type</span>-of operation<span class="hl sym">)</span> file<span class="hl sym">))</span> 980 <a id="l_892"></a><span class="hl line"> 892 </span> <span class="hl sym">(</span><span class="hl kwa">load</span> file<span class="hl sym">))))</span> 981 <a id="l_893"></a><span class="hl line"> 893 </span> 982 <a id="l_894"></a><span class="hl line"> 894 </span><span class="hl sym">(</span>defmethod preference-file-for-system<span class="hl sym">/</span>operation <span class="hl sym">((</span>system t<span class="hl sym">) (</span>operation t<span class="hl sym">))</span> 983 <a id="l_895"></a><span class="hl line"> 895 </span> <span class="hl slc">;; cope with anything other than systems</span> 984 <a id="l_896"></a><span class="hl line"> 896 </span> <span class="hl sym">(</span>preference-file-for-system<span class="hl sym">/</span>operation <span class="hl sym">(</span>find-system system t<span class="hl sym">)</span> operation<span class="hl sym">))</span> 985 <a id="l_897"></a><span class="hl line"> 897 </span> 986 <a id="l_898"></a><span class="hl line"> 898 </span><span class="hl sym">(</span>defmethod preference-file-for-system<span class="hl sym">/</span>operation <span class="hl sym">((</span>s system<span class="hl sym">) (</span>operation t<span class="hl sym">))</span> 987 <a id="l_899"></a><span class="hl line"> 899 </span> <span class="hl sym">(</span>let <span class="hl sym">((*</span>default-pathname-defaults<span class="hl sym">*</span> 988 <a id="l_900"></a><span class="hl line"> 900 </span> <span class="hl sym">(</span>make-pathname <span class="hl sym">:</span>name nil <span class="hl sym">:</span><span class="hl kwa">type</span> nil 989 <a id="l_901"></a><span class="hl line"> 901 </span> <span class="hl sym">:</span>defaults <span class="hl sym">*</span>default-pathname-defaults<span class="hl sym">*)))</span> 990 <a id="l_902"></a><span class="hl line"> 902 </span> <span class="hl sym">(</span>merge-pathnames 991 <a id="l_903"></a><span class="hl line"> 903 </span> <span class="hl sym">(</span>make-pathname <span class="hl sym">:</span>name <span class="hl sym">(</span>component-name s<span class="hl sym">)</span> 992 <a id="l_904"></a><span class="hl line"> 904 </span> <span class="hl sym">:</span><span class="hl kwa">type</span> <span class="hl str">"lisp"</span> 993 <a id="l_905"></a><span class="hl line"> 905 </span> <span class="hl sym">:</span>directory <span class="hl sym">'(:</span>relative <span class="hl str">".asdf"</span><span class="hl sym">))</span> 994 <a id="l_906"></a><span class="hl line"> 906 </span> <span class="hl sym">(</span>truename <span class="hl sym">(</span>user-homedir-pathname<span class="hl sym">)))))</span> 995 <a id="l_907"></a><span class="hl line"> 907 </span> 996 <a id="l_908"></a><span class="hl line"> 908 </span><span class="hl slc">;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</span> 997 <a id="l_909"></a><span class="hl line"> 909 </span><span class="hl slc">;;; invoking operations</span> 998 <a id="l_910"></a><span class="hl line"> 910 </span> 999 <a id="l_911"></a><span class="hl line"> 911 </span><span class="hl sym">(</span>defvar <span class="hl sym">*</span>operate-docstring<span class="hl sym">*</span> 1000 <a id="l_912"></a><span class="hl line"> 912 </span> <span class="hl str">"Operate does three things:</span> 1001 <a id="l_913"></a><span class="hl line"> 913 </span><span class="hl str"></span> 1002 <a id="l_914"></a><span class="hl line"> 914 </span><span class="hl str">1. It creates an instance of `operation-class` using any keyword parameters</span> 1003 <a id="l_915"></a><span class="hl line"> 915 </span><span class="hl str">as initargs.</span> 1004 <a id="l_916"></a><span class="hl line"> 916 </span><span class="hl str">2. It finds the asdf-system specified by `system` (possibly loading</span> 1005 <a id="l_917"></a><span class="hl line"> 917 </span><span class="hl str">it from disk).</span> 1006 <a id="l_918"></a><span class="hl line"> 918 </span><span class="hl str">3. It then calls `traverse` with the operation and system as arguments</span> 1007 <a id="l_919"></a><span class="hl line"> 919 </span><span class="hl str"></span> 1008 <a id="l_920"></a><span class="hl line"> 920 </span><span class="hl str">The traverse operation is wrapped in `with-compilation-unit` and error</span> 1009 <a id="l_921"></a><span class="hl line"> 921 </span><span class="hl str">handling code. If a `version` argument is supplied, then operate also</span> 1010 <a id="l_922"></a><span class="hl line"> 922 </span><span class="hl str">ensures that the system found satisfies it using the `version-satisfies`</span> 1011 <a id="l_923"></a><span class="hl line"> 923 </span><span class="hl str">method."</span><span class="hl sym">)</span> 1012 <a id="l_924"></a><span class="hl line"> 924 </span> 1013 <a id="l_925"></a><span class="hl line"> 925 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> operate <span class="hl sym">(</span>operation-class system <span class="hl sym">&</span>rest args <span class="hl sym">&</span>key <span class="hl sym">(</span>verbose t<span class="hl sym">)</span> version 1014 <a id="l_926"></a><span class="hl line"> 926 </span> <span class="hl sym">&</span>allow-other-keys<span class="hl sym">)</span> 1015 <a id="l_927"></a><span class="hl line"> 927 </span> <span class="hl sym">(</span>let<span class="hl sym">* ((</span>op <span class="hl sym">(</span><span class="hl kwa">apply</span> #<span class="hl sym">'</span>make-instance operation-class 1016 <a id="l_928"></a><span class="hl line"> 928 </span> <span class="hl sym">:</span>original-initargs args 1017 <a id="l_929"></a><span class="hl line"> 929 </span> args<span class="hl sym">))</span> 1018 <a id="l_930"></a><span class="hl line"> 930 </span> <span class="hl sym">(*</span>verbose-out<span class="hl sym">* (</span><span class="hl kwa">if</span> verbose <span class="hl sym">*</span>standard-output<span class="hl sym">* (</span>make-broadcast-stream<span class="hl sym">)))</span> 1019 <a id="l_931"></a><span class="hl line"> 931 </span> <span class="hl sym">(</span>system <span class="hl sym">(</span><span class="hl kwa">if</span> <span class="hl sym">(</span>typep system <span class="hl sym">'</span>component<span class="hl sym">)</span> system <span class="hl sym">(</span>find-system system<span class="hl sym">))))</span> 1020 <a id="l_932"></a><span class="hl line"> 932 </span> <span class="hl sym">(</span>unless <span class="hl sym">(</span>version-satisfies system version<span class="hl sym">)</span> 1021 <a id="l_933"></a><span class="hl line"> 933 </span> <span class="hl sym">(</span>error <span class="hl sym">'</span>missing-component <span class="hl sym">:</span>requires system <span class="hl sym">:</span>version version<span class="hl sym">))</span> 1022 <a id="l_934"></a><span class="hl line"> 934 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>steps <span class="hl sym">(</span>traverse op system<span class="hl sym">)))</span> 1023 <a id="l_935"></a><span class="hl line"> 935 </span> <span class="hl sym">(</span>with-compilation-unit <span class="hl sym">()</span> 1024 <a id="l_936"></a><span class="hl line"> 936 </span> <span class="hl sym">(</span>loop for <span class="hl sym">(</span>op . component<span class="hl sym">)</span> in steps do 1025 <a id="l_937"></a><span class="hl line"> 937 </span> <span class="hl sym">(</span>loop 1026 <a id="l_938"></a><span class="hl line"> 938 </span> <span class="hl sym">(</span>restart-case 1027 <a id="l_939"></a><span class="hl line"> 939 </span> <span class="hl sym">(</span><span class="hl kwa">progn</span> <span class="hl sym">(</span>perform op component<span class="hl sym">)</span> 1028 <a id="l_940"></a><span class="hl line"> 940 </span> <span class="hl sym">(</span>return<span class="hl sym">))</span> 1029 <a id="l_941"></a><span class="hl line"> 941 </span> <span class="hl sym">(</span>retry <span class="hl sym">()</span> 1030 <a id="l_942"></a><span class="hl line"> 942 </span> <span class="hl sym">:</span>report 1031 <a id="l_943"></a><span class="hl line"> 943 </span> <span class="hl sym">(</span><span class="hl kwa">lambda</span> <span class="hl sym">(</span>s<span class="hl sym">)</span> 1032 <a id="l_944"></a><span class="hl line"> 944 </span> <span class="hl sym">(</span>format s <span class="hl str">"~@<Retry performing ~S on ~S.~@:>"</span> 1033 <a id="l_945"></a><span class="hl line"> 945 </span> op component<span class="hl sym">)))</span> 1034 <a id="l_946"></a><span class="hl line"> 946 </span> <span class="hl sym">(</span>accept <span class="hl sym">()</span> 1035 <a id="l_947"></a><span class="hl line"> 947 </span> <span class="hl sym">:</span>report 1036 <a id="l_948"></a><span class="hl line"> 948 </span> <span class="hl sym">(</span><span class="hl kwa">lambda</span> <span class="hl sym">(</span>s<span class="hl sym">)</span> 1037 <a id="l_949"></a><span class="hl line"> 949 </span> <span class="hl sym">(</span>format s <span class="hl str">"~@<Continue, treating ~S on ~S as ~</span> 1038 <a id="l_950"></a><span class="hl line"> 950 </span><span class="hl str"> having been successful.~@:>"</span> 1039 <a id="l_951"></a><span class="hl line"> 951 </span> op component<span class="hl sym">))</span> 1040 <a id="l_952"></a><span class="hl line"> 952 </span> <span class="hl sym">(</span>setf <span class="hl sym">(</span>gethash <span class="hl sym">(</span><span class="hl kwa">type</span>-of op<span class="hl sym">)</span> 1041 <a id="l_953"></a><span class="hl line"> 953 </span> <span class="hl sym">(</span>component-operation-times component<span class="hl sym">))</span> 1042 <a id="l_954"></a><span class="hl line"> 954 </span> <span class="hl sym">(</span>get-universal-time<span class="hl sym">))</span> 1043 <a id="l_955"></a><span class="hl line"> 955 </span> <span class="hl sym">(</span>return<span class="hl sym">)))))))))</span> 1044 <a id="l_956"></a><span class="hl line"> 956 </span> 1045 <a id="l_957"></a><span class="hl line"> 957 </span><span class="hl sym">(</span>setf <span class="hl sym">(</span>documentation <span class="hl sym">'</span>operate <span class="hl sym">'</span>function<span class="hl sym">)</span> 1046 <a id="l_958"></a><span class="hl line"> 958 </span> <span class="hl sym">*</span>operate-docstring<span class="hl sym">*)</span> 1047 <a id="l_959"></a><span class="hl line"> 959 </span> 1048 <a id="l_960"></a><span class="hl line"> 960 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> oos <span class="hl sym">(</span>operation-class system <span class="hl sym">&</span>rest args <span class="hl sym">&</span>key force <span class="hl sym">(</span>verbose t<span class="hl sym">)</span> version<span class="hl sym">)</span> 1049 <a id="l_961"></a><span class="hl line"> 961 </span> <span class="hl sym">(</span>declare <span class="hl sym">(</span>ignore force verbose version<span class="hl sym">))</span> 1050 <a id="l_962"></a><span class="hl line"> 962 </span> <span class="hl sym">(</span><span class="hl kwa">apply</span> #<span class="hl sym">'</span>operate operation-class system args<span class="hl sym">))</span> 1051 <a id="l_963"></a><span class="hl line"> 963 </span> 1052 <a id="l_964"></a><span class="hl line"> 964 </span><span class="hl sym">(</span>setf <span class="hl sym">(</span>documentation <span class="hl sym">'</span>oos <span class="hl sym">'</span>function<span class="hl sym">)</span> 1053 <a id="l_965"></a><span class="hl line"> 965 </span> <span class="hl sym">(</span>format nil 1054 <a id="l_966"></a><span class="hl line"> 966 </span> <span class="hl str">"Short for _operate on system_ and an alias for the `operate` function. ~&~&~a"</span> 1055 <a id="l_967"></a><span class="hl line"> 967 </span> <span class="hl sym">*</span>operate-docstring<span class="hl sym">*))</span> 1056 <a id="l_968"></a><span class="hl line"> 968 </span> 1057 <a id="l_969"></a><span class="hl line"> 969 </span><span class="hl slc">;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</span> 1058 <a id="l_970"></a><span class="hl line"> 970 </span><span class="hl slc">;;; syntax</span> 1059 <a id="l_971"></a><span class="hl line"> 971 </span> 1060 <a id="l_972"></a><span class="hl line"> 972 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> remove-keyword <span class="hl sym">(</span>key arglist<span class="hl sym">)</span> 1061 <a id="l_973"></a><span class="hl line"> 973 </span> <span class="hl sym">(</span>labels <span class="hl sym">((</span>aux <span class="hl sym">(</span>key arglist<span class="hl sym">)</span> 1062 <a id="l_974"></a><span class="hl line"> 974 </span> <span class="hl sym">(</span><span class="hl kwa">cond</span> <span class="hl sym">((</span><span class="hl kwa">null</span> arglist<span class="hl sym">)</span> nil<span class="hl sym">)</span> 1063 <a id="l_975"></a><span class="hl line"> 975 </span> <span class="hl sym">((</span><span class="hl kwa">eq</span> key <span class="hl sym">(</span><span class="hl kwa">car</span> arglist<span class="hl sym">)) (</span><span class="hl kwa">cddr</span> arglist<span class="hl sym">))</span> 1064 <a id="l_976"></a><span class="hl line"> 976 </span> <span class="hl sym">(</span>t <span class="hl sym">(</span><span class="hl kwa">cons</span> <span class="hl sym">(</span><span class="hl kwa">car</span> arglist<span class="hl sym">) (</span><span class="hl kwa">cons</span> <span class="hl sym">(</span><span class="hl kwa">cadr</span> arglist<span class="hl sym">)</span> 1065 <a id="l_977"></a><span class="hl line"> 977 </span> <span class="hl sym">(</span>remove-keyword 1066 <a id="l_978"></a><span class="hl line"> 978 </span> key <span class="hl sym">(</span><span class="hl kwa">cddr</span> arglist<span class="hl sym">))))))))</span> 1067 <a id="l_979"></a><span class="hl line"> 979 </span> <span class="hl sym">(</span>aux key arglist<span class="hl sym">)))</span> 1068 <a id="l_980"></a><span class="hl line"> 980 </span> 1069 <a id="l_981"></a><span class="hl line"> 981 </span><span class="hl sym">(</span>defmacro defsystem <span class="hl sym">(</span>name <span class="hl sym">&</span>body options<span class="hl sym">)</span> 1070 <a id="l_982"></a><span class="hl line"> 982 </span> <span class="hl sym">(</span>destructuring-bind <span class="hl sym">(&</span>key <span class="hl sym">(</span>pathname nil pathname-arg-p<span class="hl sym">) (</span>class <span class="hl sym">'</span>system<span class="hl sym">)</span> 1071 <a id="l_983"></a><span class="hl line"> 983 </span> <span class="hl sym">&</span>allow-other-keys<span class="hl sym">)</span> 1072 <a id="l_984"></a><span class="hl line"> 984 </span> options 1073 <a id="l_985"></a><span class="hl line"> 985 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>component-options <span class="hl sym">(</span>remove-keyword <span class="hl sym">:</span>class options<span class="hl sym">)))</span> 1074 <a id="l_986"></a><span class="hl line"> 986 </span> `<span class="hl sym">(</span><span class="hl kwa">progn</span> 1075 <a id="l_987"></a><span class="hl line"> 987 </span> <span class="hl slc">;; system must be registered before we parse the body, otherwise</span> 1076 <a id="l_988"></a><span class="hl line"> 988 </span> <span class="hl slc">;; we recur when trying to find an existing system of the same name</span> 1077 <a id="l_989"></a><span class="hl line"> 989 </span> <span class="hl slc">;; to reuse options (e.g. pathname) from</span> 1078 <a id="l_990"></a><span class="hl line"> 990 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>s <span class="hl sym">(</span>system-registered-p <span class="hl sym">',</span>name<span class="hl sym">)))</span> 1079 <a id="l_991"></a><span class="hl line"> 991 </span> <span class="hl sym">(</span><span class="hl kwa">cond</span> <span class="hl sym">((</span><span class="hl kwa">and</span> s <span class="hl sym">(</span><span class="hl kwa">eq</span> <span class="hl sym">(</span><span class="hl kwa">type</span>-of <span class="hl sym">(</span><span class="hl kwa">cdr</span> s<span class="hl sym">)) ',</span>class<span class="hl sym">))</span> 1080 <a id="l_992"></a><span class="hl line"> 992 </span> <span class="hl sym">(</span>setf <span class="hl sym">(</span><span class="hl kwa">car</span> s<span class="hl sym">) (</span>get-universal-time<span class="hl sym">)))</span> 1081 <a id="l_993"></a><span class="hl line"> 993 </span> <span class="hl sym">(</span>s 1082 <a id="l_994"></a><span class="hl line"> 994 </span> #<span class="hl sym">+</span>clisp 1083 <a id="l_995"></a><span class="hl line"> 995 </span> <span class="hl sym">(</span>sysdef-error <span class="hl str">"Cannot redefine the existing system ~A with a different class"</span> s<span class="hl sym">)</span> 1084 <a id="l_996"></a><span class="hl line"> 996 </span> #-clisp 1085 <a id="l_997"></a><span class="hl line"> 997 </span> <span class="hl sym">(</span>change-class <span class="hl sym">(</span><span class="hl kwa">cdr</span> s<span class="hl sym">) ',</span>class<span class="hl sym">))</span> 1086 <a id="l_998"></a><span class="hl line"> 998 </span> <span class="hl sym">(</span>t 1087 <a id="l_999"></a><span class="hl line"> 999 </span> <span class="hl sym">(</span>register-system <span class="hl sym">(</span><span class="hl kwa">quote</span> <span class="hl sym">,</span>name<span class="hl sym">)</span> 1088 <a id="l_1000"></a><span class="hl line"> 1000 </span> <span class="hl sym">(</span>make-instance <span class="hl sym">',</span>class <span class="hl sym">:</span>name <span class="hl sym">',</span>name<span class="hl sym">)))))</span> 1089 <a id="l_1001"></a><span class="hl line"> 1001 </span> <span class="hl sym">(</span>parse-component-form nil <span class="hl sym">(</span><span class="hl kwa">apply</span> 1090 <a id="l_1002"></a><span class="hl line"> 1002 </span> #<span class="hl sym">'</span><span class="hl kwa">list</span> 1091 <a id="l_1003"></a><span class="hl line"> 1003 </span> <span class="hl sym">:</span>module <span class="hl sym">(</span>coerce-name <span class="hl sym">',</span>name<span class="hl sym">)</span> 1092 <a id="l_1004"></a><span class="hl line"> 1004 </span> <span class="hl sym">:</span>pathname 1093 <a id="l_1005"></a><span class="hl line"> 1005 </span> <span class="hl slc">;; to avoid a note about unreachable code</span> 1094 <a id="l_1006"></a><span class="hl line"> 1006 </span> <span class="hl sym">,(</span><span class="hl kwa">if</span> pathname-arg-p 1095 <a id="l_1007"></a><span class="hl line"> 1007 </span> pathname 1096 <a id="l_1008"></a><span class="hl line"> 1008 </span> `<span class="hl sym">(</span><span class="hl kwa">or</span> <span class="hl sym">(</span>when <span class="hl sym">*</span><span class="hl kwa">load</span>-truename<span class="hl sym">*</span> 1097 <a id="l_1009"></a><span class="hl line"> 1009 </span> <span class="hl sym">(</span>pathname-sans-name<span class="hl sym">+</span><span class="hl kwa">type</span> 1098 <a id="l_1010"></a><span class="hl line"> 1010 </span> <span class="hl sym">(</span>resolve-symlinks 1099 <a id="l_1011"></a><span class="hl line"> 1011 </span> <span class="hl sym">*</span><span class="hl kwa">load</span>-truename<span class="hl sym">*)))</span> 1100 <a id="l_1012"></a><span class="hl line"> 1012 </span> <span class="hl sym">*</span>default-pathname-defaults<span class="hl sym">*))</span> 1101 <a id="l_1013"></a><span class="hl line"> 1013 </span> <span class="hl sym">',</span>component-options<span class="hl sym">))))))</span> 1102 <a id="l_1014"></a><span class="hl line"> 1014 </span> 1103 <a id="l_1015"></a><span class="hl line"> 1015 </span> 1104 <a id="l_1016"></a><span class="hl line"> 1016 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> class-for-<span class="hl kwa">type</span> <span class="hl sym">(</span>parent <span class="hl kwa">type</span><span class="hl sym">)</span> 1105 <a id="l_1017"></a><span class="hl line"> 1017 </span> <span class="hl sym">(</span>let<span class="hl sym">* ((</span>extra-symbols <span class="hl sym">(</span><span class="hl kwa">list</span> <span class="hl sym">(</span>find-symbol <span class="hl sym">(</span>symbol-name <span class="hl kwa">type</span><span class="hl sym">) *</span>package<span class="hl sym">*)</span> 1106 <a id="l_1018"></a><span class="hl line"> 1018 </span> <span class="hl sym">(</span>find-symbol <span class="hl sym">(</span>symbol-name <span class="hl kwa">type</span><span class="hl sym">)</span> 1107 <a id="l_1019"></a><span class="hl line"> 1019 </span> <span class="hl sym">(</span><span class="hl kwa">load</span>-time-value 1108 <a id="l_1020"></a><span class="hl line"> 1020 </span> <span class="hl sym">(</span>package-name <span class="hl sym">:</span>asdf<span class="hl sym">)))))</span> 1109 <a id="l_1021"></a><span class="hl line"> 1021 </span> <span class="hl sym">(</span>class <span class="hl sym">(</span>dolist <span class="hl sym">(</span>symbol <span class="hl sym">(</span><span class="hl kwa">if</span> <span class="hl sym">(</span>keywordp <span class="hl kwa">type</span><span class="hl sym">)</span> 1110 <a id="l_1022"></a><span class="hl line"> 1022 </span> extra-symbols 1111 <a id="l_1023"></a><span class="hl line"> 1023 </span> <span class="hl sym">(</span><span class="hl kwa">cons type</span> extra-symbols<span class="hl sym">)))</span> 1112 <a id="l_1024"></a><span class="hl line"> 1024 </span> <span class="hl sym">(</span>when <span class="hl sym">(</span><span class="hl kwa">and</span> symbol 1113 <a id="l_1025"></a><span class="hl line"> 1025 </span> <span class="hl sym">(</span>find-class symbol nil<span class="hl sym">)</span> 1114 <a id="l_1026"></a><span class="hl line"> 1026 </span> <span class="hl sym">(</span>subtypep symbol <span class="hl sym">'</span>component<span class="hl sym">))</span> 1115 <a id="l_1027"></a><span class="hl line"> 1027 </span> <span class="hl sym">(</span>return <span class="hl sym">(</span>find-class symbol<span class="hl sym">))))))</span> 1116 <a id="l_1028"></a><span class="hl line"> 1028 </span> <span class="hl sym">(</span><span class="hl kwa">or</span> class 1117 <a id="l_1029"></a><span class="hl line"> 1029 </span> <span class="hl sym">(</span><span class="hl kwa">and</span> <span class="hl sym">(</span><span class="hl kwa">eq type</span> <span class="hl sym">:</span>file<span class="hl sym">)</span> 1118 <a id="l_1030"></a><span class="hl line"> 1030 </span> <span class="hl sym">(</span><span class="hl kwa">or</span> <span class="hl sym">(</span>module-default-component-class parent<span class="hl sym">)</span> 1119 <a id="l_1031"></a><span class="hl line"> 1031 </span> <span class="hl sym">(</span>find-class <span class="hl sym">'</span>cl-source-file<span class="hl sym">)))</span> 1120 <a id="l_1032"></a><span class="hl line"> 1032 </span> <span class="hl sym">(</span>sysdef-error <span class="hl str">"~@<don't recognize component type ~A~@:>"</span> <span class="hl kwa">type</span><span class="hl sym">))))</span> 1121 <a id="l_1033"></a><span class="hl line"> 1033 </span> 1122 <a id="l_1034"></a><span class="hl line"> 1034 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> maybe-add-tree <span class="hl sym">(</span>tree op1 op2 c<span class="hl sym">)</span> 1123 <a id="l_1035"></a><span class="hl line"> 1035 </span> <span class="hl str">"Add the node C at /OP1/OP2 in TREE, unless it's there already.</span> 1124 <a id="l_1036"></a><span class="hl line"> 1036 </span><span class="hl str">Returns the new tree (which probably shares structure with the old one)"</span> 1125 <a id="l_1037"></a><span class="hl line"> 1037 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>first-op-tree <span class="hl sym">(</span><span class="hl kwa">assoc</span> op1 tree<span class="hl sym">)))</span> 1126 <a id="l_1038"></a><span class="hl line"> 1038 </span> <span class="hl sym">(</span><span class="hl kwa">if</span> first-op-tree 1127 <a id="l_1039"></a><span class="hl line"> 1039 </span> <span class="hl sym">(</span><span class="hl kwa">progn</span> 1128 <a id="l_1040"></a><span class="hl line"> 1040 </span> <span class="hl sym">(</span>aif <span class="hl sym">(</span><span class="hl kwa">assoc</span> op2 <span class="hl sym">(</span><span class="hl kwa">cdr</span> first-op-tree<span class="hl sym">))</span> 1129 <a id="l_1041"></a><span class="hl line"> 1041 </span> <span class="hl sym">(</span><span class="hl kwa">if</span> <span class="hl sym">(</span>find c <span class="hl sym">(</span><span class="hl kwa">cdr</span> it<span class="hl sym">))</span> 1130 <a id="l_1042"></a><span class="hl line"> 1042 </span> nil 1131 <a id="l_1043"></a><span class="hl line"> 1043 </span> <span class="hl sym">(</span>setf <span class="hl sym">(</span><span class="hl kwa">cdr</span> it<span class="hl sym">) (</span><span class="hl kwa">cons</span> c <span class="hl sym">(</span><span class="hl kwa">cdr</span> it<span class="hl sym">))))</span> 1132 <a id="l_1044"></a><span class="hl line"> 1044 </span> <span class="hl sym">(</span>setf <span class="hl sym">(</span><span class="hl kwa">cdr</span> first-op-tree<span class="hl sym">)</span> 1133 <a id="l_1045"></a><span class="hl line"> 1045 </span> <span class="hl sym">(</span>acons op2 <span class="hl sym">(</span><span class="hl kwa">list</span> c<span class="hl sym">) (</span><span class="hl kwa">cdr</span> first-op-tree<span class="hl sym">))))</span> 1134 <a id="l_1046"></a><span class="hl line"> 1046 </span> tree<span class="hl sym">)</span> 1135 <a id="l_1047"></a><span class="hl line"> 1047 </span> <span class="hl sym">(</span>acons op1 <span class="hl sym">(</span><span class="hl kwa">list</span> <span class="hl sym">(</span><span class="hl kwa">list</span> op2 c<span class="hl sym">))</span> tree<span class="hl sym">))))</span> 1136 <a id="l_1048"></a><span class="hl line"> 1048 </span> 1137 <a id="l_1049"></a><span class="hl line"> 1049 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> union-of-dependencies <span class="hl sym">(&</span>rest deps<span class="hl sym">)</span> 1138 <a id="l_1050"></a><span class="hl line"> 1050 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>new-tree nil<span class="hl sym">))</span> 1139 <a id="l_1051"></a><span class="hl line"> 1051 </span> <span class="hl sym">(</span>dolist <span class="hl sym">(</span>dep deps<span class="hl sym">)</span> 1140 <a id="l_1052"></a><span class="hl line"> 1052 </span> <span class="hl sym">(</span>dolist <span class="hl sym">(</span>op-tree dep<span class="hl sym">)</span> 1141 <a id="l_1053"></a><span class="hl line"> 1053 </span> <span class="hl sym">(</span>dolist <span class="hl sym">(</span>op <span class="hl sym">(</span><span class="hl kwa">cdr</span> op-tree<span class="hl sym">))</span> 1142 <a id="l_1054"></a><span class="hl line"> 1054 </span> <span class="hl sym">(</span>dolist <span class="hl sym">(</span>c <span class="hl sym">(</span><span class="hl kwa">cdr</span> op<span class="hl sym">))</span> 1143 <a id="l_1055"></a><span class="hl line"> 1055 </span> <span class="hl sym">(</span>setf new-tree 1144 <a id="l_1056"></a><span class="hl line"> 1056 </span> <span class="hl sym">(</span>maybe-add-tree new-tree <span class="hl sym">(</span><span class="hl kwa">car</span> op-tree<span class="hl sym">) (</span><span class="hl kwa">car</span> op<span class="hl sym">)</span> c<span class="hl sym">))))))</span> 1145 <a id="l_1057"></a><span class="hl line"> 1057 </span> new-tree<span class="hl sym">))</span> 1146 <a id="l_1058"></a><span class="hl line"> 1058 </span> 1147 <a id="l_1059"></a><span class="hl line"> 1059 </span> 1148 <a id="l_1060"></a><span class="hl line"> 1060 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> remove-keys <span class="hl sym">(</span>key-names args<span class="hl sym">)</span> 1149 <a id="l_1061"></a><span class="hl line"> 1061 </span> <span class="hl sym">(</span>loop for <span class="hl sym">(</span> name val <span class="hl sym">)</span> on args by #<span class="hl sym">'</span><span class="hl kwa">cddr</span> 1150 <a id="l_1062"></a><span class="hl line"> 1062 </span> unless <span class="hl sym">(</span><span class="hl kwa">member</span> <span class="hl sym">(</span>symbol-name name<span class="hl sym">)</span> key-names 1151 <a id="l_1063"></a><span class="hl line"> 1063 </span> <span class="hl sym">:</span>key #<span class="hl sym">'</span>symbol-name <span class="hl sym">:</span>test <span class="hl sym">'</span><span class="hl kwa">equal</span><span class="hl sym">)</span> 1152 <a id="l_1064"></a><span class="hl line"> 1064 </span> <span class="hl kwa">append</span> <span class="hl sym">(</span><span class="hl kwa">list</span> name val<span class="hl sym">)))</span> 1153 <a id="l_1065"></a><span class="hl line"> 1065 </span> 1154 <a id="l_1066"></a><span class="hl line"> 1066 </span><span class="hl sym">(</span>defvar <span class="hl sym">*</span>serial-depends-on<span class="hl sym">*)</span> 1155 <a id="l_1067"></a><span class="hl line"> 1067 </span> 1156 <a id="l_1068"></a><span class="hl line"> 1068 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> parse-component-form <span class="hl sym">(</span>parent options<span class="hl sym">)</span> 1157 <a id="l_1069"></a><span class="hl line"> 1069 </span> 1158 <a id="l_1070"></a><span class="hl line"> 1070 </span> <span class="hl sym">(</span>destructuring-bind 1159 <a id="l_1071"></a><span class="hl line"> 1071 </span> <span class="hl sym">(</span><span class="hl kwa">type</span> name <span class="hl sym">&</span>rest rest <span class="hl sym">&</span>key 1160 <a id="l_1072"></a><span class="hl line"> 1072 </span> <span class="hl slc">;; the following list of keywords is reproduced below in the</span> 1161 <a id="l_1073"></a><span class="hl line"> 1073 </span> <span class="hl slc">;; remove-keys form. important to keep them in sync</span> 1162 <a id="l_1074"></a><span class="hl line"> 1074 </span> components pathname default-component-class 1163 <a id="l_1075"></a><span class="hl line"> 1075 </span> perform explain output-files operation-done-p 1164 <a id="l_1076"></a><span class="hl line"> 1076 </span> weakly-depends-on 1165 <a id="l_1077"></a><span class="hl line"> 1077 </span> depends-on serial in-order-to 1166 <a id="l_1078"></a><span class="hl line"> 1078 </span> <span class="hl slc">;; list ends</span> 1167 <a id="l_1079"></a><span class="hl line"> 1079 </span> <span class="hl sym">&</span>allow-other-keys<span class="hl sym">)</span> options 1168 <a id="l_1080"></a><span class="hl line"> 1080 </span> <span class="hl sym">(</span>declare <span class="hl sym">(</span>ignorable perform explain output-files operation-done-p<span class="hl sym">))</span> 1169 <a id="l_1081"></a><span class="hl line"> 1081 </span> <span class="hl sym">(</span>check-component-input <span class="hl kwa">type</span> name weakly-depends-on depends-on components in-order-to<span class="hl sym">)</span> 1170 <a id="l_1082"></a><span class="hl line"> 1082 </span> 1171 <a id="l_1083"></a><span class="hl line"> 1083 </span> <span class="hl sym">(</span>when <span class="hl sym">(</span><span class="hl kwa">and</span> parent 1172 <a id="l_1084"></a><span class="hl line"> 1084 </span> <span class="hl sym">(</span>find-component parent name<span class="hl sym">)</span> 1173 <a id="l_1085"></a><span class="hl line"> 1085 </span> <span class="hl slc">;; ignore the same object when rereading the defsystem</span> 1174 <a id="l_1086"></a><span class="hl line"> 1086 </span> <span class="hl sym">(</span><span class="hl kwa">not</span> 1175 <a id="l_1087"></a><span class="hl line"> 1087 </span> <span class="hl sym">(</span>typep <span class="hl sym">(</span>find-component parent name<span class="hl sym">)</span> 1176 <a id="l_1088"></a><span class="hl line"> 1088 </span> <span class="hl sym">(</span>class-for-<span class="hl kwa">type</span> parent <span class="hl kwa">type</span><span class="hl sym">))))</span> 1177 <a id="l_1089"></a><span class="hl line"> 1089 </span> <span class="hl sym">(</span>error <span class="hl sym">'</span>duplicate-names <span class="hl sym">:</span>name name<span class="hl sym">))</span> 1178 <a id="l_1090"></a><span class="hl line"> 1090 </span> 1179 <a id="l_1091"></a><span class="hl line"> 1091 </span> <span class="hl sym">(</span>let<span class="hl sym">* ((</span>other-args <span class="hl sym">(</span>remove-keys 1180 <a id="l_1092"></a><span class="hl line"> 1092 </span> <span class="hl sym">'(</span>components pathname default-component-class 1181 <a id="l_1093"></a><span class="hl line"> 1093 </span> perform explain output-files operation-done-p 1182 <a id="l_1094"></a><span class="hl line"> 1094 </span> weakly-depends-on 1183 <a id="l_1095"></a><span class="hl line"> 1095 </span> depends-on serial in-order-to<span class="hl sym">)</span> 1184 <a id="l_1096"></a><span class="hl line"> 1096 </span> rest<span class="hl sym">))</span> 1185 <a id="l_1097"></a><span class="hl line"> 1097 </span> <span class="hl sym">(</span>ret 1186 <a id="l_1098"></a><span class="hl line"> 1098 </span> <span class="hl sym">(</span><span class="hl kwa">or</span> <span class="hl sym">(</span>find-component parent name<span class="hl sym">)</span> 1187 <a id="l_1099"></a><span class="hl line"> 1099 </span> <span class="hl sym">(</span>make-instance <span class="hl sym">(</span>class-for-<span class="hl kwa">type</span> parent <span class="hl kwa">type</span><span class="hl sym">)))))</span> 1188 <a id="l_1100"></a><span class="hl line"> 1100 </span> <span class="hl sym">(</span>when weakly-depends-on 1189 <a id="l_1101"></a><span class="hl line"> 1101 </span> <span class="hl sym">(</span>setf depends-on <span class="hl sym">(</span><span class="hl kwa">append</span> depends-on <span class="hl sym">(</span>remove-<span class="hl kwa">if</span> <span class="hl sym">(</span>complement #<span class="hl sym">'</span>find-system<span class="hl sym">)</span> weakly-depends-on<span class="hl sym">))))</span> 1190 <a id="l_1102"></a><span class="hl line"> 1102 </span> <span class="hl sym">(</span>when <span class="hl sym">(</span><span class="hl kwa">boundp</span> <span class="hl sym">'*</span>serial-depends-on<span class="hl sym">*)</span> 1191 <a id="l_1103"></a><span class="hl line"> 1103 </span> <span class="hl sym">(</span>setf depends-on 1192 <a id="l_1104"></a><span class="hl line"> 1104 </span> <span class="hl sym">(</span>concatenate <span class="hl sym">'</span><span class="hl kwa">list</span> <span class="hl sym">*</span>serial-depends-on<span class="hl sym">*</span> depends-on<span class="hl sym">)))</span> 1193 <a id="l_1105"></a><span class="hl line"> 1105 </span> <span class="hl sym">(</span><span class="hl kwa">apply</span> #<span class="hl sym">'</span>reinitialize-instance ret 1194 <a id="l_1106"></a><span class="hl line"> 1106 </span> <span class="hl sym">:</span>name <span class="hl sym">(</span>coerce-name name<span class="hl sym">)</span> 1195 <a id="l_1107"></a><span class="hl line"> 1107 </span> <span class="hl sym">:</span>pathname pathname 1196 <a id="l_1108"></a><span class="hl line"> 1108 </span> <span class="hl sym">:</span>parent parent 1197 <a id="l_1109"></a><span class="hl line"> 1109 </span> other-args<span class="hl sym">)</span> 1198 <a id="l_1110"></a><span class="hl line"> 1110 </span> <span class="hl sym">(</span>when <span class="hl sym">(</span>typep ret <span class="hl sym">'</span>module<span class="hl sym">)</span> 1199 <a id="l_1111"></a><span class="hl line"> 1111 </span> <span class="hl sym">(</span>setf <span class="hl sym">(</span>module-default-component-class ret<span class="hl sym">)</span> 1200 <a id="l_1112"></a><span class="hl line"> 1112 </span> <span class="hl sym">(</span><span class="hl kwa">or</span> default-component-class 1201 <a id="l_1113"></a><span class="hl line"> 1113 </span> <span class="hl sym">(</span><span class="hl kwa">and</span> <span class="hl sym">(</span>typep parent <span class="hl sym">'</span>module<span class="hl sym">)</span> 1202 <a id="l_1114"></a><span class="hl line"> 1114 </span> <span class="hl sym">(</span>module-default-component-class parent<span class="hl sym">))))</span> 1203 <a id="l_1115"></a><span class="hl line"> 1115 </span> <span class="hl sym">(</span>let <span class="hl sym">((*</span>serial-depends-on<span class="hl sym">*</span> nil<span class="hl sym">))</span> 1204 <a id="l_1116"></a><span class="hl line"> 1116 </span> <span class="hl sym">(</span>setf <span class="hl sym">(</span>module-components ret<span class="hl sym">)</span> 1205 <a id="l_1117"></a><span class="hl line"> 1117 </span> <span class="hl sym">(</span>loop for c-form in components 1206 <a id="l_1118"></a><span class="hl line"> 1118 </span> for c <span class="hl sym">= (</span>parse-component-form ret c-form<span class="hl sym">)</span> 1207 <a id="l_1119"></a><span class="hl line"> 1119 </span> collect c 1208 <a id="l_1120"></a><span class="hl line"> 1120 </span> <span class="hl kwa">if</span> serial 1209 <a id="l_1121"></a><span class="hl line"> 1121 </span> do <span class="hl sym">(</span>push <span class="hl sym">(</span>component-name c<span class="hl sym">) *</span>serial-depends-on<span class="hl sym">*))))</span> 1210 <a id="l_1122"></a><span class="hl line"> 1122 </span> 1211 <a id="l_1123"></a><span class="hl line"> 1123 </span> <span class="hl slc">;; check for duplicate names</span> 1212 <a id="l_1124"></a><span class="hl line"> 1124 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>name-hash <span class="hl sym">(</span>make-hash-table <span class="hl sym">:</span>test #<span class="hl sym">'</span><span class="hl kwa">equal</span><span class="hl sym">)))</span> 1213 <a id="l_1125"></a><span class="hl line"> 1125 </span> <span class="hl sym">(</span>loop for c in <span class="hl sym">(</span>module-components ret<span class="hl sym">)</span> 1214 <a id="l_1126"></a><span class="hl line"> 1126 </span> do 1215 <a id="l_1127"></a><span class="hl line"> 1127 </span> <span class="hl sym">(</span><span class="hl kwa">if</span> <span class="hl sym">(</span>gethash <span class="hl sym">(</span>component-name c<span class="hl sym">)</span> 1216 <a id="l_1128"></a><span class="hl line"> 1128 </span> name-hash<span class="hl sym">)</span> 1217 <a id="l_1129"></a><span class="hl line"> 1129 </span> <span class="hl sym">(</span>error <span class="hl sym">'</span>duplicate-names 1218 <a id="l_1130"></a><span class="hl line"> 1130 </span> <span class="hl sym">:</span>name <span class="hl sym">(</span>component-name c<span class="hl sym">))</span> 1219 <a id="l_1131"></a><span class="hl line"> 1131 </span> <span class="hl sym">(</span>setf <span class="hl sym">(</span>gethash <span class="hl sym">(</span>component-name c<span class="hl sym">)</span> 1220 <a id="l_1132"></a><span class="hl line"> 1132 </span> name-hash<span class="hl sym">)</span> 1221 <a id="l_1133"></a><span class="hl line"> 1133 </span> t<span class="hl sym">)))))</span> 1222 <a id="l_1134"></a><span class="hl line"> 1134 </span> 1223 <a id="l_1135"></a><span class="hl line"> 1135 </span> <span class="hl sym">(</span>setf <span class="hl sym">(</span>slot-value ret <span class="hl sym">'</span>in-order-to<span class="hl sym">)</span> 1224 <a id="l_1136"></a><span class="hl line"> 1136 </span> <span class="hl sym">(</span>union-of-dependencies 1225 <a id="l_1137"></a><span class="hl line"> 1137 </span> in-order-to 1226 <a id="l_1138"></a><span class="hl line"> 1138 </span> `<span class="hl sym">((</span>compile-op <span class="hl sym">(</span>compile-op <span class="hl sym">,</span>@depends-on<span class="hl sym">))</span> 1227 <a id="l_1139"></a><span class="hl line"> 1139 </span> <span class="hl sym">(</span><span class="hl kwa">load</span>-op <span class="hl sym">(</span><span class="hl kwa">load</span>-op <span class="hl sym">,</span>@depends-on<span class="hl sym">))))</span> 1228 <a id="l_1140"></a><span class="hl line"> 1140 </span> <span class="hl sym">(</span>slot-value ret <span class="hl sym">'</span>do-first<span class="hl sym">)</span> `<span class="hl sym">((</span>compile-op <span class="hl sym">(</span><span class="hl kwa">load</span>-op <span class="hl sym">,</span>@depends-on<span class="hl sym">))))</span> 1229 <a id="l_1141"></a><span class="hl line"> 1141 </span> 1230 <a id="l_1142"></a><span class="hl line"> 1142 </span> <span class="hl sym">(</span>%remove-component-inline-methods ret rest<span class="hl sym">)</span> 1231 <a id="l_1143"></a><span class="hl line"> 1143 </span> 1232 <a id="l_1144"></a><span class="hl line"> 1144 </span> ret<span class="hl sym">)))</span> 1233 <a id="l_1145"></a><span class="hl line"> 1145 </span> 1234 <a id="l_1146"></a><span class="hl line"> 1146 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> %remove-component-inline-methods <span class="hl sym">(</span>ret rest<span class="hl sym">)</span> 1235 <a id="l_1147"></a><span class="hl line"> 1147 </span> <span class="hl sym">(</span>loop for name in <span class="hl sym">+</span>asdf-methods<span class="hl sym">+</span> 1236 <a id="l_1148"></a><span class="hl line"> 1148 </span> do <span class="hl sym">(</span>map <span class="hl sym">'</span>nil 1237 <a id="l_1149"></a><span class="hl line"> 1149 </span> <span class="hl slc">;; this is inefficient as most of the stored</span> 1238 <a id="l_1150"></a><span class="hl line"> 1150 </span> <span class="hl slc">;; methods will not be for this particular gf n</span> 1239 <a id="l_1151"></a><span class="hl line"> 1151 </span> <span class="hl slc">;; But this is hardly performance-critical</span> 1240 <a id="l_1152"></a><span class="hl line"> 1152 </span> <span class="hl sym">(</span><span class="hl kwa">lambda</span> <span class="hl sym">(</span>m<span class="hl sym">)</span> 1241 <a id="l_1153"></a><span class="hl line"> 1153 </span> <span class="hl sym">(</span>remove-method <span class="hl sym">(</span>symbol-function name<span class="hl sym">)</span> m<span class="hl sym">))</span> 1242 <a id="l_1154"></a><span class="hl line"> 1154 </span> <span class="hl sym">(</span>component-inline-methods ret<span class="hl sym">)))</span> 1243 <a id="l_1155"></a><span class="hl line"> 1155 </span> <span class="hl slc">;; clear methods, then add the new ones</span> 1244 <a id="l_1156"></a><span class="hl line"> 1156 </span> <span class="hl sym">(</span>setf <span class="hl sym">(</span>component-inline-methods ret<span class="hl sym">)</span> nil<span class="hl sym">)</span> 1245 <a id="l_1157"></a><span class="hl line"> 1157 </span> <span class="hl sym">(</span>loop for name in <span class="hl sym">+</span>asdf-methods<span class="hl sym">+</span> 1246 <a id="l_1158"></a><span class="hl line"> 1158 </span> for v <span class="hl sym">= (</span>getf rest <span class="hl sym">(</span>intern <span class="hl sym">(</span>symbol-name name<span class="hl sym">) :</span>keyword<span class="hl sym">))</span> 1247 <a id="l_1159"></a><span class="hl line"> 1159 </span> when v do 1248 <a id="l_1160"></a><span class="hl line"> 1160 </span> <span class="hl sym">(</span>destructuring-bind <span class="hl sym">(</span>op qual <span class="hl sym">(</span>o c<span class="hl sym">) &</span>body body<span class="hl sym">)</span> v 1249 <a id="l_1161"></a><span class="hl line"> 1161 </span> <span class="hl sym">(</span>pushnew 1250 <a id="l_1162"></a><span class="hl line"> 1162 </span> <span class="hl sym">(</span><span class="hl kwa">eval</span> `<span class="hl sym">(</span>defmethod <span class="hl sym">,</span>name <span class="hl sym">,</span>qual <span class="hl sym">((,</span>o <span class="hl sym">,</span>op<span class="hl sym">) (,</span>c <span class="hl sym">(</span>eql <span class="hl sym">,</span>ret<span class="hl sym">)))</span> 1251 <a id="l_1163"></a><span class="hl line"> 1163 </span> <span class="hl sym">,</span>@body<span class="hl sym">))</span> 1252 <a id="l_1164"></a><span class="hl line"> 1164 </span> <span class="hl sym">(</span>component-inline-methods ret<span class="hl sym">)))))</span> 1253 <a id="l_1165"></a><span class="hl line"> 1165 </span> 1254 <a id="l_1166"></a><span class="hl line"> 1166 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> check-component-input <span class="hl sym">(</span><span class="hl kwa">type</span> name weakly-depends-on depends-on components in-order-to<span class="hl sym">)</span> 1255 <a id="l_1167"></a><span class="hl line"> 1167 </span> <span class="hl str">"A partial test of the values of a component."</span> 1256 <a id="l_1168"></a><span class="hl line"> 1168 </span> <span class="hl sym">(</span>when weakly-depends-on <span class="hl sym">(</span>warn <span class="hl str">"We got one! XXXXX"</span><span class="hl sym">))</span> 1257 <a id="l_1169"></a><span class="hl line"> 1169 </span> <span class="hl sym">(</span>unless <span class="hl sym">(</span><span class="hl kwa">listp</span> depends-on<span class="hl sym">)</span> 1258 <a id="l_1170"></a><span class="hl line"> 1170 </span> <span class="hl sym">(</span>sysdef-error-component <span class="hl str">":depends-on must be a list."</span> 1259 <a id="l_1171"></a><span class="hl line"> 1171 </span> <span class="hl kwa">type</span> name depends-on<span class="hl sym">))</span> 1260 <a id="l_1172"></a><span class="hl line"> 1172 </span> <span class="hl sym">(</span>unless <span class="hl sym">(</span><span class="hl kwa">listp</span> weakly-depends-on<span class="hl sym">)</span> 1261 <a id="l_1173"></a><span class="hl line"> 1173 </span> <span class="hl sym">(</span>sysdef-error-component <span class="hl str">":weakly-depends-on must be a list."</span> 1262 <a id="l_1174"></a><span class="hl line"> 1174 </span> <span class="hl kwa">type</span> name weakly-depends-on<span class="hl sym">))</span> 1263 <a id="l_1175"></a><span class="hl line"> 1175 </span> <span class="hl sym">(</span>unless <span class="hl sym">(</span><span class="hl kwa">listp</span> components<span class="hl sym">)</span> 1264 <a id="l_1176"></a><span class="hl line"> 1176 </span> <span class="hl sym">(</span>sysdef-error-component <span class="hl str">":components must be NIL or a list of components."</span> 1265 <a id="l_1177"></a><span class="hl line"> 1177 </span> <span class="hl kwa">type</span> name components<span class="hl sym">))</span> 1266 <a id="l_1178"></a><span class="hl line"> 1178 </span> <span class="hl sym">(</span>unless <span class="hl sym">(</span><span class="hl kwa">and</span> <span class="hl sym">(</span><span class="hl kwa">listp</span> in-order-to<span class="hl sym">) (</span><span class="hl kwa">listp</span> <span class="hl sym">(</span><span class="hl kwa">car</span> in-order-to<span class="hl sym">)))</span> 1267 <a id="l_1179"></a><span class="hl line"> 1179 </span> <span class="hl sym">(</span>sysdef-error-component <span class="hl str">":in-order-to must be NIL or a list of components."</span> 1268 <a id="l_1180"></a><span class="hl line"> 1180 </span> <span class="hl kwa">type</span> name in-order-to<span class="hl sym">)))</span> 1269 <a id="l_1181"></a><span class="hl line"> 1181 </span> 1270 <a id="l_1182"></a><span class="hl line"> 1182 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> sysdef-error-component <span class="hl sym">(</span>msg <span class="hl kwa">type</span> name value<span class="hl sym">)</span> 1271 <a id="l_1183"></a><span class="hl line"> 1183 </span> <span class="hl sym">(</span>sysdef-error <span class="hl sym">(</span>concatenate <span class="hl sym">'</span>string msg 1272 <a id="l_1184"></a><span class="hl line"> 1184 </span> <span class="hl str">"~&The value specified for ~(~A~) ~A is ~W"</span><span class="hl sym">)</span> 1273 <a id="l_1185"></a><span class="hl line"> 1185 </span> <span class="hl kwa">type</span> name value<span class="hl sym">))</span> 1274 <a id="l_1186"></a><span class="hl line"> 1186 </span> 1275 <a id="l_1187"></a><span class="hl line"> 1187 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> resolve-symlinks <span class="hl sym">(</span>path<span class="hl sym">)</span> 1276 <a id="l_1188"></a><span class="hl line"> 1188 </span> #-allegro <span class="hl sym">(</span>truename path<span class="hl sym">)</span> 1277 <a id="l_1189"></a><span class="hl line"> 1189 </span> #<span class="hl sym">+</span>allegro <span class="hl sym">(</span>excl<span class="hl sym">:</span>pathname-resolve-symbolic-links path<span class="hl sym">)</span> 1278 <a id="l_1190"></a><span class="hl line"> 1190 </span> <span class="hl sym">)</span> 1279 <a id="l_1191"></a><span class="hl line"> 1191 </span> 1280 <a id="l_1192"></a><span class="hl line"> 1192 </span><span class="hl slc">;;; optional extras</span> 1281 <a id="l_1193"></a><span class="hl line"> 1193 </span> 1282 <a id="l_1194"></a><span class="hl line"> 1194 </span><span class="hl slc">;;; run-shell-command functions for other lisp implementations will be</span> 1283 <a id="l_1195"></a><span class="hl line"> 1195 </span><span class="hl slc">;;; gratefully accepted, if they do the same thing. If the docstring</span> 1284 <a id="l_1196"></a><span class="hl line"> 1196 </span><span class="hl slc">;;; is ambiguous, send a bug report</span> 1285 <a id="l_1197"></a><span class="hl line"> 1197 </span> 1286 <a id="l_1198"></a><span class="hl line"> 1198 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> run-shell-<span class="hl kwa">command</span> <span class="hl sym">(</span>control-string <span class="hl sym">&</span>rest args<span class="hl sym">)</span> 1287 <a id="l_1199"></a><span class="hl line"> 1199 </span> <span class="hl str">"Interpolate ARGS into CONTROL-STRING as if by FORMAT, and</span> 1288 <a id="l_1200"></a><span class="hl line"> 1200 </span><span class="hl str">synchronously execute the result using a Bourne-compatible shell, with</span> 1289 <a id="l_1201"></a><span class="hl line"> 1201 </span><span class="hl str">output to *VERBOSE-OUT*. Returns the shell's exit code."</span> 1290 <a id="l_1202"></a><span class="hl line"> 1202 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span><span class="hl kwa">command</span> <span class="hl sym">(</span><span class="hl kwa">apply</span> #<span class="hl sym">'</span>format nil control-string args<span class="hl sym">)))</span> 1291 <a id="l_1203"></a><span class="hl line"> 1203 </span> <span class="hl sym">(</span>format <span class="hl sym">*</span>verbose-out<span class="hl sym">*</span> <span class="hl str">"; $ ~A~%"</span> <span class="hl kwa">command</span><span class="hl sym">)</span> 1292 <a id="l_1204"></a><span class="hl line"> 1204 </span> #<span class="hl sym">+</span>sbcl 1293 <a id="l_1205"></a><span class="hl line"> 1205 </span> <span class="hl sym">(</span>sb-ext<span class="hl sym">:</span>process-<span class="hl kwa">exit</span>-code 1294 <a id="l_1206"></a><span class="hl line"> 1206 </span> <span class="hl sym">(</span>sb-ext<span class="hl sym">:</span>run-program 1295 <a id="l_1207"></a><span class="hl line"> 1207 </span> #<span class="hl sym">+</span>win32 <span class="hl str">"sh"</span> #-win32 <span class="hl str">"/bin/sh"</span> 1296 <a id="l_1208"></a><span class="hl line"> 1208 </span> <span class="hl sym">(</span><span class="hl kwa">list</span> <span class="hl str">"-c"</span> <span class="hl kwa">command</span><span class="hl sym">)</span> 1297 <a id="l_1209"></a><span class="hl line"> 1209 </span> #<span class="hl sym">+</span>win32 #<span class="hl sym">+</span>win32 <span class="hl sym">:</span>search t 1298 <a id="l_1210"></a><span class="hl line"> 1210 </span> <span class="hl sym">:</span>input nil <span class="hl sym">:</span>output <span class="hl sym">*</span>verbose-out<span class="hl sym">*))</span> 1299 <a id="l_1211"></a><span class="hl line"> 1211 </span> 1300 <a id="l_1212"></a><span class="hl line"> 1212 </span> #<span class="hl sym">+(</span><span class="hl kwa">or</span> cmu scl<span class="hl sym">)</span> 1301 <a id="l_1213"></a><span class="hl line"> 1213 </span> <span class="hl sym">(</span>ext<span class="hl sym">:</span>process-<span class="hl kwa">exit</span>-code 1302 <a id="l_1214"></a><span class="hl line"> 1214 </span> <span class="hl sym">(</span>ext<span class="hl sym">:</span>run-program 1303 <a id="l_1215"></a><span class="hl line"> 1215 </span> <span class="hl str">"/bin/sh"</span> 1304 <a id="l_1216"></a><span class="hl line"> 1216 </span> <span class="hl sym">(</span><span class="hl kwa">list</span> <span class="hl str">"-c"</span> <span class="hl kwa">command</span><span class="hl sym">)</span> 1305 <a id="l_1217"></a><span class="hl line"> 1217 </span> <span class="hl sym">:</span>input nil <span class="hl sym">:</span>output <span class="hl sym">*</span>verbose-out<span class="hl sym">*))</span> 1306 <a id="l_1218"></a><span class="hl line"> 1218 </span> 1307 <a id="l_1219"></a><span class="hl line"> 1219 </span> #<span class="hl sym">+</span>allegro 1308 <a id="l_1220"></a><span class="hl line"> 1220 </span> <span class="hl sym">(</span>excl<span class="hl sym">:</span>run-shell-<span class="hl kwa">command command</span> <span class="hl sym">:</span>input nil <span class="hl sym">:</span>output <span class="hl sym">*</span>verbose-out<span class="hl sym">*)</span> 1309 <a id="l_1221"></a><span class="hl line"> 1221 </span> 1310 <a id="l_1222"></a><span class="hl line"> 1222 </span> #<span class="hl sym">+</span>lispworks 1311 <a id="l_1223"></a><span class="hl line"> 1223 </span> <span class="hl sym">(</span>system<span class="hl sym">:</span>call-system-showing-output 1312 <a id="l_1224"></a><span class="hl line"> 1224 </span> <span class="hl kwa">command</span> 1313 <a id="l_1225"></a><span class="hl line"> 1225 </span> <span class="hl sym">:</span>shell-<span class="hl kwa">type</span> <span class="hl str">"/bin/sh"</span> 1314 <a id="l_1226"></a><span class="hl line"> 1226 </span> <span class="hl sym">:</span>output-stream <span class="hl sym">*</span>verbose-out<span class="hl sym">*)</span> 1315 <a id="l_1227"></a><span class="hl line"> 1227 </span> 1316 <a id="l_1228"></a><span class="hl line"> 1228 </span> #<span class="hl sym">+</span>clisp <span class="hl slc">;XXX not exactly *verbose-out*, I know</span> 1317 <a id="l_1229"></a><span class="hl line"> 1229 </span> <span class="hl sym">(</span>ext<span class="hl sym">:</span>run-shell-<span class="hl kwa">command command</span> <span class="hl sym">:</span>output <span class="hl sym">:</span>terminal <span class="hl sym">:</span>wait t<span class="hl sym">)</span> 1318 <a id="l_1230"></a><span class="hl line"> 1230 </span> 1319 <a id="l_1231"></a><span class="hl line"> 1231 </span> #<span class="hl sym">+</span>openmcl 1320 <a id="l_1232"></a><span class="hl line"> 1232 </span> <span class="hl sym">(</span><span class="hl kwa">nth</span>-value <span class="hl num">1</span> 1321 <a id="l_1233"></a><span class="hl line"> 1233 </span> <span class="hl sym">(</span>ccl<span class="hl sym">:</span>external-process-status 1322 <a id="l_1234"></a><span class="hl line"> 1234 </span> <span class="hl sym">(</span>ccl<span class="hl sym">:</span>run-program <span class="hl str">"/bin/sh"</span> <span class="hl sym">(</span><span class="hl kwa">list</span> <span class="hl str">"-c"</span> <span class="hl kwa">command</span><span class="hl sym">)</span> 1323 <a id="l_1235"></a><span class="hl line"> 1235 </span> <span class="hl sym">:</span>input nil <span class="hl sym">:</span>output <span class="hl sym">*</span>verbose-out<span class="hl sym">*</span> 1324 <a id="l_1236"></a><span class="hl line"> 1236 </span> <span class="hl sym">:</span>wait t<span class="hl sym">)))</span> 1325 <a id="l_1237"></a><span class="hl line"> 1237 </span> #<span class="hl sym">+</span>ecl <span class="hl slc">;; courtesy of Juan Jose Garcia Ripoll</span> 1326 <a id="l_1238"></a><span class="hl line"> 1238 </span> <span class="hl sym">(</span>si<span class="hl sym">:</span>system <span class="hl kwa">command</span><span class="hl sym">)</span> 1327 <a id="l_1239"></a><span class="hl line"> 1239 </span> #-<span class="hl sym">(</span><span class="hl kwa">or</span> openmcl clisp lispworks allegro scl cmu sbcl ecl<span class="hl sym">)</span> 1328 <a id="l_1240"></a><span class="hl line"> 1240 </span> <span class="hl sym">(</span>error <span class="hl str">"RUN-SHELL-PROGRAM not implemented for this Lisp"</span><span class="hl sym">)</span> 1329 <a id="l_1241"></a><span class="hl line"> 1241 </span> <span class="hl sym">))</span> 1330 <a id="l_1242"></a><span class="hl line"> 1242 </span> 1331 <a id="l_1243"></a><span class="hl line"> 1243 </span> 1332 <a id="l_1244"></a><span class="hl line"> 1244 </span><span class="hl sym">(</span>defgeneric hyperdocumentation <span class="hl sym">(</span>package name doc-<span class="hl kwa">type</span><span class="hl sym">))</span> 1333 <a id="l_1245"></a><span class="hl line"> 1245 </span><span class="hl sym">(</span>defmethod hyperdocumentation <span class="hl sym">((</span>package symbol<span class="hl sym">)</span> name doc-<span class="hl kwa">type</span><span class="hl sym">)</span> 1334 <a id="l_1246"></a><span class="hl line"> 1246 </span> <span class="hl sym">(</span>hyperdocumentation <span class="hl sym">(</span>find-package package<span class="hl sym">)</span> name doc-<span class="hl kwa">type</span><span class="hl sym">))</span> 1335 <a id="l_1247"></a><span class="hl line"> 1247 </span> 1336 <a id="l_1248"></a><span class="hl line"> 1248 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> hyperdoc <span class="hl sym">(</span>name doc-<span class="hl kwa">type</span><span class="hl sym">)</span> 1337 <a id="l_1249"></a><span class="hl line"> 1249 </span> <span class="hl sym">(</span>hyperdocumentation <span class="hl sym">(</span>symbol-package name<span class="hl sym">)</span> name doc-<span class="hl kwa">type</span><span class="hl sym">))</span> 1338 <a id="l_1250"></a><span class="hl line"> 1250 </span> 1339 <a id="l_1251"></a><span class="hl line"> 1251 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> system-source-file <span class="hl sym">(</span>system-name<span class="hl sym">)</span> 1340 <a id="l_1252"></a><span class="hl line"> 1252 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>system <span class="hl sym">(</span>asdf<span class="hl sym">:</span>find-system system-name<span class="hl sym">)))</span> 1341 <a id="l_1253"></a><span class="hl line"> 1253 </span> <span class="hl sym">(</span>make-pathname 1342 <a id="l_1254"></a><span class="hl line"> 1254 </span> <span class="hl sym">:</span><span class="hl kwa">type</span> <span class="hl str">"asd"</span> 1343 <a id="l_1255"></a><span class="hl line"> 1255 </span> <span class="hl sym">:</span>name <span class="hl sym">(</span>asdf<span class="hl sym">:</span>component-name system<span class="hl sym">)</span> 1344 <a id="l_1256"></a><span class="hl line"> 1256 </span> <span class="hl sym">:</span>defaults <span class="hl sym">(</span>asdf<span class="hl sym">:</span>component-relative-pathname system<span class="hl sym">))))</span> 1345 <a id="l_1257"></a><span class="hl line"> 1257 </span> 1346 <a id="l_1258"></a><span class="hl line"> 1258 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> system-source-directory <span class="hl sym">(</span>system-name<span class="hl sym">)</span> 1347 <a id="l_1259"></a><span class="hl line"> 1259 </span> <span class="hl sym">(</span>make-pathname <span class="hl sym">:</span>name nil 1348 <a id="l_1260"></a><span class="hl line"> 1260 </span> <span class="hl sym">:</span><span class="hl kwa">type</span> nil 1349 <a id="l_1261"></a><span class="hl line"> 1261 </span> <span class="hl sym">:</span>defaults <span class="hl sym">(</span>system-source-file system-name<span class="hl sym">)))</span> 1350 <a id="l_1262"></a><span class="hl line"> 1262 </span> 1351 <a id="l_1263"></a><span class="hl line"> 1263 </span><span class="hl sym">(</span><span class="hl kwa">defun</span> system-relative-pathname <span class="hl sym">(</span>system pathname <span class="hl sym">&</span>key name <span class="hl kwa">type</span><span class="hl sym">)</span> 1352 <a id="l_1264"></a><span class="hl line"> 1264 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>directory <span class="hl sym">(</span>pathname-directory pathname<span class="hl sym">)))</span> 1353 <a id="l_1265"></a><span class="hl line"> 1265 </span> <span class="hl sym">(</span>when <span class="hl sym">(</span><span class="hl kwa">eq</span> <span class="hl sym">(</span><span class="hl kwa">car</span> directory<span class="hl sym">) :</span>absolute<span class="hl sym">)</span> 1354 <a id="l_1266"></a><span class="hl line"> 1266 </span> <span class="hl sym">(</span>setf <span class="hl sym">(</span><span class="hl kwa">car</span> directory<span class="hl sym">) :</span>relative<span class="hl sym">))</span> 1355 <a id="l_1267"></a><span class="hl line"> 1267 </span> <span class="hl sym">(</span>merge-pathnames 1356 <a id="l_1268"></a><span class="hl line"> 1268 </span> <span class="hl sym">(</span>make-pathname <span class="hl sym">:</span>name <span class="hl sym">(</span><span class="hl kwa">or</span> name <span class="hl sym">(</span>pathname-name pathname<span class="hl sym">))</span> 1357 <a id="l_1269"></a><span class="hl line"> 1269 </span> <span class="hl sym">:</span><span class="hl kwa">type</span> <span class="hl sym">(</span><span class="hl kwa">or type</span> <span class="hl sym">(</span>pathname-<span class="hl kwa">type</span> pathname<span class="hl sym">))</span> 1358 <a id="l_1270"></a><span class="hl line"> 1270 </span> <span class="hl sym">:</span>directory directory<span class="hl sym">)</span> 1359 <a id="l_1271"></a><span class="hl line"> 1271 </span> <span class="hl sym">(</span>system-source-directory system<span class="hl sym">))))</span> 1360 <a id="l_1272"></a><span class="hl line"> 1272 </span> 1361 <a id="l_1273"></a><span class="hl line"> 1273 </span> 1362 <a id="l_1274"></a><span class="hl line"> 1274 </span><span class="hl sym">(</span>pushnew <span class="hl sym">:</span>asdf <span class="hl sym">*</span>features<span class="hl sym">*)</span> 1363 <a id="l_1275"></a><span class="hl line"> 1275 </span> 1364 <a id="l_1276"></a><span class="hl line"> 1276 </span>#<span class="hl sym">+</span>sbcl 1365 <a id="l_1277"></a><span class="hl line"> 1277 </span><span class="hl sym">(</span><span class="hl kwa">eval</span>-when <span class="hl sym">(:</span>compile-toplevel <span class="hl sym">:</span><span class="hl kwa">load</span>-toplevel <span class="hl sym">:</span>execute<span class="hl sym">)</span> 1366 <a id="l_1278"></a><span class="hl line"> 1278 </span> <span class="hl sym">(</span>when <span class="hl sym">(</span>sb-ext<span class="hl sym">:</span>posix-<span class="hl kwa">getenv</span> <span class="hl str">"SBCL_BUILDING_CONTRIB"</span><span class="hl sym">)</span> 1367 <a id="l_1279"></a><span class="hl line"> 1279 </span> <span class="hl sym">(</span>pushnew <span class="hl sym">:</span>sbcl-hooks-require <span class="hl sym">*</span>features<span class="hl sym">*)))</span> 1368 <a id="l_1280"></a><span class="hl line"> 1280 </span> 1369 <a id="l_1281"></a><span class="hl line"> 1281 </span>#<span class="hl sym">+(</span><span class="hl kwa">and</span> sbcl sbcl-hooks-require<span class="hl sym">)</span> 1370 <a id="l_1282"></a><span class="hl line"> 1282 </span><span class="hl sym">(</span><span class="hl kwa">progn</span> 1371 <a id="l_1283"></a><span class="hl line"> 1283 </span> <span class="hl sym">(</span><span class="hl kwa">defun</span> module-provide-asdf <span class="hl sym">(</span>name<span class="hl sym">)</span> 1372 <a id="l_1284"></a><span class="hl line"> 1284 </span> <span class="hl sym">(</span>handler-bind <span class="hl sym">((</span>style-warning #<span class="hl sym">'</span>muffle-warning<span class="hl sym">))</span> 1373 <a id="l_1285"></a><span class="hl line"> 1285 </span> <span class="hl sym">(</span>let<span class="hl sym">* ((*</span>verbose-out<span class="hl sym">* (</span>make-broadcast-stream<span class="hl sym">))</span> 1374 <a id="l_1286"></a><span class="hl line"> 1286 </span> <span class="hl sym">(</span>system <span class="hl sym">(</span>asdf<span class="hl sym">:</span>find-system name nil<span class="hl sym">)))</span> 1375 <a id="l_1287"></a><span class="hl line"> 1287 </span> <span class="hl sym">(</span>when system 1376 <a id="l_1288"></a><span class="hl line"> 1288 </span> <span class="hl sym">(</span>asdf<span class="hl sym">:</span>operate <span class="hl sym">'</span>asdf<span class="hl sym">:</span><span class="hl kwa">load</span>-op name<span class="hl sym">)</span> 1377 <a id="l_1289"></a><span class="hl line"> 1289 </span> t<span class="hl sym">))))</span> 1378 <a id="l_1290"></a><span class="hl line"> 1290 </span> 1379 <a id="l_1291"></a><span class="hl line"> 1291 </span> <span class="hl sym">(</span><span class="hl kwa">defun</span> contrib-sysdef-search <span class="hl sym">(</span>system<span class="hl sym">)</span> 1380 <a id="l_1292"></a><span class="hl line"> 1292 </span> <span class="hl sym">(</span>let <span class="hl sym">((</span>home <span class="hl sym">(</span>sb-ext<span class="hl sym">:</span>posix-<span class="hl kwa">getenv</span> <span class="hl str">"SBCL_HOME"</span><span class="hl sym">)))</span> 1381 <a id="l_1293"></a><span class="hl line"> 1293 </span> <span class="hl sym">(</span>when <span class="hl sym">(</span><span class="hl kwa">and</span> home <span class="hl sym">(</span><span class="hl kwa">not</span> <span class="hl sym">(</span>string<span class="hl sym">=</span> home <span class="hl str">""</span><span class="hl sym">)))</span> 1382 <a id="l_1294"></a><span class="hl line"> 1294 </span> <span class="hl sym">(</span>let<span class="hl sym">* ((</span>name <span class="hl sym">(</span>coerce-name system<span class="hl sym">))</span> 1383 <a id="l_1295"></a><span class="hl line"> 1295 </span> <span class="hl sym">(</span>home <span class="hl sym">(</span>truename home<span class="hl sym">))</span> 1384 <a id="l_1296"></a><span class="hl line"> 1296 </span> <span class="hl sym">(</span>contrib <span class="hl sym">(</span>merge-pathnames 1385 <a id="l_1297"></a><span class="hl line"> 1297 </span> <span class="hl sym">(</span>make-pathname <span class="hl sym">:</span>directory `<span class="hl sym">(:</span>relative <span class="hl sym">,</span>name<span class="hl sym">)</span> 1386 <a id="l_1298"></a><span class="hl line"> 1298 </span> <span class="hl sym">:</span>name name 1387 <a id="l_1299"></a><span class="hl line"> 1299 </span> <span class="hl sym">:</span><span class="hl kwa">type</span> <span class="hl str">"asd"</span> 1388 <a id="l_1300"></a><span class="hl line"> 1300 </span> <span class="hl sym">:</span>case <span class="hl sym">:</span>local 1389 <a id="l_1301"></a><span class="hl line"> 1301 </span> <span class="hl sym">:</span>version <span class="hl sym">:</span>newest<span class="hl sym">)</span> 1390 <a id="l_1302"></a><span class="hl line"> 1302 </span> home<span class="hl sym">)))</span> 1391 <a id="l_1303"></a><span class="hl line"> 1303 </span> <span class="hl sym">(</span>probe-file contrib<span class="hl sym">)))))</span> 1392 <a id="l_1304"></a><span class="hl line"> 1304 </span> 1393 <a id="l_1305"></a><span class="hl line"> 1305 </span> <span class="hl sym">(</span>pushnew 1394 <a id="l_1306"></a><span class="hl line"> 1306 </span> <span class="hl sym">'(</span>let <span class="hl sym">((</span>home <span class="hl sym">(</span>sb-ext<span class="hl sym">:</span>posix-<span class="hl kwa">getenv</span> <span class="hl str">"SBCL_HOME"</span><span class="hl sym">)))</span> 1395 <a id="l_1307"></a><span class="hl line"> 1307 </span> <span class="hl sym">(</span>when <span class="hl sym">(</span><span class="hl kwa">and</span> home <span class="hl sym">(</span><span class="hl kwa">not</span> <span class="hl sym">(</span>string<span class="hl sym">=</span> home <span class="hl str">""</span><span class="hl sym">)))</span> 1396 <a id="l_1308"></a><span class="hl line"> 1308 </span> <span class="hl sym">(</span>merge-pathnames <span class="hl str">"site-systems/"</span> <span class="hl sym">(</span>truename home<span class="hl sym">))))</span> 1397 <a id="l_1309"></a><span class="hl line"> 1309 </span> <span class="hl sym">*</span>central-registry<span class="hl sym">*)</span> 1398 <a id="l_1310"></a><span class="hl line"> 1310 </span> 1399 <a id="l_1311"></a><span class="hl line"> 1311 </span> <span class="hl sym">(</span>pushnew 1400 <a id="l_1312"></a><span class="hl line"> 1312 </span> <span class="hl sym">'(</span>merge-pathnames <span class="hl str">".sbcl/systems/"</span> 1401 <a id="l_1313"></a><span class="hl line"> 1313 </span> <span class="hl sym">(</span>user-homedir-pathname<span class="hl sym">))</span> 1402 <a id="l_1314"></a><span class="hl line"> 1314 </span> <span class="hl sym">*</span>central-registry<span class="hl sym">*)</span> 1403 <a id="l_1315"></a><span class="hl line"> 1315 </span> 1404 <a id="l_1316"></a><span class="hl line"> 1316 </span> <span class="hl sym">(</span>pushnew <span class="hl sym">'</span>module-provide-asdf sb-ext<span class="hl sym">:*</span>module-provider-functions<span class="hl sym">*)</span> 1405 <a id="l_1317"></a><span class="hl line"> 1317 </span> <span class="hl sym">(</span>pushnew <span class="hl sym">'</span>contrib-sysdef-search <span class="hl sym">*</span>system-definition-search-functions<span class="hl sym">*))</span> 1406 <a id="l_1318"></a><span class="hl line"> 1318 </span> 1407 <a id="l_1319"></a><span class="hl line"> 1319 </span><span class="hl sym">(</span>provide <span class="hl sym">'</span>asdf<span class="hl sym">)</span> 1408 </pre></div> 1409 1410 <hr /> 1411 <table> 1412 <tr> 1413 <td> 1414 <address><a href="http://sourceforge.net/">Back to SourceForge.net</a></address><br /> 1415 Powered by <a href="http://viewvc.tigris.org/">ViewVC 1.0.3</a> 1416 </td> 1417 <td style="text-align:right;"> 1418 <h3><a href="/*docroot*/help_rootview.html">ViewVC and Help</a></h3> 1419 </td> 1420 </tr> 1421 </table> 1422 </body> 1423 </html> 1424 1 ;;; This is asdf: Another System Definition Facility. $Revision$ 2 ;;; 3 ;;; Feedback, bug reports, and patches are all welcome: please mail to 4 ;;; <cclan-list@lists.sf.net>. But note first that the canonical 5 ;;; source for asdf is presently the cCLan CVS repository at 6 ;;; <URL:http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/cclan/asdf/> 7 ;;; 8 ;;; If you obtained this copy from anywhere else, and you experience 9 ;;; trouble using it, or find bugs, you may want to check at the 10 ;;; location above for a more recent version (and for documentation 11 ;;; and test files, if your copy came without them) before reporting 12 ;;; bugs. There are usually two "supported" revisions - the CVS HEAD 13 ;;; is the latest development version, whereas the revision tagged 14 ;;; RELEASE may be slightly older but is considered `stable' 15 16 ;;; Copyright (c) 2001-2007 Daniel Barlow and contributors 17 ;;; 18 ;;; Permission is hereby granted, free of charge, to any person obtaining 19 ;;; a copy of this software and associated documentation files (the 20 ;;; "Software"), to deal in the Software without restriction, including 21 ;;; without limitation the rights to use, copy, modify, merge, publish, 22 ;;; distribute, sublicense, and/or sell copies of the Software, and to 23 ;;; permit persons to whom the Software is furnished to do so, subject to 24 ;;; the following conditions: 25 ;;; 26 ;;; The above copyright notice and this permission notice shall be 27 ;;; included in all copies or substantial portions of the Software. 28 ;;; 29 ;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 30 ;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 31 ;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 32 ;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 33 ;;; LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 34 ;;; OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 35 ;;; WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 36 37 ;;; the problem with writing a defsystem replacement is bootstrapping: 38 ;;; we can't use defsystem to compile it. Hence, all in one file 39 40 (defpackage #:asdf 41 (:export #:defsystem #:oos #:operate #:find-system #:run-shell-command 42 #:system-definition-pathname #:find-component ; miscellaneous 43 #:hyperdocumentation #:hyperdoc 44 45 #:compile-op #:load-op #:load-source-op #:test-system-version 46 #:test-op 47 #:operation ; operations 48 #:feature ; sort-of operation 49 #:version ; metaphorically sort-of an operation 50 51 #:input-files #:output-files #:perform ; operation methods 52 #:operation-done-p #:explain 53 54 #:component #:source-file 55 #:c-source-file #:cl-source-file #:java-source-file 56 #:static-file 57 #:doc-file 58 #:html-file 59 #:text-file 60 #:source-file-type 61 #:module ; components 62 #:system 63 #:unix-dso 64 65 #:module-components ; component accessors 66 #:component-pathname 67 #:component-relative-pathname 68 #:component-name 69 #:component-version 70 #:component-parent 71 #:component-property 72 #:component-system 73 74 #:component-depends-on 75 76 #:system-description 77 #:system-long-description 78 #:system-author 79 #:system-maintainer 80 #:system-license 81 #:system-licence 82 #:system-source-file 83 #:system-relative-pathname 84 85 #:operation-on-warnings 86 #:operation-on-failure 87 88 ;#:*component-parent-pathname* 89 #:*system-definition-search-functions* 90 #:*central-registry* ; variables 91 #:*compile-file-warnings-behaviour* 92 #:*compile-file-failure-behaviour* 93 #:*asdf-revision* 94 95 #:operation-error #:compile-failed #:compile-warned #:compile-error 96 #:error-component #:error-operation 97 #:system-definition-error 98 #:missing-component 99 #:missing-dependency 100 #:circular-dependency ; errors 101 #:duplicate-names 102 103 #:retry 104 #:accept ; restarts 105 106 #:preference-file-for-system/operation 107 #:load-preferences 108 ) 109 (:use :cl)) 110 111 112 #+nil 113 (error "The author of this file habitually uses #+nil to comment out ~ 114 forms. But don't worry, it was unlikely to work in the New ~ 115 Implementation of Lisp anyway") 116 117 (in-package #:asdf) 118 119 (defvar *asdf-revision* (let* ((v "$Revision$") 120 (colon (or (position #\: v) -1)) 121 (dot (position #\. v))) 122 (and v colon dot 123 (list (parse-integer v :start (1+ colon) 124 :junk-allowed t) 125 (parse-integer v :start (1+ dot) 126 :junk-allowed t))))) 127 128 (defvar *compile-file-warnings-behaviour* :warn) 129 130 (defvar *compile-file-failure-behaviour* #+sbcl :error #-sbcl :warn) 131 132 (defvar *verbose-out* nil) 133 134 (defparameter +asdf-methods+ 135 '(perform explain output-files operation-done-p)) 136 137 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 138 ;; utility stuff 139 140 (defmacro aif (test then &optional else) 141 `(let ((it ,test)) (if it ,then ,else))) 142 143 (defun pathname-sans-name+type (pathname) 144 "Returns a new pathname with same HOST, DEVICE, DIRECTORY as PATHNAME, 145 and NIL NAME and TYPE components" 146 (make-pathname :name nil :type nil :defaults pathname)) 147 148 (define-modify-macro appendf (&rest args) 149 append "Append onto list") 150 151 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 152 ;; classes, condiitons 153 154 (define-condition system-definition-error (error) () 155 ;; [this use of :report should be redundant, but unfortunately it's not. 156 ;; cmucl's lisp::output-instance prefers the kernel:slot-class-print-function 157 ;; over print-object; this is always conditions::%print-condition for 158 ;; condition objects, which in turn does inheritance of :report options at 159 ;; run-time. fortunately, inheritance means we only need this kludge here in 160 ;; order to fix all conditions that build on it. -- rgr, 28-Jul-02.] 161 #+cmu (:report print-object)) 162 163 (define-condition formatted-system-definition-error (system-definition-error) 164 ((format-control :initarg :format-control :reader format-control) 165 (format-arguments :initarg :format-arguments :reader format-arguments)) 166 (:report (lambda (c s) 167 (apply #'format s (format-control c) (format-arguments c))))) 168 169 (define-condition circular-dependency (system-definition-error) 170 ((components :initarg :components :reader circular-dependency-components))) 171 172 (define-condition duplicate-names (system-definition-error) 173 ((name :initarg :name :reader duplicate-names-name))) 174 175 (define-condition missing-component (system-definition-error) 176 ((requires :initform "(unnamed)" :reader missing-requires :initarg :requires) 177 (version :initform nil :reader missing-version :initarg :version) 178 (parent :initform nil :reader missing-parent :initarg :parent))) 179 180 (define-condition missing-dependency (missing-component) 181 ((required-by :initarg :required-by :reader missing-required-by))) 182 183 (define-condition operation-error (error) 184 ((component :reader error-component :initarg :component) 185 (operation :reader error-operation :initarg :operation)) 186 (:report (lambda (c s) 187 (format s "~@<erred while invoking ~A on ~A~@:>" 188 (error-operation c) (error-component c))))) 189 (define-condition compile-error (operation-error) ()) 190 (define-condition compile-failed (compile-error) ()) 191 (define-condition compile-warned (compile-error) ()) 192 193 (defclass component () 194 ((name :accessor component-name :initarg :name :documentation 195 "Component name: designator for a string composed of portable pathname characters") 196 (version :accessor component-version :initarg :version) 197 (in-order-to :initform nil :initarg :in-order-to) 198 ;; XXX crap name 199 (do-first :initform nil :initarg :do-first) 200 ;; methods defined using the "inline" style inside a defsystem form: 201 ;; need to store them somewhere so we can delete them when the system 202 ;; is re-evaluated 203 (inline-methods :accessor component-inline-methods :initform nil) 204 (parent :initarg :parent :initform nil :reader component-parent) 205 ;; no direct accessor for pathname, we do this as a method to allow 206 ;; it to default in funky ways if not supplied 207 (relative-pathname :initarg :pathname) 208 (operation-times :initform (make-hash-table ) 209 :accessor component-operation-times) 210 ;; XXX we should provide some atomic interface for updating the 211 ;; component properties 212 (properties :accessor component-properties :initarg :properties 213 :initform nil))) 214 215 ;;;; methods: conditions 216 217 (defmethod print-object ((c missing-dependency) s) 218 (format s "~@<~A, required by ~A~@:>" 219 (call-next-method c nil) (missing-required-by c))) 220 221 (defun sysdef-error (format &rest arguments) 222 (error 'formatted-system-definition-error :format-control format :format-arguments arguments)) 223 224 ;;;; methods: components 225 226 (defmethod print-object ((c missing-component) s) 227 (format s "~@<component ~S not found~ 228 ~@[ or does not match version ~A~]~ 229 ~@[ in ~A~]~@:>" 230 (missing-requires c) 231 (missing-version c) 232 (when (missing-parent c) 233 (component-name (missing-parent c))))) 234 235 (defgeneric component-system (component) 236 (:documentation "Find the top-level system containing COMPONENT")) 237 238 (defmethod component-system ((component component)) 239 (aif (component-parent component) 240 (component-system it) 241 component)) 242 243 (defmethod print-object ((c component) stream) 244 (print-unreadable-object (c stream :type t :identity t) 245 (ignore-errors 246 (prin1 (component-name c) stream)))) 247 248 (defclass module (component) 249 ((components :initform nil :accessor module-components :initarg :components) 250 ;; what to do if we can't satisfy a dependency of one of this module's 251 ;; components. This allows a limited form of conditional processing 252 (if-component-dep-fails :initform :fail 253 :accessor module-if-component-dep-fails 254 :initarg :if-component-dep-fails) 255 (default-component-class :accessor module-default-component-class 256 :initform 'cl-source-file :initarg :default-component-class))) 257 258 (defgeneric component-pathname (component) 259 (:documentation "Extracts the pathname applicable for a particular component.")) 260 261 (defun component-parent-pathname (component) 262 (aif (component-parent component) 263 (component-pathname it) 264 *default-pathname-defaults*)) 265 266 (defgeneric component-relative-pathname (component) 267 (:documentation "Extracts the relative pathname applicable for a particular component.")) 268 269 (defmethod component-relative-pathname ((component module)) 270 (or (slot-value component 'relative-pathname) 271 (make-pathname 272 :directory `(:relative ,(component-name component)) 273 :host (pathname-host (component-parent-pathname component))))) 274 275 (defmethod component-pathname ((component component)) 276 (let ((*default-pathname-defaults* (component-parent-pathname component))) 277 (merge-pathnames (component-relative-pathname component)))) 278 279 (defgeneric component-property (component property)) 280 281 (defmethod component-property ((c component) property) 282 (cdr (assoc property (slot-value c 'properties) :test #'equal))) 283 284 (defgeneric (setf component-property) (new-value component property)) 285 286 (defmethod (setf component-property) (new-value (c component) property) 287 (let ((a (assoc property (slot-value c 'properties) :test #'equal))) 288 (if a 289 (setf (cdr a) new-value) 290 (setf (slot-value c 'properties) 291 (acons property new-value (slot-value c 'properties)))))) 292 293 (defclass system (module) 294 ((description :accessor system-description :initarg :description) 295 (long-description 296 :accessor system-long-description :initarg :long-description) 297 (author :accessor system-author :initarg :author) 298 (maintainer :accessor system-maintainer :initarg :maintainer) 299 (licence :accessor system-licence :initarg :licence 300 :accessor system-license :initarg :license))) 301 302 ;;; version-satisfies 303 304 ;;; with apologies to christophe rhodes ... 305 (defun split (string &optional max (ws '(#\Space #\Tab))) 306 (flet ((is-ws (char) (find char ws))) 307 (nreverse 308 (let ((list nil) (start 0) (words 0) end) 309 (loop 310 (when (and max (>= words (1- max))) 311 (return (cons (subseq string start) list))) 312 (setf end (position-if #'is-ws string :start start)) 313 (push (subseq string start end) list) 314 (incf words) 315 (unless end (return list)) 316 (setf start (1+ end))))))) 317 318 (defgeneric version-satisfies (component version)) 319 320 (defmethod version-satisfies ((c component) version) 321 (unless (and version (slot-boundp c 'version)) 322 (return-from version-satisfies t)) 323 (let ((x (mapcar #'parse-integer 324 (split (component-version c) nil '(#\.)))) 325 (y (mapcar #'parse-integer 326 (split version nil '(#\.))))) 327 (labels ((bigger (x y) 328 (cond ((not y) t) 329 ((not x) nil) 330 ((> (car x) (car y)) t) 331 ((= (car x) (car y)) 332 (bigger (cdr x) (cdr y)))))) 333 (and (= (car x) (car y)) 334 (or (not (cdr y)) (bigger (cdr x) (cdr y))))))) 335 336 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 337 ;;; finding systems 338 339 (defvar *defined-systems* (make-hash-table :test 'equal)) 340 (defun coerce-name (name) 341 (typecase name 342 (component (component-name name)) 343 (symbol (string-downcase (symbol-name name))) 344 (string name) 345 (t (sysdef-error "~@<invalid component designator ~A~@:>" name)))) 346 347 ;;; for the sake of keeping things reasonably neat, we adopt a 348 ;;; convention that functions in this list are prefixed SYSDEF- 349 350 (defvar *system-definition-search-functions* 351 '(sysdef-central-registry-search)) 352 353 (defun system-definition-pathname (system) 354 (some (lambda (x) (funcall x system)) 355 *system-definition-search-functions*)) 356 357 (defvar *central-registry* 358 '(*default-pathname-defaults* 359 #+nil "/home/dan/src/sourceforge/cclan/asdf/systems/" 360 #+nil "telent:asdf;systems;")) 361 362 (defun sysdef-central-registry-search (system) 363 (let ((name (coerce-name system))) 364 (block nil 365 (dolist (dir *central-registry*) 366 (let* ((defaults (eval dir)) 367 (file (and defaults 368 (make-pathname 369 :defaults defaults :version :newest 370 :name name :type "asd" :case :local)))) 371 (if (and file (probe-file file)) 372 (return file))))))) 373 374 (defun make-temporary-package () 375 (flet ((try (counter) 376 (ignore-errors 377 (make-package (format nil "ASDF~D" counter) 378 :use '(:cl :asdf))))) 379 (do* ((counter 0 (+ counter 1)) 380 (package (try counter) (try counter))) 381 (package package)))) 382 383 (defun find-system (name &optional (error-p t)) 384 (let* ((name (coerce-name name)) 385 (in-memory (gethash name *defined-systems*)) 386 (on-disk (system-definition-pathname name))) 387 (when (and on-disk 388 (or (not in-memory) 389 (< (car in-memory) (file-write-date on-disk)))) 390 (let ((package (make-temporary-package))) 391 (unwind-protect 392 (let ((*package* package)) 393 (format 394 *verbose-out* 395 "~&~@<; ~@;loading system definition from ~A into ~A~@:>~%" 396 ;; FIXME: This wants to be (ENOUGH-NAMESTRING 397 ;; ON-DISK), but CMUCL barfs on that. 398 on-disk 399 *package*) 400 (load on-disk)) 401 (delete-package package)))) 402 (let ((in-memory (gethash name *defined-systems*))) 403 (if in-memory 404 (progn (if on-disk (setf (car in-memory) (file-write-date on-disk))) 405 (cdr in-memory)) 406 (if error-p (error 'missing-component :requires name)))))) 407 408 (defun register-system (name system) 409 (format *verbose-out* "~&~@<; ~@;registering ~A as ~A~@:>~%" system name) 410 (setf (gethash (coerce-name name) *defined-systems*) 411 (cons (get-universal-time) system))) 412 413 (defun system-registered-p (name) 414 (gethash (coerce-name name) *defined-systems*)) 415 416 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 417 ;;; finding components 418 419 (defgeneric find-component (module name &optional version) 420 (:documentation "Finds the component with name NAME present in the 421 MODULE module; if MODULE is nil, then the component is assumed to be a 422 system.")) 423 424 (defmethod find-component ((module module) name &optional version) 425 (if (slot-boundp module 'components) 426 (let ((m (find name (module-components module) 427 :test #'equal :key #'component-name))) 428 (if (and m (version-satisfies m version)) m)))) 429 430 431 ;;; a component with no parent is a system 432 (defmethod find-component ((module (eql nil)) name &optional version) 433 (let ((m (find-system name nil))) 434 (if (and m (version-satisfies m version)) m))) 435 436 ;;; component subclasses 437 438 (defclass source-file (component) ()) 439 440 (defclass cl-source-file (source-file) ()) 441 (defclass c-source-file (source-file) ()) 442 (defclass java-source-file (source-file) ()) 443 (defclass static-file (source-file) ()) 444 (defclass doc-file (static-file) ()) 445 (defclass html-file (doc-file) ()) 446 447 (defgeneric source-file-type (component system)) 448 (defmethod source-file-type ((c cl-source-file) (s module)) "lisp") 449 (defmethod source-file-type ((c c-source-file) (s module)) "c") 450 (defmethod source-file-type ((c java-source-file) (s module)) "java") 451 (defmethod source-file-type ((c html-file) (s module)) "html") 452 (defmethod source-file-type ((c static-file) (s module)) nil) 453 454 (defmethod component-relative-pathname ((component source-file)) 455 (let ((relative-pathname (slot-value component 'relative-pathname))) 456 (if relative-pathname 457 (merge-pathnames 458 relative-pathname 459 (make-pathname 460 :type (source-file-type component (component-system component)))) 461 (let* ((*default-pathname-defaults* 462 (component-parent-pathname component)) 463 (name-type 464 (make-pathname 465 :name (component-name component) 466 :type (source-file-type component 467 (component-system component))))) 468 name-type)))) 469 470 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 471 ;;; operations 472 473 ;;; one of these is instantiated whenever (operate ) is called 474 475 (defclass operation () 476 ((forced :initform nil :initarg :force :accessor operation-forced) 477 (original-initargs :initform nil :initarg :original-initargs 478 :accessor operation-original-initargs) 479 (visited-nodes :initform nil :accessor operation-visited-nodes) 480 (visiting-nodes :initform nil :accessor operation-visiting-nodes) 481 (parent :initform nil :initarg :parent :accessor operation-parent))) 482 483 (defmethod print-object ((o operation) stream) 484 (print-unreadable-object (o stream :type t :identity t) 485 (ignore-errors 486 (prin1 (operation-original-initargs o) stream)))) 487 488 (defmethod shared-initialize :after ((operation operation) slot-names 489 &key force 490 &allow-other-keys) 491 (declare (ignore slot-names force)) 492 ;; empty method to disable initarg validity checking 493 ) 494 495 (defgeneric perform (operation component)) 496 (defgeneric operation-done-p (operation component)) 497 (defgeneric explain (operation component)) 498 (defgeneric output-files (operation component)) 499 (defgeneric input-files (operation component)) 500 501 (defun node-for (o c) 502 (cons (class-name (class-of o)) c)) 503 504 (defgeneric operation-ancestor (operation) 505 (:documentation 506 "Recursively chase the operation's parent pointer until we get to 507 the head of the tree")) 508 509 (defmethod operation-ancestor ((operation operation)) 510 (aif (operation-parent operation) 511 (operation-ancestor it) 512 operation)) 513 514 515 (defun make-sub-operation (c o dep-c dep-o) 516 (let* ((args (copy-list (operation-original-initargs o))) 517 (force-p (getf args :force))) 518 ;; note explicit comparison with T: any other non-NIL force value 519 ;; (e.g. :recursive) will pass through 520 (cond ((and (null (component-parent c)) 521 (null (component-parent dep-c)) 522 (not (eql c dep-c))) 523 (when (eql force-p t) 524 (setf (getf args :force) nil)) 525 (apply #'make-instance dep-o 526 :parent o 527 :original-initargs args args)) 528 ((subtypep (type-of o) dep-o) 529 o) 530 (t 531 (apply #'make-instance dep-o 532 :parent o :original-initargs args args))))) 533 534 535 (defgeneric visit-component (operation component data)) 536 537 (defmethod visit-component ((o operation) (c component) data) 538 (unless (component-visited-p o c) 539 (push (cons (node-for o c) data) 540 (operation-visited-nodes (operation-ancestor o))))) 541 542 (defgeneric component-visited-p (operation component)) 543 544 (defmethod component-visited-p ((o operation) (c component)) 545 (assoc (node-for o c) 546 (operation-visited-nodes (operation-ancestor o)) 547 :test 'equal)) 548 549 (defgeneric (setf visiting-component) (new-value operation component)) 550 551 (defmethod (setf visiting-component) (new-value operation component) 552 ;; MCL complains about unused lexical variables 553 (declare (ignorable new-value operation component))) 554 555 (defmethod (setf visiting-component) (new-value (o operation) (c component)) 556 (let ((node (node-for o c)) 557 (a (operation-ancestor o))) 558 (if new-value 559 (pushnew node (operation-visiting-nodes a) :test 'equal) 560 (setf (operation-visiting-nodes a) 561 (remove node (operation-visiting-nodes a) :test 'equal))))) 562 563 (defgeneric component-visiting-p (operation component)) 564 565 (defmethod component-visiting-p ((o operation) (c component)) 566 (let ((node (cons o c))) 567 (member node (operation-visiting-nodes (operation-ancestor o)) 568 :test 'equal))) 569 570 (defgeneric component-depends-on (operation component) 571 (:documentation 572 "Returns a list of dependencies needed by the component to perform 573 the operation. A dependency has one of the following forms: 574 575 (<operation> <component>*), where <operation> is a class 576 designator and each <component> is a component 577 designator, which means that the component depends on 578 <operation> having been performed on each <component>; or 579 580 (FEATURE <feature>), which means that the component depends 581 on <feature>'s presence in *FEATURES*. 582 583 Methods specialized on subclasses of existing component types 584 should usually append the results of CALL-NEXT-METHOD to the 585 list.")) 586 587 (defmethod component-depends-on ((op-spec symbol) (c component)) 588 (component-depends-on (make-instance op-spec) c)) 589 590 (defmethod component-depends-on ((o operation) (c component)) 591 (cdr (assoc (class-name (class-of o)) 592 (slot-value c 'in-order-to)))) 593 594 (defgeneric component-self-dependencies (operation component)) 595 596 (defmethod component-self-dependencies ((o operation) (c component)) 597 (let ((all-deps (component-depends-on o c))) 598 (remove-if-not (lambda (x) 599 (member (component-name c) (cdr x) :test #'string=)) 600 all-deps))) 601 602 (defmethod input-files ((operation operation) (c component)) 603 (let ((parent (component-parent c)) 604 (self-deps (component-self-dependencies operation c))) 605 (if self-deps 606 (mapcan (lambda (dep) 607 (destructuring-bind (op name) dep 608 (output-files (make-instance op) 609 (find-component parent name)))) 610 self-deps) 611 ;; no previous operations needed? I guess we work with the 612 ;; original source file, then 613 (list (component-pathname c))))) 614 615 (defmethod input-files ((operation operation) (c module)) nil) 616 617 (defmethod operation-done-p ((o operation) (c component)) 618 (flet ((fwd-or-return-t (file) 619 ;; if FILE-WRITE-DATE returns NIL, it's possible that the 620 ;; user or some other agent has deleted an input file. If 621 ;; that's the case, well, that's not good, but as long as 622 ;; the operation is otherwise considered to be done we 623 ;; could continue and survive. 624 (let ((date (file-write-date file))) 625 (cond 626 (date) 627 (t 628 (warn "~@<Missing FILE-WRITE-DATE for ~S: treating ~ 629 operation ~S on component ~S as done.~@:>" 630 file o c) 631 (return-from operation-done-p t)))))) 632 (let ((out-files (output-files o c)) 633 (in-files (input-files o c))) 634 (cond ((and (not in-files) (not out-files)) 635 ;; arbitrary decision: an operation that uses nothing to 636 ;; produce nothing probably isn't doing much 637 t) 638 ((not out-files) 639 (let ((op-done 640 (gethash (type-of o) 641 (component-operation-times c)))) 642 (and op-done 643 (>= op-done 644 (apply #'max 645 (mapcar #'fwd-or-return-t in-files)))))) 646 ((not in-files) nil) 647 (t 648 (and 649 (every #'probe-file out-files) 650 (> (apply #'min (mapcar #'file-write-date out-files)) 651 (apply #'max (mapcar #'fwd-or-return-t in-files))))))))) 652 653 ;;; So you look at this code and think "why isn't it a bunch of 654 ;;; methods". And the answer is, because standard method combination 655 ;;; runs :before methods most->least-specific, which is back to front 656 ;;; for our purposes. And CLISP doesn't have non-standard method 657 ;;; combinations, so let's keep it simple and aspire to portability 658 659 (defgeneric traverse (operation component)) 660 (defmethod traverse ((operation operation) (c component)) 661 (let ((forced nil)) 662 (labels ((do-one-dep (required-op required-c required-v) 663 (let* ((dep-c (or (find-component 664 (component-parent c) 665 ;; XXX tacky. really we should build the 666 ;; in-order-to slot with canonicalized 667 ;; names instead of coercing this late 668 (coerce-name required-c) required-v) 669 (error 'missing-dependency 670 :required-by c 671 :version required-v 672 :requires required-c))) 673 (op (make-sub-operation c operation dep-c required-op))) 674 (traverse op dep-c))) 675 (do-dep (op dep) 676 (cond ((eq op 'feature) 677 (or (member (car dep) *features*) 678 (error 'missing-dependency 679 :required-by c 680 :requires (car dep) 681 :version nil))) 682 (t 683 (dolist (d dep) 684 (cond ((consp d) 685 (assert (string-equal 686 (symbol-name (first d)) 687 "VERSION")) 688 (appendf forced 689 (do-one-dep op (second d) (third d)))) 690 (t 691 (appendf forced (do-one-dep op d nil))))))))) 692 (aif (component-visited-p operation c) 693 (return-from traverse 694 (if (cdr it) (list (cons 'pruned-op c)) nil))) 695 ;; dependencies 696 (if (component-visiting-p operation c) 697 (error 'circular-dependency :components (list c))) 698 (setf (visiting-component operation c) t) 699 (loop for (required-op . deps) in (component-depends-on operation c) 700 do (do-dep required-op deps)) 701 ;; constituent bits 702 (let ((module-ops 703 (when (typep c 'module) 704 (let ((at-least-one nil) 705 (forced nil) 706 (error nil)) 707 (loop for kid in (module-components c) 708 do (handler-case 709 (appendf forced (traverse operation kid )) 710 (missing-dependency (condition) 711 (if (eq (module-if-component-dep-fails c) :fail) 712 (error condition)) 713 (setf error condition)) 714 (:no-error (c) 715 (declare (ignore c)) 716 (setf at-least-one t)))) 717 (when (and (eq (module-if-component-dep-fails c) :try-next) 718 (not at-least-one)) 719 (error error)) 720 forced)))) 721 ;; now the thing itself 722 (when (or forced module-ops 723 (not (operation-done-p operation c)) 724 (let ((f (operation-forced (operation-ancestor operation)))) 725 (and f (or (not (consp f)) 726 (member (component-name 727 (operation-ancestor operation)) 728 (mapcar #'coerce-name f) 729 :test #'string=))))) 730 (let ((do-first (cdr (assoc (class-name (class-of operation)) 731 (slot-value c 'do-first))))) 732 (loop for (required-op . deps) in do-first 733 do (do-dep required-op deps))) 734 (setf forced (append (delete 'pruned-op forced :key #'car) 735 (delete 'pruned-op module-ops :key #'car) 736 (list (cons operation c)))))) 737 (setf (visiting-component operation c) nil) 738 (visit-component operation c (and forced t)) 739 forced))) 740 741 742 (defmethod perform ((operation operation) (c source-file)) 743 (sysdef-error 744 "~@<required method PERFORM not implemented ~ 745 for operation ~A, component ~A~@:>" 746 (class-of operation) (class-of c))) 747 748 (defmethod perform ((operation operation) (c module)) 749 nil) 750 751 (defmethod explain ((operation operation) (component component)) 752 (format *verbose-out* "~&;;; ~A on ~A~%" operation component)) 753 754 ;;; compile-op 755 756 (defclass compile-op (operation) 757 ((proclamations :initarg :proclamations :accessor compile-op-proclamations :initform nil) 758 (on-warnings :initarg :on-warnings :accessor operation-on-warnings 759 :initform *compile-file-warnings-behaviour*) 760 (on-failure :initarg :on-failure :accessor operation-on-failure 761 :initform *compile-file-failure-behaviour*))) 762 763 (defmethod perform :before ((operation compile-op) (c source-file)) 764 (map nil #'ensure-directories-exist (output-files operation c))) 765 766 (defmethod perform :after ((operation operation) (c component)) 767 (setf (gethash (type-of operation) (component-operation-times c)) 768 (get-universal-time)) 769 (load-preferences c operation)) 770 771 ;;; perform is required to check output-files to find out where to put 772 ;;; its answers, in case it has been overridden for site policy 773 (defmethod perform ((operation compile-op) (c cl-source-file)) 774 #-:broken-fasl-loader 775 (let ((source-file (component-pathname c)) 776 (output-file (car (output-files operation c)))) 777 (multiple-value-bind (output warnings-p failure-p) 778 (compile-file source-file :output-file output-file) 779 (when warnings-p 780 (case (operation-on-warnings operation) 781 (:warn (warn 782 "~@<COMPILE-FILE warned while performing ~A on ~A.~@:>" 783 operation c)) 784 (:error (error 'compile-warned :component c :operation operation)) 785 (:ignore nil))) 786 (when failure-p 787 (case (operation-on-failure operation) 788 (:warn (warn 789 "~@<COMPILE-FILE failed while performing ~A on ~A.~@:>" 790 operation c)) 791 (:error (error 'compile-failed :component c :operation operation)) 792 (:ignore nil))) 793 (unless output 794 (error 'compile-error :component c :operation operation))))) 795 796 (defmethod output-files ((operation compile-op) (c cl-source-file)) 797 #-:broken-fasl-loader (list (compile-file-pathname (component-pathname c))) 798 #+:broken-fasl-loader (list (component-pathname c))) 799 800 (defmethod perform ((operation compile-op) (c static-file)) 801 nil) 802 803 (defmethod output-files ((operation compile-op) (c static-file)) 804 nil) 805 806 (defmethod input-files ((op compile-op) (c static-file)) 807 nil) 808 809 810 ;;; load-op 811 812 (defclass basic-load-op (operation) ()) 813 814 (defclass load-op (basic-load-op) ()) 815 816 (defmethod perform ((o load-op) (c cl-source-file)) 817 (mapcar #'load (input-files o c))) 818 819 (defmethod perform ((operation load-op) (c static-file)) 820 nil) 821 (defmethod operation-done-p ((operation load-op) (c static-file)) 822 t) 823 824 (defmethod output-files ((o operation) (c component)) 825 nil) 826 827 (defmethod component-depends-on ((operation load-op) (c component)) 828 (cons (list 'compile-op (component-name c)) 829 (call-next-method))) 830 831 ;;; load-source-op 832 833 (defclass load-source-op (basic-load-op) ()) 834 835 (defmethod perform ((o load-source-op) (c cl-source-file)) 836 (let ((source (component-pathname c))) 837 (setf (component-property c 'last-loaded-as-source) 838 (and (load source) 839 (get-universal-time))))) 840 841 (defmethod perform ((operation load-source-op) (c static-file)) 842 nil) 843 844 (defmethod output-files ((operation load-source-op) (c component)) 845 nil) 846 847 ;;; FIXME: we simply copy load-op's dependencies. this is Just Not Right. 848 (defmethod component-depends-on ((o load-source-op) (c component)) 849 (let ((what-would-load-op-do (cdr (assoc 'load-op 850 (slot-value c 'in-order-to))))) 851 (mapcar (lambda (dep) 852 (if (eq (car dep) 'load-op) 853 (cons 'load-source-op (cdr dep)) 854 dep)) 855 what-would-load-op-do))) 856 857 (defmethod operation-done-p ((o load-source-op) (c source-file)) 858 (if (or (not (component-property c 'last-loaded-as-source)) 859 (> (file-write-date (component-pathname c)) 860 (component-property c 'last-loaded-as-source))) 861 nil t)) 862 863 (defclass test-op (operation) ()) 864 865 (defmethod perform ((operation test-op) (c component)) 866 nil) 867 868 (defgeneric load-preferences (system operation) 869 (:documentation 870 "Called to load system preferences after <perform operation 871 system>. Typical uses are to set parameters that don't exist until 872 after the system has been loaded.")) 873 874 (defgeneric preference-file-for-system/operation (system operation) 875 (:documentation 876 "Returns the pathname of the preference file for this system. 877 Called by 'load-preferences to determine what file to load.")) 878 879 (defmethod load-preferences ((s t) (operation t)) 880 ;; do nothing 881 (values)) 882 883 (defmethod load-preferences ((s system) (operation basic-load-op)) 884 (let* ((*package* (find-package :common-lisp)) 885 (file (probe-file (preference-file-for-system/operation s operation)))) 886 (when file 887 (when *verbose-out* 888 (format *verbose-out* 889 "~&~@<; ~@;loading preferences for ~A/~(~A~) from ~A~@:>~%" 890 (component-name s) 891 (type-of operation) file)) 892 (load file)))) 893 894 (defmethod preference-file-for-system/operation ((system t) (operation t)) 895 ;; cope with anything other than systems 896 (preference-file-for-system/operation (find-system system t) operation)) 897 898 (defmethod preference-file-for-system/operation ((s system) (operation t)) 899 (let ((*default-pathname-defaults* 900 (make-pathname :name nil :type nil 901 :defaults *default-pathname-defaults*))) 902 (merge-pathnames 903 (make-pathname :name (component-name s) 904 :type "lisp" 905 :directory '(:relative ".asdf")) 906 (truename (user-homedir-pathname))))) 907 908 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 909 ;;; invoking operations 910 911 (defvar *operate-docstring* 912 "Operate does three things: 913 914 1. It creates an instance of `operation-class` using any keyword parameters 915 as initargs. 916 2. It finds the asdf-system specified by `system` (possibly loading 917 it from disk). 918 3. It then calls `traverse` with the operation and system as arguments 919 920 The traverse operation is wrapped in `with-compilation-unit` and error 921 handling code. If a `version` argument is supplied, then operate also 922 ensures that the system found satisfies it using the `version-satisfies` 923 method.") 924 925 (defun operate (operation-class system &rest args &key (verbose t) version 926 &allow-other-keys) 927 (let* ((op (apply #'make-instance operation-class 928 :original-initargs args 929 args)) 930 (*verbose-out* (if verbose *standard-output* (make-broadcast-stream))) 931 (system (if (typep system 'component) system (find-system system)))) 932 (unless (version-satisfies system version) 933 (error 'missing-component :requires system :version version)) 934 (let ((steps (traverse op system))) 935 (with-compilation-unit () 936 (loop for (op . component) in steps do 937 (loop 938 (restart-case 939 (progn (perform op component) 940 (return)) 941 (retry () 942 :report 943 (lambda (s) 944 (format s "~@<Retry performing ~S on ~S.~@:>" 945 op component))) 946 (accept () 947 :report 948 (lambda (s) 949 (format s "~@<Continue, treating ~S on ~S as ~ 950 having been successful.~@:>" 951 op component)) 952 (setf (gethash (type-of op) 953 (component-operation-times component)) 954 (get-universal-time)) 955 (return))))))))) 956 957 (setf (documentation 'operate 'function) 958 *operate-docstring*) 959 960 (defun oos (operation-class system &rest args &key force (verbose t) version) 961 (declare (ignore force verbose version)) 962 (apply #'operate operation-class system args)) 963 964 (setf (documentation 'oos 'function) 965 (format nil 966 "Short for _operate on system_ and an alias for the `operate` function. ~&~&~a" 967 *operate-docstring*)) 968 969 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 970 ;;; syntax 971 972 (defun remove-keyword (key arglist) 973 (labels ((aux (key arglist) 974 (cond ((null arglist) nil) 975 ((eq key (car arglist)) (cddr arglist)) 976 (t (cons (car arglist) (cons (cadr arglist) 977 (remove-keyword 978 key (cddr arglist)))))))) 979 (aux key arglist))) 980 981 (defmacro defsystem (name &body options) 982 (destructuring-bind (&key (pathname nil pathname-arg-p) (class 'system) 983 &allow-other-keys) 984 options 985 (let ((component-options (remove-keyword :class options))) 986 `(progn 987 ;; system must be registered before we parse the body, otherwise 988 ;; we recur when trying to find an existing system of the same name 989 ;; to reuse options (e.g. pathname) from 990 (let ((s (system-registered-p ',name))) 991 (cond ((and s (eq (type-of (cdr s)) ',class)) 992 (setf (car s) (get-universal-time))) 993 (s 994 #+clisp 995 (sysdef-error "Cannot redefine the existing system ~A with a different class" s) 996 #-clisp 997 (change-class (cdr s) ',class)) 998 (t 999 (register-system (quote ,name) 1000 (make-instance ',class :name ',name))))) 1001 (parse-component-form nil (apply 1002 #'list 1003 :module (coerce-name ',name) 1004 :pathname 1005 ;; to avoid a note about unreachable code 1006 ,(if pathname-arg-p 1007 pathname 1008 `(or (when *load-truename* 1009 (pathname-sans-name+type 1010 (resolve-symlinks 1011 *load-truename*))) 1012 *default-pathname-defaults*)) 1013 ',component-options)))))) 1014 1015 1016 (defun class-for-type (parent type) 1017 (let* ((extra-symbols (list (find-symbol (symbol-name type) *package*) 1018 (find-symbol (symbol-name type) 1019 (load-time-value 1020 (package-name :asdf))))) 1021 (class (dolist (symbol (if (keywordp type) 1022 extra-symbols 1023 (cons type extra-symbols))) 1024 (when (and symbol 1025 (find-class symbol nil) 1026 (subtypep symbol 'component)) 1027 (return (find-class symbol)))))) 1028 (or class 1029 (and (eq type :file) 1030 (or (module-default-component-class parent) 1031 (find-class 'cl-source-file))) 1032 (sysdef-error "~@<don't recognize component type ~A~@:>" type)))) 1033 1034 (defun maybe-add-tree (tree op1 op2 c) 1035 "Add the node C at /OP1/OP2 in TREE, unless it's there already. 1036 Returns the new tree (which probably shares structure with the old one)" 1037 (let ((first-op-tree (assoc op1 tree))) 1038 (if first-op-tree 1039 (progn 1040 (aif (assoc op2 (cdr first-op-tree)) 1041 (if (find c (cdr it)) 1042 nil 1043 (setf (cdr it) (cons c (cdr it)))) 1044 (setf (cdr first-op-tree) 1045 (acons op2 (list c) (cdr first-op-tree)))) 1046 tree) 1047 (acons op1 (list (list op2 c)) tree)))) 1048 1049 (defun union-of-dependencies (&rest deps) 1050 (let ((new-tree nil)) 1051 (dolist (dep deps) 1052 (dolist (op-tree dep) 1053 (dolist (op (cdr op-tree)) 1054 (dolist (c (cdr op)) 1055 (setf new-tree 1056 (maybe-add-tree new-tree (car op-tree) (car op) c)))))) 1057 new-tree)) 1058 1059 1060 (defun remove-keys (key-names args) 1061 (loop for ( name val ) on args by #'cddr 1062 unless (member (symbol-name name) key-names 1063 :key #'symbol-name :test 'equal) 1064 append (list name val))) 1065 1066 (defvar *serial-depends-on*) 1067 1068 (defun parse-component-form (parent options) 1069 1070 (destructuring-bind 1071 (type name &rest rest &key 1072 ;; the following list of keywords is reproduced below in the 1073 ;; remove-keys form. important to keep them in sync 1074 components pathname default-component-class 1075 perform explain output-files operation-done-p 1076 weakly-depends-on 1077 depends-on serial in-order-to 1078 ;; list ends 1079 &allow-other-keys) options 1080 (declare (ignorable perform explain output-files operation-done-p)) 1081 (check-component-input type name weakly-depends-on depends-on components in-order-to) 1082 1083 (when (and parent 1084 (find-component parent name) 1085 ;; ignore the same object when rereading the defsystem 1086 (not 1087 (typep (find-component parent name) 1088 (class-for-type parent type)))) 1089 (error 'duplicate-names :name name)) 1090 1091 (let* ((other-args (remove-keys 1092 '(components pathname default-component-class 1093 perform explain output-files operation-done-p 1094 weakly-depends-on 1095 depends-on serial in-order-to) 1096 rest)) 1097 (ret 1098 (or (find-component parent name) 1099 (make-instance (class-for-type parent type))))) 1100 (when weakly-depends-on 1101 (setf depends-on (append depends-on (remove-if (complement #'find-system) weakly-depends-on)))) 1102 (when (boundp '*serial-depends-on*) 1103 (setf depends-on 1104 (concatenate 'list *serial-depends-on* depends-on))) 1105 (apply #'reinitialize-instance ret 1106 :name (coerce-name name) 1107 :pathname pathname 1108 :parent parent 1109 other-args) 1110 (when (typep ret 'module) 1111 (setf (module-default-component-class ret) 1112 (or default-component-class 1113 (and (typep parent 'module) 1114 (module-default-component-class parent)))) 1115 (let ((*serial-depends-on* nil)) 1116 (setf (module-components ret) 1117 (loop for c-form in components 1118 for c = (parse-component-form ret c-form) 1119 collect c 1120 if serial 1121 do (push (component-name c) *serial-depends-on*)))) 1122 1123 ;; check for duplicate names 1124 (let ((name-hash (make-hash-table :test #'equal))) 1125 (loop for c in (module-components ret) 1126 do 1127 (if (gethash (component-name c) 1128 name-hash) 1129 (error 'duplicate-names 1130 :name (component-name c)) 1131 (setf (gethash (component-name c) 1132 name-hash) 1133 t))))) 1134 1135 (setf (slot-value ret 'in-order-to) 1136 (union-of-dependencies 1137 in-order-to 1138 `((compile-op (compile-op ,@depends-on)) 1139 (load-op (load-op ,@depends-on)))) 1140 (slot-value ret 'do-first) `((compile-op (load-op ,@depends-on)))) 1141 1142 (%remove-component-inline-methods ret rest) 1143 1144 ret))) 1145 1146 (defun %remove-component-inline-methods (ret rest) 1147 (loop for name in +asdf-methods+ 1148 do (map 'nil 1149 ;; this is inefficient as most of the stored 1150 ;; methods will not be for this particular gf n 1151 ;; But this is hardly performance-critical 1152 (lambda (m) 1153 (remove-method (symbol-function name) m)) 1154 (component-inline-methods ret))) 1155 ;; clear methods, then add the new ones 1156 (setf (component-inline-methods ret) nil) 1157 (loop for name in +asdf-methods+ 1158 for v = (getf rest (intern (symbol-name name) :keyword)) 1159 when v do 1160 (destructuring-bind (op qual (o c) &body body) v 1161 (pushnew 1162 (eval `(defmethod ,name ,qual ((,o ,op) (,c (eql ,ret))) 1163 ,@body)) 1164 (component-inline-methods ret))))) 1165 1166 (defun check-component-input (type name weakly-depends-on depends-on components in-order-to) 1167 "A partial test of the values of a component." 1168 (when weakly-depends-on (warn "We got one! XXXXX")) 1169 (unless (listp depends-on) 1170 (sysdef-error-component ":depends-on must be a list." 1171 type name depends-on)) 1172 (unless (listp weakly-depends-on) 1173 (sysdef-error-component ":weakly-depends-on must be a list." 1174 type name weakly-depends-on)) 1175 (unless (listp components) 1176 (sysdef-error-component ":components must be NIL or a list of components." 1177 type name components)) 1178 (unless (and (listp in-order-to) (listp (car in-order-to))) 1179 (sysdef-error-component ":in-order-to must be NIL or a list of components." 1180 type name in-order-to))) 1181 1182 (defun sysdef-error-component (msg type name value) 1183 (sysdef-error (concatenate 'string msg 1184 "~&The value specified for ~(~A~) ~A is ~W") 1185 type name value)) 1186 1187 (defun resolve-symlinks (path) 1188 #-allegro (truename path) 1189 #+allegro (excl:pathname-resolve-symbolic-links path) 1190 ) 1191 1192 ;;; optional extras 1193 1194 ;;; run-shell-command functions for other lisp implementations will be 1195 ;;; gratefully accepted, if they do the same thing. If the docstring 1196 ;;; is ambiguous, send a bug report 1197 1198 (defun run-shell-command (control-string &rest args) 1199 "Interpolate ARGS into CONTROL-STRING as if by FORMAT, and 1200 synchronously execute the result using a Bourne-compatible shell, with 1201 output to *VERBOSE-OUT*. Returns the shell's exit code." 1202 (let ((command (apply #'format nil control-string args))) 1203 (format *verbose-out* "; $ ~A~%" command) 1204 #+sbcl 1205 (sb-ext:process-exit-code 1206 (sb-ext:run-program 1207 #+win32 "sh" #-win32 "/bin/sh" 1208 (list "-c" command) 1209 #+win32 #+win32 :search t 1210 :input nil :output *verbose-out*)) 1211 1212 #+(or cmu scl) 1213 (ext:process-exit-code 1214 (ext:run-program 1215 "/bin/sh" 1216 (list "-c" command) 1217 :input nil :output *verbose-out*)) 1218 1219 #+allegro 1220 (excl:run-shell-command command :input nil :output *verbose-out*) 1221 1222 #+lispworks 1223 (system:call-system-showing-output 1224 command 1225 :shell-type "/bin/sh" 1226 :output-stream *verbose-out*) 1227 1228 #+clisp ;XXX not exactly *verbose-out*, I know 1229 (ext:run-shell-command command :output :terminal :wait t) 1230 1231 #+openmcl 1232 (nth-value 1 1233 (ccl:external-process-status 1234 (ccl:run-program "/bin/sh" (list "-c" command) 1235 :input nil :output *verbose-out* 1236 :wait t))) 1237 #+ecl ;; courtesy of Juan Jose Garcia Ripoll 1238 (si:system command) 1239 #-(or openmcl clisp lispworks allegro scl cmu sbcl ecl) 1240 (error "RUN-SHELL-PROGRAM not implemented for this Lisp") 1241 )) 1242 1243 1244 (defgeneric hyperdocumentation (package name doc-type)) 1245 (defmethod hyperdocumentation ((package symbol) name doc-type) 1246 (hyperdocumentation (find-package package) name doc-type)) 1247 1248 (defun hyperdoc (name doc-type) 1249 (hyperdocumentation (symbol-package name) name doc-type)) 1250 1251 (defun system-source-file (system-name) 1252 (let ((system (asdf:find-system system-name))) 1253 (make-pathname 1254 :type "asd" 1255 :name (asdf:component-name system) 1256 :defaults (asdf:component-relative-pathname system)))) 1257 1258 (defun system-source-directory (system-name) 1259 (make-pathname :name nil 1260 :type nil 1261 :defaults (system-source-file system-name))) 1262 1263 (defun system-relative-pathname (system pathname &key name type) 1264 (let ((directory (pathname-directory pathname))) 1265 (when (eq (car directory) :absolute) 1266 (setf (car directory) :relative)) 1267 (merge-pathnames 1268 (make-pathname :name (or name (pathname-name pathname)) 1269 :type (or type (pathname-type pathname)) 1270 :directory directory) 1271 (system-source-directory system)))) 1272 1273 1274 (pushnew :asdf *features*) 1275 1276 #+sbcl 1277 (eval-when (:compile-toplevel :load-toplevel :execute) 1278 (when (sb-ext:posix-getenv "SBCL_BUILDING_CONTRIB") 1279 (pushnew :sbcl-hooks-require *features*))) 1280 1281 #+(and sbcl sbcl-hooks-require) 1282 (progn 1283 (defun module-provide-asdf (name) 1284 (handler-bind ((style-warning #'muffle-warning)) 1285 (let* ((*verbose-out* (make-broadcast-stream)) 1286 (system (asdf:find-system name nil))) 1287 (when system 1288 (asdf:operate 'asdf:load-op name) 1289 t)))) 1290 1291 (defun contrib-sysdef-search (system) 1292 (let ((home (sb-ext:posix-getenv "SBCL_HOME"))) 1293 (when (and home (not (string= home ""))) 1294 (let* ((name (coerce-name system)) 1295 (home (truename home)) 1296 (contrib (merge-pathnames 1297 (make-pathname :directory `(:relative ,name) 1298 :name name 1299 :type "asd" 1300 :case :local 1301 :version :newest) 1302 home))) 1303 (probe-file contrib))))) 1304 1305 (pushnew 1306 '(let ((home (sb-ext:posix-getenv "SBCL_HOME"))) 1307 (when (and home (not (string= home ""))) 1308 (merge-pathnames "site-systems/" (truename home)))) 1309 *central-registry*) 1310 1311 (pushnew 1312 '(merge-pathnames ".sbcl/systems/" 1313 (user-homedir-pathname)) 1314 *central-registry*) 1315 1316 (pushnew 'module-provide-asdf sb-ext:*module-provider-functions*) 1317 (pushnew 'contrib-sysdef-search *system-definition-search-functions*)) 1318 1319 (provide 'asdf)
Note:
See TracChangeset
for help on using the changeset viewer.
