Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 135
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 135
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 187
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 188
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 189
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 194
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 195
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 196
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 197
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 241
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 264
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 269
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 275
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 285
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 286
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 296
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 297
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 298
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 308
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 309
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 310
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 311
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 321
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 322
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 323
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 324
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 325
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 497
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 527
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 540
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 587
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 626
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 668
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 668
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 670
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 673
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 682
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 688
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 693
Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 699
Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.http.php on line 410
Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.http.php on line 410
Warning: Cannot modify header information - headers already sent by (output started at /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php:309) in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.http.php on line 272
Warning: Cannot modify header information - headers already sent by (output started at /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php:309) in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.http.php on line 274
Warning: Cannot modify header information - headers already sent by (output started at /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php:309) in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.http.php on line 274
Warning: Cannot modify header information - headers already sent by (output started at /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php:309) in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.http.php on line 274
Warning: Cannot modify header information - headers already sent by (output started at /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php:309) in /home/didierve/didierverna.net/blog/inc/public/lib.urlhandlers.php on line 110
Warning: Cannot modify header information - headers already sent by (output started at /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php:309) in /home/didierve/didierverna.net/blog/inc/public/lib.urlhandlers.php on line 130
Warning: Cannot modify header information - headers already sent by (output started at /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php:309) in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.http.php on line 295 Didier Verna's Scientific Blog - Tag - ASDFDidier Verna's scientific blog: Lisp, Emacs, LaTeX and random stuff.2024-01-31T17:45:28+00:00Didier Vernaurn:md5:a22c53786aff986a2da4c770c233a8f9DotclearDeclt 2.1 "Jonathan Archer" is outurn:md5:14f228dcdb2b1b0feaf268d6dcdb523aTuesday, February 28 2017Tuesday, February 28 2017Didier VernaLispASDFCommon LispDecltdocumentationreference manualsrelease <p>I'm happy to announce the release of Declt 2.1 "Jonathan Archer".</p>
<p>New in this release:</p>
<ul>
<li>Handle recent change in SBCL's <code>SB-INT:INFO</code> API.</li>
<li>Handle list of contacts (strings) in ASDF systems author and maintainer slots.</li>
<li>Some backward-incompatible changes in the keyword arguments to the <code>DECLT</code> function.</li>
<li>More hyperlinks between systems and source files.</li>
<li>More robust system's packages collection (no more code walking).</li>
<li>More robust handling of unavailable ASDF components.</li>
<li>More robust naming of cross-references.</li>
</ul>
<p>Find it at the usual <a href="https://www.lrde.epita.fr/~didier/software/lisp/misc.php#declt">place</a>...</p>https://www.didierverna.net/blog/index.php?post/2017/02/28/Declt-2.1-Jonathan-Archer-is-out#comment-formhttps://www.didierverna.net/blog/index.php?feed/navlang:en/atom/comments/150Declt 2.0.1 "Benjamin Sisko" is outurn:md5:0c5f5b9f5ab65da29b5d73d88e331b6aWednesday, November 4 2015Wednesday, November 4 2015Didier VernaLispASDFCommon LispDecltdocumentationreference manualsrelease <p>Declt 2.0.1 "Benjamin Sisko" is out. This is a bugfix release with one internal change (a special variable was not following the earmuffs convention) and one actual bugfix (the same Texinfo anchor was generated for symbols with the same name but in different packages).</p>
<p>Find it at the usual <a href="https://www.lrde.epita.fr/~didier/software/lisp/misc.php#declt">place</a>...</p>https://www.didierverna.net/blog/index.php?post/2015/11/04/Declt-2.0.1-Benjamin-Sisko-is-out#comment-formhttps://www.didierverna.net/blog/index.php?feed/navlang:en/atom/comments/144ASDF-FLV 2.0urn:md5:86c9e018615bed99c9798f4c92c57eaaMonday, October 12 2015Monday, October 12 2015Didier VernaLispASDFASDF-FLVCommon Lisprelease <p>I've just released version 2.0 of <a href="https://www.lrde.epita.fr/~didier/software/lisp/misc.php#asdf-flv">ASDF-FLV</a>, my ASDF extension for supporting file-local variables (ala <code>*PACKAGE*</code>). The code hasn't changed, but as for my other libraries, the system and package names are now prefixed with <code>net.didierverna</code>. ASDF-FLV is also available on <a href="https://github.com/didierverna/asdf-flv" hreflang="en">GitHub</a> now.</p>
<p>The reason I'm doing this now is that at least two of my other libraries are going to use it in a mandatory way, either directly or indirectly (and in turn, that's because no implementation has bothered to implement CDR #9 yet ;-).</p>https://www.didierverna.net/blog/index.php?post/2015/10/12/ASDF-FLV-2.0#comment-formhttps://www.didierverna.net/blog/index.php?feed/navlang:en/atom/comments/141Declt 2.0 is out -- IMPORTANTurn:md5:2f726f4c179437afc9ce519a7a68a6d8Monday, July 13 2015Monday, July 13 2015Didier VernaLispASDFCommon LispDecltdocumentationreference manualsrelease <p>Declt 2.0 "Kathryn Janeway" is out. This release doesn't contain any change in functionality, yet deserves a major version upgrade since it contains 3 important changes: an infrastructure revamp (along the lines of what <a href="https://www.lrde.epita.fr/~didier/software/lisp/clon.php">Clon</a> endured not so long ago), a license switch from the GNU GPL to a BSD one, and finally a system / package name change. The prefix is now <code>net.didierverna</code> instead of <code>com.dvlsoft</code>. Do I need to apologize for this again? :-)</p>
<p>Find it at the usual <a href="https://www.lrde.epita.fr/~didier/software/lisp/misc.php#declt">place</a>...</p>https://www.didierverna.net/blog/index.php?post/2015/07/13/Declt-2.0-is-out-IMPORTANT#comment-formhttps://www.didierverna.net/blog/index.php?feed/navlang:en/atom/comments/137Declt 1.1 is releasedurn:md5:cf66e12c7fba041f4e4b74a36ee51dd6Monday, June 29 2015Monday, June 29 2015Didier VernaLispASDFDecltdocumentationreference manualsrelease <p>Hello,</p>
<p>as promised last week, I've just released a new version of <a href="https://www.lrde.epita.fr/~didier/software/lisp/misc.php#declt">Declt</a>, my reference manual generator for ASDF systems. This new version (1.1) is now able to document <a href="https://www.lrde.epita.fr/~didier/software/lisp/clon.php">Clon</a> again (the documentation of which has been updated on the website).</p>
<p>New in this release:</p>
<ul>
<li>Declt now properly handles and documents complex system and component dependencies, such as <code>:feature</code> <code>:require</code> and <code>:version</code> statements,</li>
<li>Declt also documents a system's <code>:if-feature</code> if any.</li>
</ul>
<p>But the most important addition is the ability to document several ASDF systems in the same reference manual. More precisely, Declt now documents not only the main system but also all its subsystems. A subsystem is defined as a system on which the main one depends on in any way, and which is also part of the same distribution (under the same directory tree). Declt also understands multiple system definitions from the same <code>.asd</code> file.</p>
<p>Enjoy!</p>https://www.didierverna.net/blog/index.php?post/2015/06/29/Declt-1.1-is-released#comment-formhttps://www.didierverna.net/blog/index.php?feed/navlang:en/atom/comments/136Clon 1.0b24 is released -- IMPORTANTurn:md5:efb97aca5f803ced4a026b87bec25b32Thursday, June 25 2015Thursday, June 25 2015Didier VernaLispASDFClonDecltrelease <p>Hello,</p>
<p>I'm happy to announce the release of the next beta version of <a href="https://www.lrde.epita.fr/~didier/software/lisp/clon.php">Clon</a>, the Common Lisp / Command Line Options Nuker library. This release doesn't contain much change in terms of functionality, but it contains a lot of change in terms of infrastructure, plus very important and backward-incompatible modifications. So if you're a Clon user, please read on.</p>
<p>First of all, a huge revamp of the library's infrastructure (package hierarchy, ASDF and Make implementations) occurred. A large portion of this work is actually not mine, but Fare's (big thanks to him, 'cause the level of ASDF expertise required just means that I couldn't have done that by myself). The purpose here was twofold: first, remove all logic from the ASDF files (so that other system managers could be used; not sure that's actually useful right now) and second, split the library in two: the core, basic functionality and the non-standard platform-dependent bells and whistles (read: termio support). The result is that Clon now comes with 4 different ASDF systems! A setup system allows you to configure some stuff prior to loading the library, a core system allows you to load only the basic functionality and the regular one loads everything, autodetecting platform-dependent features as before. The fourth system is auxiliary and not to be used by hand. All of this is properly documented. For a code maniac like me, this new infrastructure is much more satisfactory, and I've learned a lot about ASDF less known features.</p>
<p>Next, I've moved the repository to <a href="https://github.com/didierverna/clon" hreflang="en">Github</a>. Please update your links! It seems that I've lost all my former tags in the process, but oh well...Only the Git repo has moved. The main Clon web page still contains the full history of tarballs, the preformatted documentation, and will continue to do so in the future.</p>
<p>Finally (I've kept this to myself until the last possible minute because I'm scared like hell to tell): I've changed the systems and packages names... The <code>com.dvlsoft</code> prefix has been replaced with <code>net.didierverna</code>. All other libraries of mine will eventually endure the same surgery. It's for the best, I apologize for it and I swear I will never ever do that again, EVER (fingers crossed behind my back).</p>
<p>So what's next? Before considering an official 1.0 release, there are two things that I want to do. First, cleanup some remaining Fixmes and some shaky error handling. Second, provide an even simpler way of using Clon than what the Quick Start chapter in the doc demonstrates. The idea is to just implement a <code>main</code> function with keyword arguments, and those argument magically become command-line options.</p>
<p>A side-effect of this work is that <a href="https://www.lrde.epita.fr/~didier/software/lisp/misc.php#declt">Declt</a> now chokes on Clon, because some ASDF features that it doesn't understand are in use. So Declt has a couple of new challenges ahead, and you should expect a new release in the weeks to come.</p>https://www.didierverna.net/blog/index.php?post/2015/06/25/Clon-1.0b24-is-released-IMPORTANT#comment-formhttps://www.didierverna.net/blog/index.php?feed/navlang:en/atom/comments/135Declt 1.0b12 is outurn:md5:f84bd63cbacdbf6ae2f09763f8bca49bWednesday, June 29 2011Wednesday, June 29 2011Didier VernaLispASDFCommon LispDecltdocumentationreleasesoftwareTexinfo <p>I've just released the next version of Declt, my reference manual generator for ASDF systems.</p>
<p>This release includes some fixes for the Info format target but most notably, support for documenting (generic) writer functions and methods. When it makes sense, the documentations for <code>func</code> and <code>(setf func)</code> are grouped together. Getting closer to an official 1.0 stable version...</p>
<p>Grab it <a href="http://www.lrde.epita.fr/~didier/software/lisp/misc.php#declt">here</a>, and enjoy!</p>https://www.didierverna.net/blog/index.php?post/2011/06/29/Declt-1.0b12-is-out#comment-formhttps://www.didierverna.net/blog/index.php?feed/navlang:en/atom/comments/86Declt 1.0b11 is outurn:md5:67f641ec65f442cf39670f9c41520eb0Tuesday, May 31 2011Tuesday, May 31 2011Didier VernaLispASDFCommon LispDecltdocumentationreleasesoftwareTexinfo <p>I've just released a new version of Declt, my Texinfo reference manual generator for ASDF systems. This release contains only one bugfix: when trying to create links to source files, Declt now checks whether the files actually exist or not.</p>
<p>Tracking this bug down had the side-effect of exhibiting a misfeature of SBCL's introspection facility: the <code>COPY-<struct></code> functions (automatically generated by <code>defstruct</code> calls) have their definition source set to <code>target-defstruct.lisp</code> which is an SBCL source file. It would make more sense to set it to the file containing the <code>defstruct</code> call instead, as is already the case for constructors, predicates and accessor functions. Patch sent to the SBCL developers.</p>https://www.didierverna.net/blog/index.php?post/2011/05/31/Declt-1.0b11-is-out#comment-formhttps://www.didierverna.net/blog/index.php?feed/navlang:en/atom/comments/84ASDF-FLV and a new CDR proposalurn:md5:977809fe61757569a6c69ab6b6e0e0a4Tuesday, April 26 2011Tuesday, April 26 2011Didier VernaLispASDFCDRCommon Lisp Standard <p><strong>UPDATE:</strong> the CDR proposal corresponding to this blog is now finalized. It can be referred to as CDR #9.</p>
<p>In my <a href="http://www.european-lisp-symposium.org">ELS</a> 2011 lightning talk, I announced the development of a new Common Lisp library called XFormat, which provides extensible format strings. A first release of this library is imminent. In this talk, I also mentionned the need for what I called "file-local variables". A file-local variable is a user-defined special variable that would behave as <code>*PACKAGE*</code> and <code>*READTABLE*</code> with respect to <code>*LOAD*</code> and <code>*COMPILE-FILE*</code>.</p>
<p>I have just created and released a very small library called <a href="http://www.lrde.epita.fr/~didier/software/lisp/misc.php#asdf-flv">ASDF-FLV</a> which provides file-local variables through ASDF. In an ideal world, this library would become obsolete because file-local variables are so simple to implement that they should rather be done as an extension to the Common Lisp Standard, and provided by every Lisp vendor. That is the purpose of a new CDR proposal that I also just published on the discussion mailing list. This proposal is attached below for reference (update: it is now the final version).</p>https://www.didierverna.net/blog/index.php?post/2011/04/26/ASDF-FLV-and-a-new-CDR-proposal#comment-formhttps://www.didierverna.net/blog/index.php?feed/navlang:en/atom/comments/78Optional ASDF system dependencies (Clon v1.0b18)urn:md5:5b7d7e58f9f06b1ad72bbcd8ca04d576Tuesday, January 25 2011Tuesday, January 25 2011Didier VernaLispASDFClonreleasesoftware <p><a href="http://www.lrde.epita.fr/~didier/software/lisp/clon.php">Clon</a> v1.0b18 is now out. Compared to the previous version, the only small bit of change is the fact that the CLISP implementation now depends only <em>optionally</em> on cffi, whereas that dependency was mandatory before. Doing this is actually quite simple but raised the question of optional ASDF system dependencies, a topic on which there's quite a bit to be said.</p>
<p>A bit of context first. Clon has a terminal autodetection feature which allows it to automatically highlight its output on a tty (see <code>--clon-highlight=auto</code>) and also compute the output line width in case the COLUNMS environment variable is not set. This feature requires an <code>ioctl</code> call which is beyond Lisp. Since one of my goals is to have as few dependencies as possible (zero being the ideal number), I looked at compiler-specific solutions to this problem. The result is that SBCL, CMU-CL, CCL and ECL provide solutions almost out-of-the-box: SBCL has a grovel contributed module, CMU-CL and CCL already have system bindings and ECL has its own <code>ffi</code> interface. The ABCL port doesn't support terminal autodetection yet, but that's another (Java) story. The only black sheep in the picture is CLISP which, as far as I can tell, neither has a native binding for <code>ioctl</code>, nore any built-in grovel facility, hence the need for <code>cffi</code>.</p>
<p>Previously, my system definition file was like that:</p>
<pre class="lisp lisp" style="font-family:inherit">#+clisp <span style="color: #66cc66;">(</span>asdf<span style="color: #66cc66;">:</span><span style="color: #555;">operate</span> 'asdf<span style="color: #66cc66;">:</span><span style="color: #555;">load-op</span> <span style="color: #66cc66;">:</span><span style="color: #555;">cffi-grovel</span><span style="color: #66cc66;">)</span>
<span style="color: #66cc66;">(</span>asdf<span style="color: #66cc66;">:</span><span style="color: #555;">defsystem</span> <span style="color: #66cc66;">:</span><span style="color: #555;">com</span><span style="color: #66cc66;">.</span>dvlsoft<span style="color: #66cc66;">.</span>clon
#<span style="color: #66cc66;">|</span> <span style="color: #66cc66;">...</span> <span style="color: #66cc66;">|</span>#
<span style="color: #66cc66;">:</span><span style="color: #555;">depends-on</span> <span style="color: #66cc66;">(</span>#+clisp <span style="color: #66cc66;">:</span><span style="color: #555;">cffi</span><span style="color: #66cc66;">)</span>
<span style="color: #66cc66;">:</span><span style="color: #555;">components</span> <span style="color: #66cc66;">(</span><span style="color: #66cc66;">(</span><span style="color: #66cc66;">:</span><span style="color: #555;">file</span> <span style="color: #ff0000;">"package"</span><span style="color: #66cc66;">)</span>
#+clisp
<span style="color: #66cc66;">(</span><span style="color: #66cc66;">:</span><span style="color: #555;">module</span> <span style="color: #ff0000;">"clisp"</span>
<span style="color: #66cc66;">:</span><span style="color: #555;">depends-on</span> <span style="color: #66cc66;">(</span><span style="color: #ff0000;">"package"</span><span style="color: #66cc66;">)</span>
<span style="color: #66cc66;">:</span><span style="color: #555;">components</span> <span style="color: #66cc66;">(</span><span style="color: #66cc66;">(</span>cffi-grovel<span style="color: #66cc66;">:</span><span style="color: #555;">grovel-file</span> <span style="color: #ff0000;">"constants"</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span>
<span style="color: #66cc66;">(</span>module <span style="color: #ff0000;">"src"</span>
<span style="color: #66cc66;">:</span><span style="color: #555;">depends-on</span> <span style="color: #66cc66;">(</span><span style="color: #ff0000;">"package"</span> #+clisp <span style="color: #ff0000;">"clisp"</span><span style="color: #66cc66;">)</span>
<span style="color: #66cc66;">:</span><span style="color: #555;">components</span> #<span style="color: #66cc66;">|</span> <span style="color: #66cc66;">...</span> <span style="color: #66cc66;">|</span>#<span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span></pre>
<p>And then later, I had a file with the concerned utility function:</p>
<pre class="lisp lisp" style="font-family:inherit"><span style="color: #66cc66;">(</span><span style="color: #b1b100;">defun</span> stream-line-width <span style="color: #66cc66;">(</span>stream<span style="color: #66cc66;">)</span>
#+clisp <span style="color: #66cc66;">(</span>#<span style="color: #66cc66;">|</span> CLISP implementation <span style="color: #66cc66;">|</span>#<span style="color: #66cc66;">)</span>
#<span style="color: #66cc66;">|</span> etc<span style="color: #66cc66;">.</span> <span style="color: #66cc66;">|</span>#<span style="color: #66cc66;">)</span></pre>
<p>After that, I started looking at ways to make the dependency on cffi optional. After all, it makes sense to avoid that dependency at the cost of not being able to autodetect terminals.</p>
<p>One thing I fell on almost by accident is ASDF's <code>:weakly-depends-on</code> keyword. Here is an interesting <a href="http://www.mail-archive.com/asdf-devel@common-lisp.net/msg01405.html">thread</a> about it. It was an accident because that feature is <a href="https://bugs.launchpad.net/asdf/+bug/665110">not documented</a> :-( People, however, have very mitigated feelings about it, as shown in <a href="http://www.mail-archive.com/asdf-devel@common-lisp.net/msg00095.html">this</a> other thread (syntax and semantics both appear somewhat shaky and underspecified). Besides, the aparent behavior is that if A weakly depends on B and B is not present, then A is operated anyway. So I could probably have my "src" module weakly depend on the "clisp" one, but that doesn't change the fact the "clisp" module should <strong>not</strong> be included at all if cffi is not there.</p>
<p>In the same thread, somebody proposes another kind of dependency called <code>:contigent-on</code> which looks closer to what I would need for the "clisp" module: a module the contingency of which is not present will <strong>not</strong> be processed. This new kind of dependency doesn't seem to be implemented yet, however.</p>
<p>So, all of this seems a bit frightening. Too borderline for my taste. Fortunately, my solution is much simpler, although probably not universal.</p>
<p>This first thing to do is <em>only</em> attempt to load cffi-grovel:</p>
<pre class="lisp lisp" style="font-family:inherit"><span style="color: #66cc66;">(</span>eval-<span style="color: #b1b100;">when</span> <span style="color: #66cc66;">(</span><span style="color: #66cc66;">:</span><span style="color: #555;">load-toplevel</span> <span style="color: #66cc66;">:</span><span style="color: #555;">execute</span><span style="color: #66cc66;">)</span>
#+clisp <span style="color: #66cc66;">(</span>handler-<span style="color: #b1b100;">case</span> <span style="color: #66cc66;">(</span>asdf<span style="color: #66cc66;">:</span><span style="color: #555;">operate</span> 'asdf<span style="color: #66cc66;">:</span><span style="color: #555;">load-op</span> <span style="color: #66cc66;">:</span><span style="color: #555;">cffi-grovel</span><span style="color: #66cc66;">)</span>
<span style="color: #66cc66;">(</span>asdf<span style="color: #66cc66;">:</span><span style="color: #555;">missing-component</span> <span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>
<span style="color: #66cc66;">(</span>format *error-output* <span style="color: #ff0000;">"~
*********************************************************************
* WARNING: ASDF component CFFI-GROVEL not found.
* Clon will be loaded without support for terminal autodetection.
* See section A.1 of the user manual for more information.
*********************************************************************"</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span></pre>
<p>After that, if loading it were successful, we end up with <code>cffi</code> as a feature, so we can just conditionalize on that:</p>
<pre class="lisp lisp" style="font-family:inherit"><span style="color: #66cc66;">(</span>asdf<span style="color: #66cc66;">:</span><span style="color: #555;">defsystem</span> <span style="color: #66cc66;">:</span><span style="color: #555;">com</span><span style="color: #66cc66;">.</span>dvlsoft<span style="color: #66cc66;">.</span>clon
#<span style="color: #66cc66;">|</span> <span style="color: #66cc66;">...</span> <span style="color: #66cc66;">|</span>#
<span style="color: #66cc66;">:</span><span style="color: #555;">depends-on</span> <span style="color: #66cc66;">(</span>#+<span style="color: #66cc66;">(</span><span style="color: #b1b100;">and</span> clisp cffi<span style="color: #66cc66;">)</span> <span style="color: #66cc66;">:</span><span style="color: #555;">cffi</span><span style="color: #66cc66;">)</span>
<span style="color: #66cc66;">:</span><span style="color: #555;">components</span> <span style="color: #66cc66;">(</span><span style="color: #66cc66;">(</span><span style="color: #66cc66;">:</span><span style="color: #555;">file</span> <span style="color: #ff0000;">"package"</span><span style="color: #66cc66;">)</span>
#+<span style="color: #66cc66;">(</span><span style="color: #b1b100;">and</span> clisp cffi<span style="color: #66cc66;">)</span>
<span style="color: #66cc66;">(</span><span style="color: #66cc66;">:</span><span style="color: #555;">module</span> <span style="color: #ff0000;">"clisp"</span>
<span style="color: #66cc66;">:</span><span style="color: #555;">depends-on</span> <span style="color: #66cc66;">(</span><span style="color: #ff0000;">"package"</span><span style="color: #66cc66;">)</span>
<span style="color: #66cc66;">:</span><span style="color: #555;">serial</span> t
<span style="color: #66cc66;">:</span><span style="color: #555;">components</span> <span style="color: #66cc66;">(</span><span style="color: #66cc66;">(</span>cffi-grovel<span style="color: #66cc66;">:</span><span style="color: #555;">grovel-file</span> <span style="color: #ff0000;">"constants"</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span>
<span style="color: #66cc66;">(</span>module <span style="color: #ff0000;">"src"</span>
<span style="color: #66cc66;">:</span><span style="color: #555;">depends-on</span> <span style="color: #66cc66;">(</span><span style="color: #ff0000;">"package"</span> #+<span style="color: #66cc66;">(</span><span style="color: #b1b100;">and</span> clisp cffi<span style="color: #66cc66;">)</span> <span style="color: #ff0000;">"clisp"</span><span style="color: #66cc66;">)</span>
<span style="color: #66cc66;">:</span><span style="color: #555;">components</span> #<span style="color: #66cc66;">|</span> <span style="color: #66cc66;">...</span> <span style="color: #66cc66;">|</span>#<span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span></pre>
<p>One last problem remains however: what to do in the source code, for the feature-dependent parts. Conditionalizing an ASDF system may indeed lead to trouble: for instance, what would happen if the function <code>stream-line-width</code> was compiled with cffi around, and later used in a context where it is not? To be on the safe side, what you really need is to <em>dynamically</em> check for the feature. One possible solution is this:</p>
<ol>
<li>move all feature-dependent code to the "clisp" module and make that a protocol,</li>
<li>everytime you need to access the feature, dynamically check whether the protocol functions are <code>fbound</code>.</li>
</ol>
<p>In my specific case, what I did was to implement a CLISP-specific version of <code>stream-line-width</code>, called <code>clisp/stream-line-width</code> and put it in a new file in the "clisp" module, now defined as follows:</p>
<pre class="lisp lisp" style="font-family:inherit">#+<span style="color: #66cc66;">(</span><span style="color: #b1b100;">and</span> clisp cffi<span style="color: #66cc66;">)</span>
<span style="color: #66cc66;">(</span><span style="color: #66cc66;">:</span><span style="color: #555;">module</span> <span style="color: #ff0000;">"clisp"</span>
<span style="color: #66cc66;">:</span><span style="color: #555;">depends-on</span> <span style="color: #66cc66;">(</span><span style="color: #ff0000;">"package"</span><span style="color: #66cc66;">)</span>
<span style="color: #66cc66;">:</span><span style="color: #555;">serial</span> t
<span style="color: #66cc66;">:</span><span style="color: #555;">components</span> <span style="color: #66cc66;">(</span><span style="color: #66cc66;">(</span>cffi-grovel<span style="color: #66cc66;">:</span><span style="color: #555;">grovel-file</span> <span style="color: #ff0000;">"constants"</span><span style="color: #66cc66;">)</span>
<span style="color: #66cc66;">(</span><span style="color: #66cc66;">:</span><span style="color: #555;">file</span> <span style="color: #ff0000;">"util"</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span></pre>
<p>Then, the original function is rewritten like this:</p>
<pre class="lisp lisp" style="font-family:inherit"><span style="color: #66cc66;">(</span><span style="color: #b1b100;">defun</span> stream-line-width <span style="color: #66cc66;">(</span>stream<span style="color: #66cc66;">)</span>
#+clisp <span style="color: #66cc66;">(</span><span style="color: #b1b100;">when</span> <span style="color: #66cc66;">(</span>fboundp 'clisp/stream-line-width<span style="color: #66cc66;">)</span> <span style="color: #66cc66;">(</span>clisp/stream-line-width stream<span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span>
#<span style="color: #66cc66;">|</span> etc<span style="color: #66cc66;">.</span> <span style="color: #66cc66;">|</span>#<span style="color: #66cc66;">)</span></pre>
<p>So now I think I'm on the safe side, and Clon has zero mandatory dependency again...</p>https://www.didierverna.net/blog/index.php?post/2011/01/25/Optional-system-dependencies-%28Clon-v1.0b18%29#comment-formhttps://www.didierverna.net/blog/index.php?feed/navlang:en/atom/comments/69