Corrected feed-to-full.lisp

Pascal J. Bourguignon [2015-10-24 09:37]
Corrected feed-to-full.lisp
Filename
com.informatimago.www/blog/feed-to-full.lisp
com.informatimago.www/blog/fullfeed.xml
diff --git a/com.informatimago.www/blog/feed-to-full.lisp b/com.informatimago.www/blog/feed-to-full.lisp
index ae9550c..9c79bbd 100644
--- a/com.informatimago.www/blog/feed-to-full.lisp
+++ b/com.informatimago.www/blog/feed-to-full.lisp
@@ -109,7 +109,6 @@
                            (element-children entity))))))

 (defun unwrap (document)
-  (pprint document)
   (let* ((html        document)
          (head        (child-tagged html :head))
          (title       (element-child (child-tagged head :title)))
@@ -120,7 +119,7 @@
                           (value-of-attribute-named html :xml\:lang)
                           "en"))
          (class       "document")
-         (document    (pprint (remove-comments (pprint (first (grandchildren-tagged-and-valued html "div" "class" class))))))
+         (document    (remove-comments (first (grandchildren-tagged-and-valued html "div" "class" class))))
          (id          (value-of-attribute-named document :id)))
     (declare (ignore id))
     (values title author description keywords language document)))
@@ -162,7 +161,7 @@
          (author      (xmlrep-string-child (xmlrep-find-child-tag "author"      item)))
          (image-url   (xmlrep-attrib-value "url" (xmlrep-find-child-tag "enclosure" item)))
          (article     (get-resource link)))
-    (multiple-value-bind (title page-desc keywords language document) (unwrap article)
+    (multiple-value-bind (title page-author page-desc keywords language document) (unwrap article)
       (declare (ignore page-desc))
       (multiple-value-bind (author-name author-email) (split-email author)
         (let ((description
@@ -186,6 +185,7 @@
                                          ,document))
                                      out))
                                   out))))
+          (print description)
           `("item" ()
                    ("dc:identifier" () ,guid)
                    ("dc:creator"    () ,author)
diff --git a/com.informatimago.www/blog/fullfeed.xml b/com.informatimago.www/blog/fullfeed.xml
index 75424a3..cd38756 100644
--- a/com.informatimago.www/blog/fullfeed.xml
+++ b/com.informatimago.www/blog/fullfeed.xml
@@ -1,24 +1,524 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml-stylesheet type="text/xsl" href="css/feed.xsl"?>
-<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:og="http://ogp.me/ns#"><channel><atom:link rel="self" href="http://www.informatimago.comfull/blog"/><atom:link rel="alternate" title="Source URL" href="http://www.informatimago.com/blog"/><title>Informatimago</title><category>Programming</category><copyright>2015 Pascal J. Bourguignon</copyright><pubDate>Sun, 04 Oct 2015 16:45:27 +0200</pubDate><lastBuildDate>Sat, 24 Nov 2015 11:14:05 +0100</lastBuildDate><managingEditor>pjb+blog@informatimago.com (Pascal J. Bourguignon)</managingEditor><webMaster>pjb+blog@informatimago.com (Pascal J. Bourguignon)</webMaster><link>http://www.informatimago.com/blog</link><ttl>1440</ttl><description>Informatimago Lisp Programming</description><image><title>Informatimago</title><link>http://www.informatimago.com/blog</link><url>http://www.informatimago.com/images/informatimago.jpg</url></image><item><dc:identifier>http://www.informatimago.com/develop/lisp/com/informatimago/clext/pipe-article-en.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>common lisp,lisp,stream,pipe,gray streams,bordeaux-threads</dc:language><dc:format>text/html</dc:format><title>Stream Pipe</title><link>http://www.informatimago.com/develop/lisp/com/informatimago/clext/pipe-article-en.html</link><guid isPermaLink="true">http://www.informatimago.com/develop/lisp/com/informatimago/clext/pipe-article-en.html</guid><category>lisp</category><pubDate>Sun, 04 Oct 2015 16:45:27 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
+<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:og="http://ogp.me/ns#"><channel><atom:link rel="self" href="http://www.informatimago.comfull/blog"/><atom:link rel="alternate" title="Source URL" href="http://www.informatimago.com/blog"/><title>Informatimago</title><category>Programming</category><copyright>2015 Pascal J. Bourguignon</copyright><pubDate>Sun, 04 Oct 2015 16:45:27 +0200</pubDate><lastBuildDate>Sat, 24 Nov 2015 11:33:36 +0100</lastBuildDate><managingEditor>pjb+blog@informatimago.com (Pascal J. Bourguignon)</managingEditor><webMaster>pjb+blog@informatimago.com (Pascal J. Bourguignon)</webMaster><link>http://www.informatimago.com/blog</link><ttl>1440</ttl><description>Informatimago Lisp Programming</description><image><title>Informatimago</title><link>http://www.informatimago.com/blog</link><url>http://www.informatimago.com/images/informatimago.jpg</url></image><item><dc:identifier>http://www.informatimago.com/develop/lisp/com/informatimago/clext/pipe-article-en.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>en</dc:language><dc:format>text/html</dc:format><title>Stream Pipe</title><link>http://www.informatimago.com/develop/lisp/com/informatimago/clext/pipe-article-en.html</link><guid isPermaLink="true">http://www.informatimago.com/develop/lisp/com/informatimago/clext/pipe-article-en.html</guid><category>lisp</category><pubDate>Sun, 04 Oct 2015 16:45:27 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
 &amp;lt;div class=&amp;quot;header&amp;quot;&amp;gt;
 &amp;lt;img src=&amp;quot;http://www.informatimago.com/blog/pipe.jpg&amp;quot; height=&amp;quot;100px&amp;quot; class=&amp;quot;floatRight&amp;quot;&amp;gt;&amp;lt;/img&amp;gt;
 &amp;lt;h1&amp;gt;Stream Pipe&amp;lt;/h1&amp;gt;
 &amp;lt;p&amp;gt;A package implementing a unidirectional pipe using &amp;quot;BORDEAUX-THREADS&amp;quot; and &amp;quot;TRIVIAL-GRAY-STREAM&amp;quot;.&amp;lt;/p&amp;gt;
 &amp;lt;p&amp;gt;&amp;lt;small&amp;gt;&amp;lt;a href=&amp;quot;mailto:pjb+blog@informatimago.com&amp;quot;&amp;gt;Pascal J. Bourguignon&amp;lt;/a&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
-&amp;lt;p&amp;gt;&amp;lt;small&amp;gt;A Common Lisp package providing a buffered pipe with input and output streams.&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
+&amp;lt;p&amp;gt;&amp;lt;small&amp;gt;common lisp,lisp,stream,pipe,gray streams,bordeaux-threads&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
 &amp;lt;/div&amp;gt;
-en&amp;lt;/div&amp;gt;
-</description></item><item><dc:identifier>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/botihn/botihn-fr.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>common lisp,lisp,irc,bot,hacker news,drakma,cl-json,cl-irc,cesarum</dc:language><dc:format>text/html</dc:format><title>Botihn: un simple robot IRC pour surveiller Hacker News (FR)</title><link>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/botihn/botihn-fr.html</link><guid isPermaLink="true">http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/botihn/botihn-fr.html</guid><category>lisp</category><pubDate>Mon, 27 Apr 2015 12:00:00 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
+&amp;lt;div class=&amp;quot;document&amp;quot; id=&amp;quot;stream-pipe&amp;quot;&amp;gt;
+&amp;lt;h1 class=&amp;quot;title&amp;quot;&amp;gt;Stream Pipe&amp;lt;/h1&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;&amp;#226;&amp;#157;&amp;#161;&amp;lt;/p&amp;gt;
+&amp;lt;div class=&amp;quot;section&amp;quot; id=&amp;quot;id1&amp;quot;&amp;gt;
+&amp;lt;h1&amp;gt;Stream Pipe&amp;lt;/h1&amp;gt;
+&amp;lt;p&amp;gt;Here is a new package, &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;amp;quot;COM.INFORMATIMAGO.CLEXT.PIPE&amp;amp;quot;&amp;lt;/tt&amp;gt; that implements
+a unidirectional pipe using &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;&amp;amp;quot;BORDEAUX-THREADS&amp;amp;quot;&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; and &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;&amp;amp;quot;TRIVIAL-GRAY-STREAM&amp;amp;quot;&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;.&amp;lt;/p&amp;gt;
+&amp;lt;p&amp;gt;The data written to the &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;PIPE-OUTPUT-STREAM&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; is queued (if a maximum
+queue-size is specified for the stream, then the writing
+thread may block if the buffer is full).&amp;lt;/p&amp;gt;
+&amp;lt;p&amp;gt;The data queued can be read from the &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;PIPE-INPUT-STREAM&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;.  If the
+queue is empty, then the reading stream may block (unless it
+used &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;LISTEN&amp;lt;/tt&amp;gt;, &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;READ-CHAR-NO-HANG&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;, etc).&amp;lt;/p&amp;gt;
+&amp;lt;p&amp;gt;When the stream is closed, one can still read from it until
+the end of file is reached.&amp;lt;/p&amp;gt;
+&amp;lt;p&amp;gt;Multiple threads may read or write to the same pipe.&amp;lt;/p&amp;gt;
+&amp;lt;p&amp;gt;To demonstrate the use of pipes, the &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;amp;quot;COM.INFORMATIMAGO.CLEXT.FILTER&amp;amp;quot;&amp;lt;/tt&amp;gt;
+package exports a GREP function that processes &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;*STANDARD-INPUT*&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; and
+writes to &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;*STANDARD-OUTPUT*&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;, and a FILTER macro that builds a pipe
+chain of any number of forms, each running in its own thread (but the
+last one which runs in the calling thread).&amp;lt;/p&amp;gt;
+&amp;lt;p&amp;gt;It also provides a function IN that reads a text file and writes it to
+&amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;*STANDARD-OUTPUT*&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;, and a function OUT that reads &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;*STANDARD-INPUT*&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; and
+writes it to a file. (They correspond to the unix redirections &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;amp;lt;&amp;lt;/tt&amp;gt; &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;amp;gt;&amp;lt;/tt&amp;gt;
+and &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;amp;gt;&amp;amp;gt;&amp;lt;/tt&amp;gt;).&amp;lt;/p&amp;gt;
+&amp;lt;p&amp;gt;&amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;COM.INFORMATIAMGO.COMMON-LISP.INTERACTIVE.BROWSER:MORE&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; and &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;CAT&amp;lt;/tt&amp;gt;
+have been updated to read from &amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;*STANDARD-INPUT*&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; when no file is
+given, thus working as filters.&amp;lt;/p&amp;gt;
+&amp;lt;pre class=&amp;quot;literal-block&amp;quot;&amp;gt;
+user1&amp;amp;gt; (pprint (macroexpand-1 &#039;(filter (in #P&amp;amp;quot;~/tmp/misc/wang&amp;amp;quot;)
+                                       (grep &amp;amp;quot;LISP&amp;amp;quot; :line-number t)
+                                       (out &amp;amp;quot;/tmp/wl.txt&amp;amp;quot;))))
+
+(let ((#1=#:|pipe77885| (com.informatimago.clext.pipe:make-pipe
+                         :buffer-size com.informatimago.clext.filter::*buffer-size*)))
+  (bordeaux-threads:make-thread
+   (lambda nil
+     (unwind-protect
+          (filter (in #P&amp;amp;quot;/Users/pjb/tmp/misc/wang&amp;amp;quot;) (grep &amp;amp;quot;LISP&amp;amp;quot; :line-number t))
+       (close *standard-output*)))
+   :initial-bindings
+   (list (cons &#039;*standard-output* (com.informatimago.clext.pipe:pipe-output-stream #1#))
+         (cons &#039;*standard-input* *standard-input*)))
+  (let ((*standard-input* (com.informatimago.clext.pipe:pipe-input-stream #1#)))
+    (out &amp;amp;quot;/tmp/wl.txt&amp;amp;quot;)))
+
+; No value
+user1&amp;amp;gt;
+&amp;lt;/pre&amp;gt;
+&amp;lt;div class=&amp;quot;section&amp;quot; id=&amp;quot;example&amp;quot;&amp;gt;
+&amp;lt;h2&amp;gt;Example&amp;lt;/h2&amp;gt;
+&amp;lt;pre class=&amp;quot;literal-block&amp;quot;&amp;gt;
+cl-user&amp;amp;gt; (mkupack :use &#039;(&amp;amp;quot;COMMON-LISP&amp;amp;quot;
+                         &amp;amp;quot;COM.INFORMATIMAGO.COMMON-LISP.INTERACTIVE.BROWSER&amp;amp;quot;
+                         &amp;amp;quot;COM.INFORMATIMAGO.CLEXT.FILTER&amp;amp;quot;))
+#&amp;amp;lt;Package &amp;amp;quot;USER1&amp;amp;quot;&amp;amp;gt;
+user1&amp;amp;gt; (filter (in #P&amp;amp;quot;~/tmp/misc/wang&amp;amp;quot;))
+Hao Wang, logicien americain.
+
+L&#039;algorithme en  question  a  ete  publie  en  1960  dans l&#039;IBM Journal,
+article intitule &amp;amp;quot;Toward  Mechanical Mathematics&amp;amp;quot;, avec des variantes et
+une  extension au calcul  des  predicats.  Il  s&#039;agit  ici  du  &amp;amp;quot;premier
+programme&amp;amp;quot; de Wang, systeme &amp;amp;quot;P&amp;amp;quot;.
+
+L&#039;article a ete ecrit en 1958, et les experiences effectuees sur IBM 704
+- machine a lampes, 32 k  mots  de 36 bits, celle-la meme qui vit naitre
+LISP a la meme epoque. Le programme  a  ete ecrit en assembleur (Fortran
+existait, mais il ne s&#039;etait pas encore impose)  et  l&#039;auteur estime que
+&amp;amp;quot;there is very little in the program that is not straightforward&amp;amp;quot;.
+
+Il observe que les preuves engendrees sont &amp;amp;quot;essentiellement des arbres&amp;amp;quot;,
+et  annonce  que  la  machine  a  demontre 220 theoremes du  calcul  des
+propositions  (tautologies)  en  3  minutes. Il en tire argument pour la
+superiorite  d&#039;une  approche  algorithmique  par  rapport a une approche
+heuristique comme celle du &amp;amp;quot;Logic Theorist&amp;amp;quot; de Newell, Shaw et  Simon (a
+partir de 1956 sur la machine JOHNNIAC de la Rand Corporation): un debat
+qui dure encore...
+
+Cet  algorithme  a  ete popularise par J. McCarthy, comme exemple-fanion
+d&#039;application  de LISP. Il figure dans le manuel de la premiere  version
+de  LISP  (LISP  1,  sur IBM 704 justement, le manuel est date  de  Mars
+1960), et il a ete repris dans le celebre &amp;amp;quot;LISP 1.5 Programmer&#039;s Manual&amp;amp;quot;
+publie en 1962 par MIT Press, un des maitres-livres de l&#039;Informatique.
+
+
+
+nil
+user1&amp;amp;gt; (filter (in #P&amp;amp;quot;~/tmp/misc/wang&amp;amp;quot;) (grep &amp;amp;quot;LISP&amp;amp;quot;))
+LISP a la meme epoque. Le programme  a  ete ecrit en assembleur (Fortran
+d&#039;application  de LISP. Il figure dans le manuel de la premiere  version
+de  LISP  (LISP  1,  sur IBM 704 justement, le manuel est date  de  Mars
+1960), et il a ete repris dans le celebre &amp;amp;quot;LISP 1.5 Programmer&#039;s Manual&amp;amp;quot;
+nil
+user1&amp;amp;gt; (filter (in #P&amp;amp;quot;~/tmp/misc/wang&amp;amp;quot;) (grep &amp;amp;quot;program&amp;amp;quot; :case-insensitive t))
+programme&amp;amp;quot; de Wang, systeme &amp;amp;quot;P&amp;amp;quot;.
+LISP a la meme epoque. Le programme  a  ete ecrit en assembleur (Fortran
+&amp;amp;quot;there is very little in the program that is not straightforward&amp;amp;quot;.
+1960), et il a ete repris dans le celebre &amp;amp;quot;LISP 1.5 Programmer&#039;s Manual&amp;amp;quot;
+nil
+user1&amp;amp;gt; (filter (in #P&amp;amp;quot;~/tmp/misc/wang&amp;amp;quot;)
+               (grep &amp;amp;quot; &amp;amp;quot; :line-number t)
+               (let ((*terminal-height* 7)) (more)))
+1:Hao Wang, logicien americain.
+2:
+3:L&#039;algorithme en  question  a  ete  publie  en  1960  dans l&#039;IBM Journal,
+4:article intitule &amp;amp;quot;Toward  Mechanical Mathematics&amp;amp;quot;, avec des variantes et
+5:une  extension au calcul  des  predicats.  Il  s&#039;agit  ici  du  &amp;amp;quot;premier
+6:programme&amp;amp;quot; de Wang, systeme &amp;amp;quot;P&amp;amp;quot;.
+7:
+8:L&#039;article a ete ecrit en 1958, et les experiences effectuees sur IBM 704
+Type RETURN for next page:
+9:- machine a lampes, 32 k  mots  de 36 bits, celle-la meme qui vit naitre
+10:LISP a la meme epoque. Le programme  a  ete ecrit en assembleur (Fortran
+11:existait, mais il ne s&#039;etait pas encore impose)  et  l&#039;auteur estime que
+12:&amp;amp;quot;there is very little in the program that is not straightforward&amp;amp;quot;.
+13:
+14:Il observe que les preuves engendrees sont &amp;amp;quot;essentiellement des arbres&amp;amp;quot;,
+15:et  annonce  que  la  machine  a  demontre 220 theoremes du  calcul  des
+Type RETURN for next page:
+16:propositions  (tautologies)  en  3  minutes. Il en tire argument pour la
+17:superiorite  d&#039;une  approche  algorithmique  par  rapport a une approche
+18:heuristique comme celle du &amp;amp;quot;Logic Theorist&amp;amp;quot; de Newell, Shaw et  Simon (a
+19:partir de 1956 sur la machine JOHNNIAC de la Rand Corporation): un debat
+20:qui dure encore...
+21:
+22:Cet  algorithme  a  ete popularise par J. McCarthy, comme exemple-fanion
+Type RETURN for next page:
+23:d&#039;application  de LISP. Il figure dans le manuel de la premiere  version
+24:de  LISP  (LISP  1,  sur IBM 704 justement, le manuel est date  de  Mars
+25:1960), et il a ete repris dans le celebre &amp;amp;quot;LISP 1.5 Programmer&#039;s Manual&amp;amp;quot;
+26:publie en 1962 par MIT Press, un des maitres-livres de l&#039;Informatique.
+27:
+28:
+29:
+Type RETURN for next page:
+
+; No value
+user1&amp;amp;gt; (filter (in #P&amp;amp;quot;~/tmp/misc/wang&amp;amp;quot;) (grep &amp;amp;quot;LISP&amp;amp;quot; :line-number t) (out &amp;amp;quot;/tmp/wl.txt&amp;amp;quot;))
+nil
+user1&amp;amp;gt; (cat &amp;amp;quot;/tmp/wl.txt&amp;amp;quot;)
+10:LISP a la meme epoque. Le programme  a  ete ecrit en assembleur (Fortran
+23:d&#039;application  de LISP. Il figure dans le manuel de la premiere  version
+24:de  LISP  (LISP  1,  sur IBM 704 justement, le manuel est date  de  Mars
+25:1960), et il a ete repris dans le celebre &amp;amp;quot;LISP 1.5 Programmer&#039;s Manual&amp;amp;quot;
+; No value
+user1&amp;amp;gt;
+&amp;lt;/pre&amp;gt;
+&amp;lt;/div&amp;gt;
+&amp;lt;div class=&amp;quot;section&amp;quot; id=&amp;quot;sources&amp;quot;&amp;gt;
+&amp;lt;h2&amp;gt;Sources&amp;lt;/h2&amp;gt;
+&amp;lt;p&amp;gt;These new packages are available on gitlab and github; and they&#039;ll be
+distributed in &amp;lt;cite&amp;gt;quicklisp&amp;lt;/cite&amp;gt;.&amp;lt;/p&amp;gt;
+&amp;lt;pre class=&amp;quot;literal-block&amp;quot;&amp;gt;
+git clone https://gitlab.com/com-informatimago/com-informatimago.git informatimago
+&amp;lt;/pre&amp;gt;
+&amp;lt;p&amp;gt;&amp;lt;a class=&amp;quot;reference external&amp;quot; href=&amp;quot;http://www.informatimago.com/develop/lisp/index.html&amp;quot;&amp;gt;Informatimago Public Common Lisp Libraries&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;
+&amp;lt;/div&amp;gt;
+&amp;lt;/div&amp;gt;
+&amp;lt;/div&amp;gt;
+&amp;lt;/div&amp;gt;
+</description></item><item><dc:identifier>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/botihn/botihn-fr.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>en</dc:language><dc:format>text/html</dc:format><title>Botihn: un simple robot IRC pour surveiller Hacker News (FR)</title><link>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/botihn/botihn-fr.html</link><guid isPermaLink="true">http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/botihn/botihn-fr.html</guid><category>lisp</category><pubDate>Mon, 27 Apr 2015 12:00:00 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
 &amp;lt;div class=&amp;quot;header&amp;quot;&amp;gt;
 &amp;lt;img src=&amp;quot;http://www.informatimago.com/blog/botihn.png&amp;quot; height=&amp;quot;100px&amp;quot; class=&amp;quot;floatRight&amp;quot;&amp;gt;&amp;lt;/img&amp;gt;
 &amp;lt;h1&amp;gt;&amp;#195;&amp;#137;criture d&#039;un robot IRC simple&amp;lt;/h1&amp;gt;
 &amp;lt;p&amp;gt;&amp;#201;criture d&#039;un robot IRC simple.&amp;lt;/p&amp;gt;
 &amp;lt;p&amp;gt;&amp;lt;small&amp;gt;&amp;lt;a href=&amp;quot;mailto:pjb+blog@informatimago.com&amp;quot;&amp;gt;Pascal J. Bourguignon&amp;lt;/a&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
-&amp;lt;p&amp;gt;&amp;lt;small&amp;gt;Un robot IRC simple pour suivre Hacker News&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
+&amp;lt;p&amp;gt;&amp;lt;small&amp;gt;common lisp,lisp,irc,bot,hacker news,drakma,cl-json,cl-irc,cesarum&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
+&amp;lt;/div&amp;gt;
+&amp;lt;div class=&amp;quot;document&amp;quot; id=&amp;quot;ecriture-d-un-robot-irc-simple&amp;quot;&amp;gt;
+&amp;lt;h1 class=&amp;quot;title&amp;quot;&amp;gt;&amp;#195;&amp;#137;criture d&#039;un robot IRC simple&amp;lt;/h1&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;&amp;#226;&amp;#157;&amp;#161;&amp;lt;/p&amp;gt;
+&amp;lt;div class=&amp;quot;section&amp;quot; id=&amp;quot;id1&amp;quot;&amp;gt;
+&amp;lt;h1&amp;gt;&amp;#195;&amp;#137;criture d&#039;un robot IRC simple&amp;lt;/h1&amp;gt;
+&amp;lt;p&amp;gt;Pour soulager notre d&amp;#195;&amp;#169;pendence &amp;#195;&amp;#160; &amp;lt;em&amp;gt;Hacker News&amp;lt;/em&amp;gt;
+(&amp;lt;a class=&amp;quot;reference external&amp;quot; href=&amp;quot;http://news.ycombinator.com/newest&amp;quot;&amp;gt;http://news.ycombinator.com/newest&amp;lt;/a&amp;gt;), qui nous incite &amp;#195;&amp;#160; cliquer sur
+&amp;lt;em&amp;gt;Reload&amp;lt;/em&amp;gt; toutes les dix secondes, on va &amp;#195;&amp;#169;crire un &amp;lt;cite&amp;gt;ircbot&amp;lt;/cite&amp;gt;, un petit
+programme qui va aller chercher p&amp;#195;&amp;#169;riodiquement les nouveaux articles
+sur &amp;lt;em&amp;gt;Hacker News&amp;lt;/em&amp;gt;, et en transmettre le titre et l&#039;&amp;lt;cite&amp;gt;URL&amp;lt;/cite&amp;gt; sur un canal &amp;lt;cite&amp;gt;IRC&amp;lt;/cite&amp;gt;.&amp;lt;/p&amp;gt;
+&amp;lt;div class=&amp;quot;section&amp;quot; id=&amp;quot;dependences-systeme-asdf&amp;quot;&amp;gt;
+&amp;lt;h2&amp;gt;Dependences - Syst&amp;#195;&amp;#168;me &amp;lt;cite&amp;gt;ASDF&amp;lt;/cite&amp;gt;&amp;lt;/h2&amp;gt;
+&amp;lt;p&amp;gt;Ce programme est &amp;#195;&amp;#169;crit en &amp;lt;cite&amp;gt;Common Lisp&amp;lt;/cite&amp;gt; (cf. &amp;lt;a class=&amp;quot;reference external&amp;quot; href=&amp;quot;http://cliki.net/&amp;quot;&amp;gt;http://cliki.net/&amp;lt;/a&amp;gt;), en
+utilisant quelques biblioth&amp;#195;&amp;#168;ques:&amp;lt;/p&amp;gt;
+&amp;lt;ul class=&amp;quot;simple&amp;quot;&amp;gt;
+&amp;lt;li&amp;gt;&amp;lt;em&amp;gt;drakma&amp;lt;/em&amp;gt;, client &amp;lt;cite&amp;gt;HTTP&amp;lt;/cite&amp;gt;, va nous permettre d&#039;obtenir les donn&amp;#195;&amp;#169;es voulues;&amp;lt;/li&amp;gt;
+&amp;lt;li&amp;gt;&amp;lt;em&amp;gt;cl-json&amp;lt;/em&amp;gt; va nous permettre de d&amp;#195;&amp;#169;coder ces donn&amp;#195;&amp;#169;es au format &amp;lt;cite&amp;gt;JSON&amp;lt;/cite&amp;gt;,
+et d&#039;obtenir des structures Lisp;&amp;lt;/li&amp;gt;
+&amp;lt;li&amp;gt;&amp;lt;em&amp;gt;cl-irc&amp;lt;/em&amp;gt; va nous permettre de communiquer avec le serveur &amp;lt;cite&amp;gt;IRC&amp;lt;/cite&amp;gt;.&amp;lt;/li&amp;gt;
+&amp;lt;li&amp;gt;je vais aussi utiliser une fonctions de ma biblioth&amp;#195;&amp;#168;que
+&amp;lt;em&amp;gt;com.informatimago.common-lisp.cesarum&amp;lt;/em&amp;gt;.&amp;lt;/li&amp;gt;
+&amp;lt;/ul&amp;gt;
+&amp;lt;p&amp;gt;Ces biblioth&amp;#195;&amp;#168;ques sont obtenues, install&amp;#195;&amp;#169;es et compil&amp;#195;&amp;#169;es avec
+&amp;lt;em&amp;gt;quicklisp&amp;lt;/em&amp;gt; et &amp;lt;em&amp;gt;asdf&amp;lt;/em&amp;gt;.  Nous allons donc commencer par &amp;#195;&amp;#169;crire un
+syst&amp;#195;&amp;#168;me ASDF indiquant les d&amp;#195;&amp;#169;pendences de notre programme &amp;lt;cite&amp;gt;botihn&amp;lt;/cite&amp;gt; sur
+ces biblioth&amp;#195;&amp;#168;ques &amp;lt;cite&amp;gt;com.informatimago.small-cl-pgms.botihn.asd&amp;lt;/cite&amp;gt; :&amp;lt;/p&amp;gt;
+&amp;lt;pre class=&amp;quot;literal-block&amp;quot;&amp;gt;
+(asdf:defsystem &amp;amp;quot;com.informatimago.small-cl-pgms.botihn&amp;amp;quot;
+    :description &amp;amp;quot;An IRC bot monitoring Hacker News.&amp;amp;quot;
+    :author &amp;amp;quot;Pascal J. Bourguignon&amp;amp;quot;
+    :version &amp;amp;quot;1.0.0&amp;amp;quot;
+    :license &amp;amp;quot;AGPL3&amp;amp;quot;
+    :depends-on (&amp;amp;quot;com.informatimago.common-lisp.cesarum&amp;amp;quot;
+                 &amp;amp;quot;cl-irc&amp;amp;quot; &amp;amp;quot;cl-json&amp;amp;quot; &amp;amp;quot;drakma&amp;amp;quot;)
+    :components ((:file &amp;amp;quot;botihn&amp;amp;quot;)))
+&amp;lt;/pre&amp;gt;
+&amp;lt;/div&amp;gt;
+&amp;lt;div class=&amp;quot;section&amp;quot; id=&amp;quot;paquetage&amp;quot;&amp;gt;
+&amp;lt;h2&amp;gt;Paquetage&amp;lt;/h2&amp;gt;
+&amp;lt;p&amp;gt;Nous pouvons alors commencer &amp;#195;&amp;#160; programmer notre robot.  D&amp;#195;&amp;#169;finissons
+d&#039;abord le paquetage lisp.  Comme ce sera un petit programme, nous
+mettrons tout le code dans un seul fichier, &amp;lt;cite&amp;gt;botihn.lisp&amp;lt;/cite&amp;gt; :&amp;lt;/p&amp;gt;
+&amp;lt;pre class=&amp;quot;literal-block&amp;quot;&amp;gt;
+(defpackage &amp;amp;quot;COM.INFORMATIMAGO.SMALL-CL-PGMS.BOTIHN&amp;amp;quot;
+  (:use &amp;amp;quot;COMMON-LISP&amp;amp;quot; &amp;amp;quot;CL-IRC&amp;amp;quot; &amp;amp;quot;CL-JSON&amp;amp;quot; &amp;amp;quot;DRAKMA&amp;amp;quot;
+        &amp;amp;quot;COM.INFORMATIMAGO.COMMON-LISP.CESARUM.LIST&amp;amp;quot;)
+  (:export &amp;amp;quot;MAIN&amp;amp;quot;))
+(in-package &amp;amp;quot;COM.INFORMATIMAGO.SMALL-CL-PGMS.BOTIHN&amp;amp;quot;)
+&amp;lt;/pre&amp;gt;
+&amp;lt;/div&amp;gt;
+&amp;lt;div class=&amp;quot;section&amp;quot; id=&amp;quot;obtenir-les-informations-d-hacker-news&amp;quot;&amp;gt;
+&amp;lt;h2&amp;gt;Obtenir les informations d&#039;&amp;lt;em&amp;gt;Hacker News&amp;lt;/em&amp;gt;&amp;lt;/h2&amp;gt;
+&amp;lt;p&amp;gt;La premi&amp;#195;&amp;#168;re chose &amp;#195;&amp;#160; faire, est d&#039;obtenir les donn&amp;#195;&amp;#169;es.  Pour cel&amp;#195;&amp;#160;, nous
+consultons l&#039;&amp;lt;cite&amp;gt;API&amp;lt;/cite&amp;gt; indiqu&amp;#195;&amp;#169; en bas de la page d&#039;Hacker News,
+&amp;lt;a class=&amp;quot;reference external&amp;quot; href=&amp;quot;https://github.com/HackerNews/API&amp;quot;&amp;gt;https://github.com/HackerNews/API&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;
+&amp;lt;p&amp;gt;Nous allons utiliser l&#039;&amp;lt;cite&amp;gt;URL&amp;lt;/cite&amp;gt;:
+&amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;https://hacker-news.firebaseio.com/v0/newstories.json&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; pour obtenir
+les &amp;lt;cite&amp;gt;ID&amp;lt;/cite&amp;gt; des derni&amp;#195;&amp;#168;res nouvelles, et
+&amp;lt;tt class=&amp;quot;docutils literal&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;pre&amp;quot;&amp;gt;https://hacker-news.firebaseio.com/v0/item/ID.json&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; pour obtenir les
+informations sur une nouvelle identifi&amp;#195;&amp;#169;e par son ID.&amp;lt;/p&amp;gt;
+&amp;lt;p&amp;gt;Afin que les donn&amp;#195;&amp;#169;es envoy&amp;#195;&amp;#169;es par le serveur soient consid&amp;#195;&amp;#169;r&amp;#195;&amp;#169;es comme
+du texte par drakma, nous devrons lui indiquer que c&#039;est le cas pour
+un &amp;lt;cite&amp;gt;Content-Type&amp;lt;/cite&amp;gt; &amp;lt;cite&amp;gt;application/json&amp;lt;/cite&amp;gt; :&amp;lt;/p&amp;gt;
+&amp;lt;pre class=&amp;quot;literal-block&amp;quot;&amp;gt;
+(push &#039;(&amp;amp;quot;application&amp;amp;quot; . &amp;amp;quot;json&amp;amp;quot;) *text-content-types*)
+&amp;lt;/pre&amp;gt;
+&amp;lt;p&amp;gt;&amp;lt;cite&amp;gt;DRAKMA:HTTP-REQUEST&amp;lt;/cite&amp;gt; retourne plusieurs valeurs; la premi&amp;#195;&amp;#168;re est la
+resource obtenue; la deuxi&amp;#195;&amp;#168;me est le code status.  Nous ignorerons les
+autres valeurs.&amp;lt;/p&amp;gt;
+&amp;lt;pre class=&amp;quot;literal-block&amp;quot;&amp;gt;
+(http-request &amp;amp;quot;https://hacker-news.firebaseio.com/v0/newstories.json&amp;amp;quot;)
+--&amp;amp;gt; &amp;amp;quot;[9446519,9446509,9446505,&amp;#226;&amp;#128;&amp;#166;,9443212]&amp;amp;quot;
+    200
+    ((:content-length . &amp;amp;quot;4001&amp;amp;quot;)
+     (:strict-transport-security . &amp;amp;quot;max-age=31556926; includeSubDomains; preload&amp;amp;quot;)
+     (:content-type . &amp;amp;quot;application/json; charset=utf-8&amp;amp;quot;)
+     (:cache-control . &amp;amp;quot;no-cache&amp;amp;quot;))
+    #&amp;amp;lt;uri https://hacker-news.firebaseio.com/v0/newstories.json&amp;amp;gt;
+    #&amp;amp;lt;flexi-streams:flexi-io-stream #x302006213FED&amp;amp;gt;
+    t
+    &amp;amp;quot;OK&amp;amp;quot;
+&amp;lt;/pre&amp;gt;
+&amp;lt;p&amp;gt;Utilisons &amp;lt;cite&amp;gt;CL-JSON:DECODE-JSON-FROM-STRING&amp;lt;/cite&amp;gt; pour d&amp;#195;&amp;#169;coder le vecteur
+&amp;lt;cite&amp;gt;JSON&amp;lt;/cite&amp;gt; :&amp;lt;/p&amp;gt;
+&amp;lt;pre class=&amp;quot;literal-block&amp;quot;&amp;gt;
+(defun new-stories ()
+  (multiple-value-bind (value status)
+       (http-request &amp;amp;quot;https://hacker-news.firebaseio.com/v0/newstories.json&amp;amp;quot;)
+    (when (= 200 status)
+      (decode-json-from-string value))))
+
+(subseq (new-stories) 0 8)
+--&amp;amp;gt; (9446577 9446573 9446563 9446561 9446559 9446558 9446541 9446519)
+&amp;lt;/pre&amp;gt;
+&amp;lt;p&amp;gt;De fa&amp;#195;&amp;#167;on similaire, nous obtiendrons les informations sur une nouvelle
+identifi&amp;#195;&amp;#169;e :&amp;lt;/p&amp;gt;
+&amp;lt;pre class=&amp;quot;literal-block&amp;quot;&amp;gt;
+(defun story (id)
+  (multiple-value-bind (value status)
+      (http-request (format nil &amp;amp;quot;https://hacker-news.firebaseio.com/v0/item/~A.json&amp;amp;quot; id))
+    (when (= 200 status)
+      (decode-json-from-string value))))
+
+
+(story 9446577)
+--&amp;amp;gt; ((:by . &amp;amp;quot;antjanus&amp;amp;quot;)
+     (:descendants . 0)
+     (:id . 9446577)
+     (:score . 1)
+     (:text . &amp;amp;quot;&amp;amp;quot;)
+     (:time . 1430145589)
+     (:title . &amp;amp;quot;Ask HN: Where do you look for a job? Why do you pick those places to apply?&amp;amp;quot;)
+     (:type . &amp;amp;quot;story&amp;amp;quot;)
+     (:url . &amp;amp;quot;&amp;amp;quot;))
+&amp;lt;/pre&amp;gt;
+&amp;lt;p&amp;gt;Nous allons qu&amp;#195;&amp;#169;rir cette liste p&amp;#195;&amp;#169;riodiquement, et nous ne devons
+afficher que les nouvelles nouvelles.  Nous conserverons
+l&#039;identification de la derni&amp;#195;&amp;#168;re nouvelle dans une variable globale
+&amp;lt;em&amp;gt;*LAST-STORY*&amp;lt;/em&amp;gt; :&amp;lt;/p&amp;gt;
+&amp;lt;pre class=&amp;quot;literal-block&amp;quot;&amp;gt;
+(defvar *last-story* nil)
+&amp;lt;/pre&amp;gt;
+&amp;lt;p&amp;gt;Lorsque le programme d&amp;#195;&amp;#169;marre, &amp;lt;em&amp;gt;*LAST-STORY*&amp;lt;/em&amp;gt; sera &amp;lt;cite&amp;gt;NIL&amp;lt;/cite&amp;gt;, et alors
+nous n&#039;afficherons que la toute derni&amp;#195;&amp;#168;re nouvelle (tant pis pour les
+nouvelles manqu&amp;#195;&amp;#169;es pendant que le programme &amp;#195;&amp;#169;tait arr&amp;#195;&amp;#170;t&amp;#195;&amp;#169;).  Sinon,
+nous prenons toutes les nouvelles qui se trouvent dans la liste avant
+cette derni&amp;#195;&amp;#168;re nouvelle affich&amp;#195;&amp;#169;e, et nous renversons la liste pour
+l&#039;avoir dans l&#039;ordre chronologique.&amp;lt;/p&amp;gt;
+&amp;lt;pre class=&amp;quot;literal-block&amp;quot;&amp;gt;
+(defun get-new-stories ()
+  (let ((news (new-stories)))
+    (if *last-story*
+        (reverse (subseq news 0 (or (position *last-story* news) 1)))
+        (list (first news)))))
+&amp;lt;/pre&amp;gt;
+&amp;lt;p&amp;gt;Certaines de ces nouvelles n&#039;ont pas d&#039;&amp;lt;cite&amp;gt;URL&amp;lt;/cite&amp;gt;, mais contienent un texte
+sur leur page web sur &amp;lt;em&amp;gt;Hacker News&amp;lt;/em&amp;gt;.  Nous construisons l&#039;&amp;lt;cite&amp;gt;URL&amp;lt;/cite&amp;gt; de
+cette page avec la fonction suivante :&amp;lt;/p&amp;gt;
+&amp;lt;pre class=&amp;quot;literal-block&amp;quot;&amp;gt;
+(defun hn-url (story)
+  (format nil &amp;amp;quot;https://news.ycombinator.com/item?id=~A&amp;amp;quot; story))
+&amp;lt;/pre&amp;gt;
+&amp;lt;p&amp;gt;Et formattons le message pour une nouvelle ainsi :&amp;lt;/p&amp;gt;
+&amp;lt;pre class=&amp;quot;literal-block&amp;quot;&amp;gt;
+(defun format-story (story)
+  (let ((title  (aget story :title))
+        (url    (aget story :url))
+        (id     (aget story :id)))
+    (when (and title url)
+      (format nil &amp;amp;quot;~A &amp;amp;lt;~A&amp;amp;gt;&amp;amp;quot; title (if (zerop (length url))
+                                      (hn-url id)
+                                      url)))))
+&amp;lt;/pre&amp;gt;
+&amp;lt;p&amp;gt;Nous pouvons alors effectuer le traitement p&amp;#195;&amp;#169;riodique, consistant &amp;#195;&amp;#160;
+obtenir les derni&amp;#195;&amp;#168;res nouvelles, &amp;#195;&amp;#160; les formatter et &amp;#195;&amp;#160; les envoyer :&amp;lt;/p&amp;gt;
+&amp;lt;pre class=&amp;quot;literal-block&amp;quot;&amp;gt;
+(defun monitor-hacker-news (send)
+  (dolist (story (get-new-stories))
+    (let ((message (format-story (story story))))
+      (when message
+        (funcall send message))
+      (setf *last-story* story))))
+&amp;lt;/pre&amp;gt;
+&amp;lt;p&amp;gt;Nous rassemblons l&#039;initialisations dans une fonction :&amp;lt;/p&amp;gt;
+&amp;lt;pre class=&amp;quot;literal-block&amp;quot;&amp;gt;
+(defun monitor-initialize ()
+  (unless (find &#039;(&amp;amp;quot;application&amp;amp;quot; . &amp;amp;quot;json&amp;amp;quot;) *text-content-types*
+                :test (function equalp))
+    (push &#039;(&amp;amp;quot;application&amp;amp;quot; . &amp;amp;quot;json&amp;amp;quot;) *text-content-types*))
+  (setf *last-story* nil))
+&amp;lt;/pre&amp;gt;
+&amp;lt;/div&amp;gt;
+&amp;lt;div class=&amp;quot;section&amp;quot; id=&amp;quot;ecriture-du-client-irc&amp;quot;&amp;gt;
+&amp;lt;h2&amp;gt;&amp;#195;&amp;#137;criture du client &amp;lt;cite&amp;gt;IRC&amp;lt;/cite&amp;gt;&amp;lt;/h2&amp;gt;
+&amp;lt;p&amp;gt;Se connecter au serveur &amp;lt;cite&amp;gt;IRC&amp;lt;/cite&amp;gt; avec &amp;lt;cite&amp;gt;cl-irc&amp;lt;/cite&amp;gt; et joindre un canal est
+tr&amp;#195;&amp;#169;s simple :&amp;lt;/p&amp;gt;
+&amp;lt;pre class=&amp;quot;literal-block&amp;quot;&amp;gt;
+(defvar *connection* nil)
+(defvar *server*   &amp;amp;quot;irc.freenode.org&amp;amp;quot;)
+(defvar *nickname* &amp;amp;quot;botihn&amp;amp;quot;)
+(defvar *channel*  &amp;amp;quot;#hn&amp;amp;quot;)
+(defvar *period* 10 #|seconds|#)
+
+(setf *connection* (connect :nickname *nickname* :server *server*))
+(join *connection* *channel*)
+&amp;lt;/pre&amp;gt;
+&amp;lt;p&amp;gt;Nous pouvons alors transmettre les nouvelles &amp;lt;em&amp;gt;Hacker news&amp;lt;/em&amp;gt;
+periodiquement :&amp;lt;/p&amp;gt;
+&amp;lt;pre class=&amp;quot;literal-block&amp;quot;&amp;gt;
+(monitor-initialize)
+(loop
+   (monitor-hacker-news (lambda (message) (privmsg *connection* *channel* message)))
+   (sleep *period*))
+&amp;lt;/pre&amp;gt;
+&amp;lt;p&amp;gt;Cependant, ceci n&#039;est pas satisfaisant, car nous ne recevons ni ne
+traitons aucun message provenant du serveur &amp;lt;cite&amp;gt;IRC&amp;lt;/cite&amp;gt;.  Pour cel&amp;#195;&amp;#160;, il faut
+appeler la fonction &amp;lt;cite&amp;gt;(read-message *connection*)&amp;lt;/cite&amp;gt;.  Cette fonction
+contient un temps mort de 10 secondes: si aucun message n&#039;est re&amp;#195;&amp;#167;u au
+bout de 10 secondes, elle retourne &amp;lt;cite&amp;gt;NIL&amp;lt;/cite&amp;gt; au lieu de &amp;lt;cite&amp;gt;T&amp;lt;/cite&amp;gt;.  Comme notre
+p&amp;#195;&amp;#169;riode de travail n&#039;est pas inf&amp;#195;&amp;#169;rieur &amp;#195;&amp;#160; 10 secondes, nous pouvons
+nous accomoder de ce temps mort.&amp;lt;/p&amp;gt;
+&amp;lt;pre class=&amp;quot;literal-block&amp;quot;&amp;gt;
+(monitor-initialize)
+(loop
+  :with next-time = (+ *period* (get-universal-time))
+  :for time = (get-universal-time)
+  :do (if (&amp;amp;lt;= next-time time)
+          (progn
+            (monitor-hacker-news (lambda (message) (privmsg *connection* *channel* message)))
+            (incf next-time *period*))
+          (read-message *connection*) #|there&#039;s a 10 s timeout in here.|#))
+&amp;lt;/pre&amp;gt;
+&amp;lt;p&amp;gt;Nous pouvons maintenant ajouter une fonction de traitement des
+messages priv&amp;#195;&amp;#169;s, afin de fournir sur demande, une information &amp;#195;&amp;#160; propos
+du robot &amp;lt;cite&amp;gt;botihn&amp;lt;/cite&amp;gt; :&amp;lt;/p&amp;gt;
+&amp;lt;pre class=&amp;quot;literal-block&amp;quot;&amp;gt;
+(add-hook *connection* &#039;irc::irc-privmsg-message &#039;msg-hook)
+&amp;lt;/pre&amp;gt;
+&amp;lt;p&amp;gt;Avec :&amp;lt;/p&amp;gt;
+&amp;lt;pre class=&amp;quot;literal-block&amp;quot;&amp;gt;
+(defvar *sources-url* &amp;amp;quot;https://gitlab.com/com-informatimago/com-informatimago/tree/master/small-cl-pgms/botihn/&amp;amp;quot;)
+
+(defun msg-hook (message)
+  (when (string= *nickname* (first (arguments message)))
+    (privmsg *connection* (source message)
+             (format nil &amp;amp;quot;I&#039;m an IRC bot forwarding HackerNews news to ~A; ~
+                          under AGPL3 license, my sources are available at &amp;amp;lt;~A&amp;amp;gt;.&amp;amp;quot;
+                     *channel*
+                     *sources-url*))))
+&amp;lt;/pre&amp;gt;
+&amp;lt;p&amp;gt;Avec &amp;lt;cite&amp;gt;IRC&amp;lt;/cite&amp;gt;, les messages sont envoy&amp;#195;&amp;#169;s &amp;#195;&amp;#160; un canal ou &amp;#195;&amp;#160; un utilisateur
+donn&amp;#195;&amp;#169; en utilisant le m&amp;#195;&amp;#170;me message de protocole, un &amp;lt;cite&amp;gt;PRIVMSG&amp;lt;/cite&amp;gt;.  Le
+client peut distinguer &amp;#195;&amp;#160; qui le message &amp;#195;&amp;#169;tait envoy&amp;#195;&amp;#169; en observant le
+premier argument du message, qui sera le nom du canal ou le nom de
+l&#039;utilisateur.  Notre robot ne r&amp;#195;&amp;#169;agit pas aux messages envoy&amp;#195;&amp;#169;s sur le
+canal, mais r&amp;#195;&amp;#169;pond seulement aux messages qui lui sont directement
+adress&amp;#195;&amp;#169;s, avec &amp;lt;cite&amp;gt;/msg&amp;lt;/cite&amp;gt; :&amp;lt;/p&amp;gt;
+&amp;lt;pre class=&amp;quot;literal-block&amp;quot;&amp;gt;
+/msg botihn heho!
+
+&amp;amp;lt;botihn&amp;amp;gt; I&#039;m an IRC bot forwarding HackerNews news to #hn; under AGPL3 license, my sources
+are available at
+&amp;amp;lt;https://gitlab.com/com-informatimago/com-informatimago/tree/master/small-cl-pgms/botihn/&amp;amp;gt;.
+&amp;lt;/pre&amp;gt;
+&amp;lt;p&amp;gt;Jusqu&#039;&amp;#195;&amp;#160; pr&amp;#195;&amp;#169;sent, nous ne nous sommes pas occup&amp;#195;&amp;#169; des cas d&#039;erreur.
+Principalement, si une erreur survient, c&#039;est pour cause de
+d&amp;#195;&amp;#169;connexion du serveur &amp;lt;cite&amp;gt;IRC&amp;lt;/cite&amp;gt;.  Si une erreur survient avec le serveur
+de nouvelles, nous obtenons des listes de nouvelles vides, et nous
+n&#039;envoyons simplement aucun message.&amp;lt;/p&amp;gt;
+&amp;lt;p&amp;gt;Ainsi, si nous d&amp;#195;&amp;#169;tectons une sortie non-locale (avec
+&amp;lt;cite&amp;gt;UNWIND-PROTECT&amp;lt;/cite&amp;gt;), nous quittons simplement la connexion, et nous
+essayons de nous reconnecter apr&amp;#195;&amp;#168;s un d&amp;#195;&amp;#169;lai al&amp;#195;&amp;#169;atoire.&amp;lt;/p&amp;gt;
+&amp;lt;pre class=&amp;quot;literal-block&amp;quot;&amp;gt;
+(defun call-with-retry (delay thunk)
+  (loop
+    (handler-case (funcall thunk)
+      (error (err) (format *error-output* &amp;amp;quot;~A~%&amp;amp;quot; err)))
+    (funcall delay)))
+
+(defmacro with-retry (delay-expression &amp;amp;amp;body body)
+  `(call-with-retry (lambda () ,delay-expression)
+                    (lambda () ,&amp;amp;#64;body)))
+
+(defun main ()
+  (catch :gazongues
+    (with-retry (sleep (+ 10 (random 30)))
+      (unwind-protect
+           (progn
+             (setf *connection* (connect :nickname *nickname* :server *server*))
+             (add-hook *connection* &#039;irc::irc-privmsg-message &#039;msg-hook)
+             (join *connection* *channel*)
+             (monitor-initialize)
+             (loop
+               :with next-time = (+ *period* (get-universal-time))
+               :for time = (get-universal-time)
+               :do (if (&amp;amp;lt;= next-time time)
+                       (progn
+                         (monitor-hacker-news (lambda (message) (privmsg *connection* *channel* message)))
+                         (incf next-time *period*))
+                       (read-message *connection*) #|there&#039;s a 10 s timeout in here.|#)))
+        (when *connection*
+          (quit *connection*)
+          (setf *connection* nil))))))
+&amp;lt;/pre&amp;gt;
+&amp;lt;/div&amp;gt;
+&amp;lt;div class=&amp;quot;section&amp;quot; id=&amp;quot;generation-d-un-executable-independant&amp;quot;&amp;gt;
+&amp;lt;h2&amp;gt;G&amp;#195;&amp;#169;n&amp;#195;&amp;#169;ration d&#039;un ex&amp;#195;&amp;#169;cutable ind&amp;#195;&amp;#169;pendant&amp;lt;/h2&amp;gt;
+&amp;lt;p&amp;gt;Afin de g&amp;#195;&amp;#169;n&amp;#195;&amp;#169;rer un ex&amp;#195;&amp;#169;cutable ind&amp;#195;&amp;#169;pendant, nous &amp;#195;&amp;#169;crivons un petit
+script &amp;lt;cite&amp;gt;generate-application.lisp&amp;lt;/cite&amp;gt; qui sera ex&amp;#195;&amp;#169;cut&amp;#195;&amp;#169; dans un
+environnement vierge.  Ce script charge &amp;lt;cite&amp;gt;quicklisp&amp;lt;/cite&amp;gt;, charge botihn, et
+enregistre une image ex&amp;#195;&amp;#169;cutable, en indiquant la fonction &amp;lt;cite&amp;gt;main&amp;lt;/cite&amp;gt; comme
+point d&#039;entr&amp;#195;&amp;#169;e du programme (&amp;lt;cite&amp;gt;toplevel-function&amp;lt;/cite&amp;gt;) :&amp;lt;/p&amp;gt;
+&amp;lt;pre class=&amp;quot;literal-block&amp;quot;&amp;gt;
+(in-package &amp;amp;quot;COMMON-LISP-USER&amp;amp;quot;)
+(progn (format t &amp;amp;quot;~%;;; Loading quicklisp.~%&amp;amp;quot;) (finish-output) (values))
+(load #P&amp;amp;quot;~/quicklisp/setup.lisp&amp;amp;quot;)
+
+(progn (format t &amp;amp;quot;~%;;; Loading botihn.~%&amp;amp;quot;) (finish-output) (values))
+(push (make-pathname :name nil :type nil :version nil
+                     :defaults *load-truename*) asdf:*central-registry*)
+
+(ql:quickload :com.informatimago.small-cl-pgms.botihn)
+
+(progn (format t &amp;amp;quot;~%;;; Saving hotihn.~%&amp;amp;quot;) (finish-output) (values))
+;; This doesn&#039;t return.
+#+ccl (ccl::save-application
+       &amp;amp;quot;botihn&amp;amp;quot;
+       :mode #o755 :prepend-kernel t
+       :toplevel-function (function com.informatimago.small-cl-pgms.botihn:main)
+       :init-file nil
+       :error-handler :quit)
+&amp;lt;/pre&amp;gt;
+&amp;lt;p&amp;gt;Un petit &amp;lt;cite&amp;gt;Makefile&amp;lt;/cite&amp;gt; permet d&#039;ex&amp;#195;&amp;#169;cuter ce script facilement &amp;#195;&amp;#160; partir du
+shell &amp;lt;cite&amp;gt;unix&amp;lt;/cite&amp;gt; :&amp;lt;/p&amp;gt;
+&amp;lt;pre class=&amp;quot;literal-block&amp;quot;&amp;gt;
+all:botihn
+botihn: com.informatimago.small-cl-pgms.botihn.asd  botihn.lisp generate-application.lisp
+    ccl -norc &amp;amp;lt; generate-application.lisp
+&amp;lt;/pre&amp;gt;
+&amp;lt;/div&amp;gt;
+&amp;lt;div class=&amp;quot;section&amp;quot; id=&amp;quot;conclusion&amp;quot;&amp;gt;
+&amp;lt;h2&amp;gt;Conclusion&amp;lt;/h2&amp;gt;
+&amp;lt;p&amp;gt;Vous pouvez obtenir les sources complets de ce petit exemple &amp;#195;&amp;#160;:
+&amp;lt;a class=&amp;quot;reference external&amp;quot; href=&amp;quot;https://gitlab.com/com-informatimago/com-informatimago/tree/master/small-cl-pgms/botihn/&amp;quot;&amp;gt;https://gitlab.com/com-informatimago/com-informatimago/tree/master/small-cl-pgms/botihn/&amp;lt;/a&amp;gt; :&amp;lt;/p&amp;gt;
+&amp;lt;pre class=&amp;quot;literal-block&amp;quot;&amp;gt;
+git clone https://gitlab.com/com-informatimago/com-informatimago.git
+cd com-informatimago/small-cl-pgms/botihn/
+emacs # edit configuration
+make
+&amp;lt;/pre&amp;gt;
+&amp;lt;/div&amp;gt;
+&amp;lt;/div&amp;gt;
 &amp;lt;/div&amp;gt;
-en&amp;lt;/div&amp;gt;
-</description></item><item><dc:identifier>http://www.informatimago.com/articles/raspberrypi/ccl-sur-qemu.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language><nil/></dc:language><dc:format>text/html</dc:format><title>Clozure CL sur Raspberry Pi (FR)</title><link>http://www.informatimago.com/articles/raspberrypi/ccl-sur-qemu.html</link><guid isPermaLink="true">http://www.informatimago.com/articles/raspberrypi/ccl-sur-qemu.html</guid><category>lisp</category><pubDate>Fri, 20 Dec 2013 23:54:26 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
+&amp;lt;/div&amp;gt;
+</description></item><item><dc:identifier>http://www.informatimago.com/articles/raspberrypi/ccl-sur-qemu.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>en</dc:language><dc:format>text/html</dc:format><title>Clozure CL sur Raspberry Pi (FR)</title><link>http://www.informatimago.com/articles/raspberrypi/ccl-sur-qemu.html</link><guid isPermaLink="true">http://www.informatimago.com/articles/raspberrypi/ccl-sur-qemu.html</guid><category>lisp</category><pubDate>Fri, 20 Dec 2013 23:54:26 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
 &amp;lt;div class=&amp;quot;header&amp;quot;&amp;gt;
 &amp;lt;img src=&amp;quot;http://www.informatimago.com/blog/raspberry-pi.jpg&amp;quot; height=&amp;quot;100px&amp;quot; class=&amp;quot;floatRight&amp;quot;&amp;gt;&amp;lt;/img&amp;gt;
 &amp;lt;h1&amp;gt;&amp;lt;/h1&amp;gt;
@@ -26,17 +526,190 @@ en&amp;lt;/div&amp;gt;
 &amp;lt;p&amp;gt;&amp;lt;small&amp;gt;&amp;lt;a href=&amp;quot;mailto:pjb+blog@informatimago.com&amp;quot;&amp;gt;Pascal J. Bourguignon&amp;lt;/a&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
 &amp;lt;p&amp;gt;&amp;lt;small&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
 &amp;lt;/div&amp;gt;
-en&amp;lt;/div&amp;gt;
-</description></item><item><dc:identifier>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/sudoku-solver/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>Brainfuck, Common Lisp, Lisp, virtual machine, compiler, emulator</dc:language><dc:format>text/html</dc:format><title>Sudoku Solver</title><link>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/sudoku-solver/index.html</link><guid isPermaLink="true">http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/sudoku-solver/index.html</guid><category>lisp</category><pubDate>Wed, 12 Dec 2012 12:00:00 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
+&amp;lt;div class=&amp;quot;document&amp;quot; id=&amp;quot;ccl-sur-qemu&amp;quot;&amp;gt;
+&amp;lt;h1&amp;gt;Raspberry Pi&amp;lt;/h1&amp;gt;
+
+
+&amp;lt;p&amp;gt;Je devrais recevoir un Raspberry Pi cette semaine.  Prenant un peu
+d&#039;avance, j&#039;ai essay&amp;#195;&amp;#169; &amp;lt;a href=&amp;quot;http://ccl.clozure.com/&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Clozure CL&amp;lt;/tt&amp;gt;&amp;lt;/a&amp;gt;
+sur &amp;lt;a href=&amp;quot;http://www.raspbian.org/&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;raspbian&amp;lt;/tt&amp;gt;&amp;lt;/a&amp;gt;  sur l&#039;&amp;#195;&amp;#169;mulateur
+&amp;lt;a href=&amp;quot;https://launchpad.net/qemu-linaro&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;qemu linaro&amp;lt;/tt&amp;gt;&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;
+
+
+&amp;lt;h2&amp;gt;Instructions&amp;lt;/h2&amp;gt;
+
+
+&amp;lt;p&amp;gt;Suivons les instructions de
+&amp;lt;a href=&amp;quot;http://linux-news.org/index.php/2012/06/02/raspberry-pi-emulation/&amp;quot;&amp;gt;
+Linux-News Raspberry PI Emulation&amp;lt;/a&amp;gt;.
+
+&amp;lt;pre&amp;gt;
+RPI=&amp;quot;$HOME/raspberrypi&amp;quot;
+mkdir &amp;quot;$RPI&amp;quot;
+cd &amp;quot;$RPI&amp;quot;
+wget http://xecdesign.com/downloads/linux-qemu/kernel-qemu
+wget http://downloads.raspberrypi.org/images/raspbian/2012-07-15-wheezy-raspbian/2012-07-15-wheezy-raspbian.zip
+unzip -x 2012-07-15-wheezy-raspbian.zip
+git clone git://git.linaro.org/qemu/qemu-linaro.git
+cd qemu-linaro
+./configure --prefix=&amp;quot;$RPI&amp;quot;/opt --target-list=arm-softmmu
+make
+make install
+cd &amp;quot;$RPI&amp;quot;
+./opt/bin/qemu-system-arm \
+    -kernel kernel-qemu \
+    -cpu arm1136-r2 \
+    -M versatilepb \
+    -no-reboot \
+    -append &amp;quot;root=/dev/sda2 panic=1&amp;quot; \
+    -hda 2012-07-15-wheezy-raspbian.img
+&amp;lt;/pre&amp;gt;
+
+
+
+
+
+
+&amp;lt;p&amp;gt;&amp;#195;&amp;#135;a d&amp;#195;&amp;#169;marre bien, mais on n&#039;a pas acc&amp;#195;&amp;#168;s au r&amp;#195;&amp;#169;seau.  Avec un interface tun configur&amp;#195;&amp;#169; sur la machine
+h&amp;#195;&amp;#180;te, et un serveur DHCP sur le r&amp;#195;&amp;#169;seau local, on peut configurer un interface r&amp;#195;&amp;#169;seau tap avec la
+commande suivante:
+
+
+&amp;lt;pre&amp;gt;
+cd &amp;quot;$RPI&amp;quot;
+./opt/bin/qemu-system-arm \
+    -net nic,macaddr=52:54:0:0:0:77 -net tap \
+    -kernel kernel-qemu \
+    -cpu arm1136-r2 \
+    -M versatilepb \
+    -no-reboot \
+    -append &amp;quot;root=/dev/sda2 panic=1&amp;quot; \
+    -hda 2012-07-15-wheezy-raspbian.img
+&amp;lt;/pre&amp;gt;
+
+
+&amp;lt;p&amp;gt;On peut alors se connecter au compte &amp;lt;tt&amp;gt;pi&amp;lt;/tt&amp;gt; (mot de passe par d&amp;#195;&amp;#169;faut: &amp;lt;tt&amp;gt;raspberry&amp;lt;/tt&amp;gt;),
+et utiliser la connection r&amp;#195;&amp;#169;seau pour installer &amp;lt;a href=&amp;quot;http://ccl.clozure.com/&amp;quot;&amp;gt;&amp;lt;tt&amp;gt;Clozure CL&amp;lt;/tt&amp;gt;&amp;lt;/a&amp;gt;:&amp;lt;/p&amp;gt;
+
+
+&amp;lt;pre&amp;gt;
+svn co http://svn.clozure.com/publicsvn/openmcl/trunk/linuxarm/ccl
+ccl/armcl
+&amp;lt;/pre&amp;gt;
+
+
+&amp;lt;p&amp;gt;Et voil&amp;#195;&amp;#160; le r&amp;#195;&amp;#169;sultat:
+&amp;lt;img src=&amp;quot;ccl-raspberry-pi-qemu.png&amp;quot; alt=&amp;quot;Booting Clozure CL on raspbian on qemu&amp;quot;&amp;gt;&amp;lt;/img&amp;gt;
+&amp;lt;/p&amp;gt;
+
+
+&amp;lt;/p&amp;gt;
+&amp;lt;/p&amp;gt;
+&amp;lt;/div&amp;gt;
+&amp;lt;/div&amp;gt;
+</description></item><item><dc:identifier>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/sudoku-solver/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>en</dc:language><dc:format>text/html</dc:format><title>Sudoku Solver</title><link>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/sudoku-solver/index.html</link><guid isPermaLink="true">http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/sudoku-solver/index.html</guid><category>lisp</category><pubDate>Wed, 12 Dec 2012 12:00:00 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
 &amp;lt;div class=&amp;quot;header&amp;quot;&amp;gt;
 &amp;lt;img src=&amp;quot;http://www.informatimago.com/blog/sudoku.jpg&amp;quot; height=&amp;quot;100px&amp;quot; class=&amp;quot;floatRight&amp;quot;&amp;gt;&amp;lt;/img&amp;gt;
 &amp;lt;h1&amp;gt;Sudoku Solver&amp;lt;/h1&amp;gt;
 &amp;lt;p&amp;gt;Sudoku Solver&amp;lt;/p&amp;gt;
 &amp;lt;p&amp;gt;&amp;lt;small&amp;gt;&amp;lt;a href=&amp;quot;mailto:pjb+blog@informatimago.com&amp;quot;&amp;gt;Pascal J. Bourguignon&amp;lt;/a&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
-&amp;lt;p&amp;gt;&amp;lt;small&amp;gt;Sudoku Solver in Common Lisp&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
+&amp;lt;p&amp;gt;&amp;lt;small&amp;gt;Brainfuck, Common Lisp, Lisp, virtual machine, compiler, emulator&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
 &amp;lt;/div&amp;gt;
-en&amp;lt;/div&amp;gt;
-</description></item><item><dc:identifier>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/wang.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>LISP 1.5, Common Lisp, Lisp, Wang algorithm</dc:language><dc:format>text/html</dc:format><title>Old LISP programs still run in Common Lisp</title><link>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/wang.html</link><guid isPermaLink="true">http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/wang.html</guid><category>lisp</category><pubDate>Thu, 04 Oct 2012 14:52:16 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
+&amp;lt;div class=&amp;quot;document&amp;quot; id=&amp;quot;sudoku-solver&amp;quot;&amp;gt;
+
+
+&amp;lt;h1&amp;gt;Sudoku Solver&amp;lt;/h1&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;This file contains a sudoku solver.&amp;lt;/p&amp;gt;
+
+
+
+
+&amp;lt;ul&amp;gt;
+
+
+
+&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;sudoku-solver.lisp&amp;quot;&amp;gt;sudoku-solver.lisp&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
+
+
+
+&amp;lt;/ul&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;Example:&amp;lt;/p&amp;gt;
+
+
+
+
+&amp;lt;pre class=&amp;quot;dribble&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-prompt&amp;quot;&amp;gt;sudoku-solver&amp;amp;gt; &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-input&amp;quot;&amp;gt;(use-package :com.informatimago.sudoku-solver)&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-result&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-inputed-output&amp;quot;&amp;gt;t&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-result&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-prompt&amp;quot;&amp;gt;sudoku-solver&amp;amp;gt; &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-input&amp;quot;&amp;gt;(&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;cl-special-operator&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-input&amp;quot;&amp;gt;let*&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-input&amp;quot;&amp;gt; ((sudoku #2A((x x x 8 x 4 2 x x)
+                                  (6 x 8 x 2 x x x 4)
+                                  (2 1 x 6 5 3 x x 8)
+                                  (x 7 x 2 x 6 x 9 x)
+                                  (x x x x 3 x 1 x x)
+                                  (4 2 3 x x 9 x 5 7)
+                                  (x 6 x 4 1 5 7 x x)
+                                  (x x 7 x x 8 3 x x)
+                                  (x 5 9 x x x x 1 x))))
+                 (&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;cl-macro&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-input&amp;quot;&amp;gt;multiple-value-bind&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-input&amp;quot;&amp;gt; (solutions tries) (sudoku-solver sudoku)
+                   (&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;cl-function&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-input&amp;quot;&amp;gt;terpri&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-input&amp;quot;&amp;gt;)
+                   (sudoku-print sudoku)
+                   (&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;cl-function&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-input&amp;quot;&amp;gt;format&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-input&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;cl-system-class&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-input&amp;quot;&amp;gt;t&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-input&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-input&amp;quot;&amp;gt;&amp;quot;  has ~D solution~:*~P,~%  found in ~D tries.~2%&amp;quot;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-input&amp;quot;&amp;gt;
+                           (&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;cl-function&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-input&amp;quot;&amp;gt;length&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-input&amp;quot;&amp;gt; solutions) tries)
+                   (&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;cl-function&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-input&amp;quot;&amp;gt;map&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-input&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;cl-type&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-input&amp;quot;&amp;gt;nil&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-input&amp;quot;&amp;gt; &#039;sudoku-print solutions)))
+&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-output&amp;quot;&amp;gt;
++---+---+---+---+---+---+---+---+---+
+| .   6   2 | .   .   4 | .   .   . |
+|   +   +   |   +   +   |   +   +   |
+| .   .   1 | 7   .   2 | 6   .   5 |
+|   +   +   |   +   +   |   +   +   |
+| .   8   . | .   .   3 | .   7   9 |
++---+---+---+---+---+---+---+---+---+
+| 8   .   6 | 2   .   . | 4   .   . |
+|   +   +   |   +   +   |   +   +   |
+| .   2   5 | .   3   . | 1   .   . |
+|   +   +   |   +   +   |   +   +   |
+| 4   .   3 | 6   .   9 | 5   8   . |
++---+---+---+---+---+---+---+---+---+
+| 2   .   . | .   1   . | 7   3   . |
+|   +   +   |   +   +   |   +   +   |
+| .   .   . | 9   .   5 | .   .   1 |
+|   +   +   |   +   +   |   +   +   |
+| .   4   8 | .   .   7 | .   .   . |
++---+---+---+---+---+---+---+---+---+
+
+  has 1 solution,
+  found in 44 tries.
+
++---+---+---+---+---+---+---+---+---+
+| 7   6   2 | 5   9   4 | 3   1   8 |
+|   +   +   |   +   +   |   +   +   |
+| 3   9   1 | 7   8   2 | 6   4   5 |
+|   +   +   |   +   +   |   +   +   |
+| 5   8   4 | 1   6   3 | 2   7   9 |
++---+---+---+---+---+---+---+---+---+
+| 8   7   6 | 2   5   1 | 4   9   3 |
+|   +   +   |   +   +   |   +   +   |
+| 9   2   5 | 4   3   8 | 1   6   7 |
+|   +   +   |   +   +   |   +   +   |
+| 4   1   3 | 6   7   9 | 5   8   2 |
++---+---+---+---+---+---+---+---+---+
+| 2   5   9 | 8   1   6 | 7   3   4 |
+|   +   +   |   +   +   |   +   +   |
+| 6   3   7 | 9   4   5 | 8   2   1 |
+|   +   +   |   +   +   |   +   +   |
+| 1   4   8 | 3   2   7 | 9   5   6 |
++---+---+---+---+---+---+---+---+---+
+
+&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-result&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-inputed-output&amp;quot;&amp;gt;nil&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-result&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;slime-repl-prompt&amp;quot;&amp;gt;sudoku-solver&amp;amp;gt; &amp;lt;/span&amp;gt;
+  &amp;lt;/pre&amp;gt;
+&amp;lt;/div&amp;gt;
+&amp;lt;/div&amp;gt;
+</description></item><item><dc:identifier>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/wang.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>en</dc:language><dc:format>text/html</dc:format><title>Old LISP programs still run in Common Lisp</title><link>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/wang.html</link><guid isPermaLink="true">http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/wang.html</guid><category>lisp</category><pubDate>Thu, 04 Oct 2012 14:52:16 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
 &amp;lt;div class=&amp;quot;header&amp;quot;&amp;gt;
 &amp;lt;img src=&amp;quot;http://www.informatimago.com/blog/hao-wang.jpg&amp;quot; height=&amp;quot;100px&amp;quot; class=&amp;quot;floatRight&amp;quot;&amp;gt;&amp;lt;/img&amp;gt;
 &amp;lt;h1&amp;gt;Old LISP programs still run in Common Lisp&amp;lt;/h1&amp;gt;
@@ -44,19 +717,344 @@ en&amp;lt;/div&amp;gt;
     McCarthy as an application of LISP, in the manual of the first version
     of LISP on IBM 704, dated March 1960.&amp;lt;/p&amp;gt;
 &amp;lt;p&amp;gt;&amp;lt;small&amp;gt;&amp;lt;a href=&amp;quot;mailto:pjb+blog@informatimago.com&amp;quot;&amp;gt;Pascal J. Bourguignon&amp;lt;/a&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
-&amp;lt;p&amp;gt;&amp;lt;small&amp;gt;Old LISP program running in Common Lisp&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
+&amp;lt;p&amp;gt;&amp;lt;small&amp;gt;LISP 1.5, Common Lisp, Lisp, Wang algorithm&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
+&amp;lt;/div&amp;gt;
+&amp;lt;div class=&amp;quot;document&amp;quot; id=&amp;quot;wang&amp;quot;&amp;gt;
+
+
+&amp;lt;h1&amp;gt;Old LISP programs still run in Common Lisp&amp;lt;/h1&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;Actually, any Common Lisp implementation can be applied with
+     almost all Lisp material from any time, thanks to the concensual
+     approach of the Common Lisp standard.&amp;lt;/p&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;For example, here is how you can run a lisp program written in
+     1960 in a Common Lisp of 2014.  Rendez-vous in 28 years to see
+     how you can run a 1996 perl program in perl 2042...&amp;lt;/p&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;This Wang&#039;s algorithm has been popularized by John McCarthy as an
+     application of LISP, published in the manual of the first version
+     of LISP, LISP 1 impl&amp;#195;&amp;#169;ment&amp;#195;&amp;#169; sur IBM 704, dated March 1960.
+    &amp;lt;a href=&amp;quot;http://community.computerhistory.org/scc/projects/LISP/book/LISP%20I%20Programmers%20Manual.pdf&amp;quot;&amp;gt;LISP 1 Programmer&#039;s Manual, page 32&amp;lt;/a&amp;gt;
+    (and also reproduced in
+    &amp;lt;a href=&amp;quot;http://community.computerhistory.org/scc/projects/LISP/book/LISP%201.5%20Programmers%20Manual.pdf#page=52&amp;quot;&amp;gt;LISP
+      1.5 Programmer&#039;s Manual, Chapter VIII, page 52: A Complete LISP
+      Program - the Wang Algorithm for the Propositional
+      Calculus.&amp;lt;/a&amp;gt;). &amp;lt;/p&amp;gt;
+
+
+
+
+
+&amp;lt;pre class=&amp;quot;code&amp;quot;&amp;gt;
+----(wang-cl.lisp)------------------------------------------------------
+(shadow &#039;(trace untrace))
+(defun trace   (functions) (eval `(cl:trace   ,@functions)))
+(defun untrace (functions) (eval `(cl:untrace ,@functions)))
+
+(defun define (definitions)
+  (dolist (def definitions)
+    (eval (if (and (consp (second def)) (eq &#039;lambda (car (second def))))
+              `(progn (defun        ,(first def) ,@(cdr (second def)))
+                      (defparameter ,(first def) ,(second def)))
+              `(defparameter ,(first def) ,(second def))))))
+
+(defun stop (arguments) (throw &#039;driver-end-of-deck nil))
+(defun fin  (arguments) (throw &#039;driver-end-of-deck nil))
+(defun test (arguments) (princ arguments) (terpri))
+
+(defun driver (path)
+  (with-open-file (cards path)
+    (catch &#039;driver-end-of-deck
+      (loop (let ((first-char (read-char cards)))
+              (if (char= #\* first-char)
+                  (read-line cards)     ; comment
+                  (progn
+                    (unread-char first-char cards)
+                    (let* ((command   (read cards))
+                           (arguments (if (member command &#039;(stop fin test))
+                                          (list (read-line cards))
+                                          (read cards))))
+                      (print (apply command arguments))))))))))
+
+(driver &amp;quot;wang.job&amp;quot;)
+----(wang.job)----------------------------------------------------------
+* M948-1207 LEVIN, LISP, TEST, 2,3,250,0
+        TEST WANG ALGORITHM FOR THE PROPOSITIONAL CALCULUS
+
+DEFINE ((
+(THEOREM (LAMBDA (S) (TH1 NIL NIL (CADR S) (CADDR S))))
+
+(TH1 (LAMBDA (A1 A2 A C) (COND ((NULL A)
+        (TH2 A1 A2 NIL NIL C)) (T
+        (OR (MEMBER (CAR A) C) (COND ((ATOM (CAR A))
+        (TH1 (COND ((MEMBER (CAR A) A1) A1)
+        (T (CONS (CAR A) A1))) A2 (CDR A) C))
+        (T (TH1 A1 (COND ((MEMBER (CAR A) A2) A2)
+        (T (CONS (CAR A) A2))) (CDR A) C))))))))
+
+(TH2 (LAMBDA (A1 A2 C1 C2 C) (COND
+        ((NULL C) (TH A1 A2 C1 C2))
+        ((ATOM (CAR C)) (TH2 A1 A2 (COND
+        ((MEMBER (CAR C) C1) C1) (T
+        (CONS (CAR C) C1))) C2 (CDR C)))
+        (T (TH2 A1 A2 C1 (COND ((MEMBER
+        (CAR C) C2) C2) (T (CONS (CAR C) C2)))
+        (CDR C))))))
+
+(TH (LAMBDA (A1 A2 C1 C2) (COND ((NULL A2) (AND (NOT (NULL C2))
+        (THR (CAR C2) A1 A2 C1 (CDR C2)))) (T (THL (CAR A2) A1 (CDR A2)
+        C1 C2)))))
+
+(THL (LAMBDA (U A1 A2 C1 C2) (COND
+        ((EQ (CAR U) (QUOTE NOT)) (TH1R (CADR U) A1 A2 C1 C2))
+        ((EQ (CAR U) (QUOTE AND)) (TH2L (CDR U) A1 A2 C1 C2))
+        ((EQ (CAR U) (QUOTE OR)) (AND (TH1L (CADR U) A1 A2 C1 C2)
+        (TH1L (CADDR U) A1 A2 C1 C2) ))
+        ((EQ (CAR U) (QUOTE IMPLIES)) (AND (TH1L (CADDR U) A1 A2 C1
+        C2) (TH1R (CADR U) A1 A2 C1 C2) ))
+        ((EQ (CAR U) (QUOTE EQUIV)) (AND (TH2L (CDR U) A1 A2 C1 C2)
+        (TH2R (CDR U) A1 A2 C1 C2) ))
+        (T (ERROR (LIST (QUOTE THL) U A1 A2 C1 C2)))
+        )))
+
+(THR (LAMBDA (U A1 A2 C1 C2) (COND
+        ((EQ (CAR U) (QUOTE NOT)) (TH1L (CADR U) A1 A2 C1 C2))
+        ((EQ (CAR U) (QUOTE AND)) (AND (TH1R (CADR U) A1 A2 C1 C2)
+        (TH1R (CADDR U) A1 A2 C1 C2) ))
+        ((EQ (CAR U) (QUOTE OR)) (TH2R (CDR U) A1 A2 C1 C2))
+        ((EQ (CAR U) (QUOTE IMPLIES)) (TH11 (CADR U) (CADDR U)
+         A1 A2 C1 C2))
+        ((EQ (CAR U) (QUOTE EQUIV)) (AND (TH11 (CADR U) (CADDR U)
+        A1 A2 C1 C2) (TH11 (CADDR U) (CADR U) A1 A2 C1 C2) ))
+        (T (ERROR (LIST (QUOTE THR) U A1 A2 C1 C2)))
+        )))
+
+(TH1L (LAMBDA (V A1 A2 C1 C2) (COND
+        ((ATOM V) (OR (MEMBER V C1)
+        (TH (CONS V A1) A2 C1 C2) ))
+        (T (OR (MEMBER V C2) (TH A1 (CONS V A2) C1 C2) ))
+        )))
+
+(TH1R (LAMBDA (V A1 A2 C1 C2) (COND
+        ((ATOM V) (OR (MEMBER V A1)
+        (TH A1 A2 (CONS V C1) C2) ))
+        (T (OR (MEMBER V A2) (TH A1 A2 C1 (CONS V C2))))
+        )))
+
+(TH2L (LAMBDA (V A1 A2 C1 C2) (COND
+        ((ATOM (CAR V)) (OR (MEMBER (CAR V) C1)
+        (TH1L (CADR V) (CONS (CAR V) A1) A2 C1 C2)))
+        (T (OR (MEMBER (CAR V) C2) (TH1L (CADR V) A1 (CONS (CAR V)
+        A2) C1 C2)))
+        )))
+
+(TH2R (LAMBDA (V A1 A2 C1 C2) (COND
+        ((ATOM (CAR V)) (OR (MEMBER (CAR V) A1)
+        (TH1R (CADR V) A1 A2 (CONS (CAR V) C1) C2)))
+        (T (OR (MEMBER (CAR V) A2) (TH1R (CADR V) A1 A2 C1
+        (CONS (CAR V) C2))))
+        )))
+
+(TH11 (LAMBDA (VI V2 A1 A2 C1 C2) (COND
+        ((ATOM VI) (OR (MEMBER VI C1) (TH1R V2 (CONS VI A1) A2 C1
+        C2)))
+        (T (OR (MEMBER VI C2) (TH1R V2 A1 (CONS VI A2) C1 C2)))
+        )))
+))
+
+TRACE ((THEOREM TH1 TH2 TH THL THR TH1L TH1R TH2L TH2R TH11))
+
+THEOREM
+((ARROW (P) ((OR P Q))))
+
+UNTRACE ((THEOREM TH1 TH2 THR THL TH1L TH1R TH2L TH2R TH11))
+
+THEOREM
+((ARROW ((OR A (NOT B))) ((IMPLIES (AND P Q) (EQUIV P Q))) ))
+
+STOP)))    )))     )))     )))
+FIN     END OF LISP RUN        M948-1207 LEVIN
+------------------------------------------------------------------------
+
+[60]&amp;gt; (load&amp;quot;wang-cl.lisp&amp;quot;)
+;; Loading file wang-cl.lisp ...
+WANG ALGORITHM FOR THE PROPOSITIONAL CALCULUS
+
+NIL
+WARNING: DEFUN/DEFMACRO: redefining TH; it was traced!
+NIL
+;; Tracing function THEOREM.
+;; Tracing function TH1.
+;; Tracing function TH2.
+;; Tracing function TH.
+;; Tracing function THL.
+;; Tracing function THR.
+;; Tracing function TH1L.
+;; Tracing function TH1R.
+;; Tracing function TH2L.
+;; Tracing function TH2R.
+;; Tracing function TH11.
+(THEOREM TH1 TH2 TH THL THR TH1L TH1R TH2L TH2R TH11)
+1. Trace: (THEOREM &#039;(ARROW (P) ((OR P Q))))
+2. Trace: (TH1 &#039;NIL &#039;NIL &#039;(P) &#039;((OR P Q)))
+3. Trace: (TH1 &#039;(P) &#039;NIL &#039;NIL &#039;((OR P Q)))
+4. Trace: (TH2 &#039;(P) &#039;NIL &#039;NIL &#039;NIL &#039;((OR P Q)))
+5. Trace: (TH2 &#039;(P) &#039;NIL &#039;NIL &#039;((OR P Q)) &#039;NIL)
+6. Trace: (TH &#039;(P) &#039;NIL &#039;NIL &#039;((OR P Q)))
+7. Trace: (THR &#039;(OR P Q) &#039;(P) &#039;NIL &#039;NIL &#039;NIL)
+8. Trace: (TH2R &#039;(P Q) &#039;(P) &#039;NIL &#039;NIL &#039;NIL)
+8. Trace: TH2R ==&amp;gt; (P)
+7. Trace: THR ==&amp;gt; (P)
+6. Trace: TH ==&amp;gt; (P)
+5. Trace: TH2 ==&amp;gt; (P)
+4. Trace: TH2 ==&amp;gt; (P)
+3. Trace: TH1 ==&amp;gt; (P)
+2. Trace: TH1 ==&amp;gt; (P)
+1. Trace: THEOREM ==&amp;gt; (P)
+(P)
+(THEOREM TH1 TH2 THR THL TH1L TH1R TH2L TH2R TH11)
+1. Trace: (TH &#039;NIL &#039;((OR A (NOT B))) &#039;NIL &#039;((IMPLIES (AND P Q) (EQUIV P Q))))
+2. Trace: (TH &#039;(A) &#039;NIL &#039;NIL &#039;((IMPLIES (AND P Q) (EQUIV P Q))))
+3. Trace: (TH &#039;(A) &#039;((AND P Q)) &#039;NIL &#039;((EQUIV P Q)))
+4. Trace: (TH &#039;(Q P A) &#039;NIL &#039;NIL &#039;((EQUIV P Q)))
+4. Trace: TH ==&amp;gt; (P A)
+3. Trace: TH ==&amp;gt; (P A)
+2. Trace: TH ==&amp;gt; (P A)
+2. Trace: (TH &#039;NIL &#039;((NOT B)) &#039;NIL &#039;((IMPLIES (AND P Q) (EQUIV P Q))))
+3. Trace: (TH &#039;NIL &#039;NIL &#039;(B) &#039;((IMPLIES (AND P Q) (EQUIV P Q))))
+4. Trace: (TH &#039;NIL &#039;((AND P Q)) &#039;(B) &#039;((EQUIV P Q)))
+5. Trace: (TH &#039;(Q P) &#039;NIL &#039;(B) &#039;((EQUIV P Q)))
+5. Trace: TH ==&amp;gt; (P)
+4. Trace: TH ==&amp;gt; (P)
+3. Trace: TH ==&amp;gt; (P)
+2. Trace: TH ==&amp;gt; (P)
+1. Trace: TH ==&amp;gt; (P)
+(P)
+;; Loaded file wang-cl.lisp
+T
+[61]&amp;gt;
+  &amp;lt;/pre&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;Note, the output obviously differ in the form, but the semantics
+     are the same, notably the result of the theorem function calls is
+     &amp;quot;true&amp;quot; both in 2014 Common Lisp and in 1966 LISP 1.5. &amp;lt;/p&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;You may also download the sources here:&amp;lt;/p&amp;gt;
+
+
+
+&amp;lt;ul&amp;gt;
+
+
+
+&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;wang-cl.lisp&amp;quot;&amp;gt;wang-cl.lisp&amp;lt;/a&amp;gt;
+
+&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;wang.job&amp;quot;&amp;gt;wang.job&amp;lt;/a&amp;gt;
+  &amp;lt;/li&amp;gt;
+&amp;lt;/li&amp;gt;
+&amp;lt;/ul&amp;gt;
+
+
+
+&amp;lt;/div&amp;gt;
 &amp;lt;/div&amp;gt;
-en&amp;lt;/div&amp;gt;
-</description></item><item><dc:identifier>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/intersection-r5rs-common-lisp-emacs-lisp/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>Intersection, Common Lisp, Emacs Lisp, R5RS, Scheme, Lisp</dc:language><dc:format>text/html</dc:format><title>Intersection Common Lisp, Emacs Lisp and R5RS Scheme</title><link>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/intersection-r5rs-common-lisp-emacs-lisp/index.html</link><guid isPermaLink="true">http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/intersection-r5rs-common-lisp-emacs-lisp/index.html</guid><category>lisp</category><pubDate>Wed, 27 May 2011 12:00:00 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
+</description></item><item><dc:identifier>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/intersection-r5rs-common-lisp-emacs-lisp/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>en</dc:language><dc:format>text/html</dc:format><title>Intersection Common Lisp, Emacs Lisp and R5RS Scheme</title><link>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/intersection-r5rs-common-lisp-emacs-lisp/index.html</link><guid isPermaLink="true">http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/intersection-r5rs-common-lisp-emacs-lisp/index.html</guid><category>lisp</category><pubDate>Wed, 27 May 2011 12:00:00 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
 &amp;lt;div class=&amp;quot;header&amp;quot;&amp;gt;
 &amp;lt;img src=&amp;quot;http://www.informatimago.com/blog/intersection.jpg&amp;quot; height=&amp;quot;100px&amp;quot; class=&amp;quot;floatRight&amp;quot;&amp;gt;&amp;lt;/img&amp;gt;
 &amp;lt;h1&amp;gt;Intersection Common Lisp, Emacs Lisp and R5RS Scheme&amp;lt;/h1&amp;gt;
 &amp;lt;p&amp;gt;A program that can be interpreted by both Common Lisp, Emacs Lisp and R5RS Scheme.&amp;lt;/p&amp;gt;
 &amp;lt;p&amp;gt;&amp;lt;small&amp;gt;&amp;lt;a href=&amp;quot;mailto:pjb+blog@informatimago.com&amp;quot;&amp;gt;Pascal J. Bourguignon&amp;lt;/a&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
-&amp;lt;p&amp;gt;&amp;lt;small&amp;gt;BASIC in Common Lisp&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
+&amp;lt;p&amp;gt;&amp;lt;small&amp;gt;Intersection, Common Lisp, Emacs Lisp, R5RS, Scheme, Lisp&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
+&amp;lt;/div&amp;gt;
+&amp;lt;div class=&amp;quot;document&amp;quot; id=&amp;quot;intersection-r5rs-cl-el&amp;quot;&amp;gt;
+
+
+&amp;lt;h1&amp;gt;Intersection Common Lisp, Emacs Lisp and R5RS Scheme&amp;lt;/h1&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;intersection-cl-el-r5rs.lisp&amp;quot;&amp;gt;intersection-cl-el-r5rs.lisp&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;
+
+
+
+&amp;lt;p&amp;gt;This lisp source file can be loaded and run on:
+
+&amp;lt;ul&amp;gt;
+
+
+
+&amp;lt;li&amp;gt; any Common Lisp conforming implementation, &amp;lt;/li&amp;gt;
+
+
+
+&amp;lt;li&amp;gt; any R5RS implementation,&amp;lt;/li&amp;gt;
+
+
+
+&amp;lt;li&amp;gt; GNU emacs (tested with emacs-23 and emacs-24).&amp;lt;/li&amp;gt;
+
+
+
+&amp;lt;/ul&amp;gt;
+
+
+  &amp;lt;/p&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;Example:
+
+&amp;lt;pre class=&amp;quot;code&amp;quot;&amp;gt;
+        &amp;lt;span class=&amp;quot;comint-highlight-prompt&amp;quot;&amp;gt;[pjb@kuiper :0 intersection-r5rs-common-lisp-emacs-lisp]$ &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;comint-highlight-input&amp;quot;&amp;gt;make test-intersection-cl-el-r5rs&amp;lt;/span&amp;gt;
+
+
+;;======================================================================
+;; Test intersection-cl-el-r5rs
+;;
+
+;; Common Lisp
+clisp &amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;-ansi&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;-norc&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;-q&amp;lt;/span&amp;gt; intersection-cl-el-r5rs.lisp
+
+(booted a lisp over common-lisp)
+((fact 10) = 3628800)
+
+;; Emacs Lisp
+emacs &amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;-Q&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;--batch&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;-l&amp;lt;/span&amp;gt; intersection-cl-el-r5rs.lisp &amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;-q&amp;lt;/span&amp;gt;
+
+(booted a lisp over emacs-lisp)
+((fact 10) = 3628800)
+
+;; Scheme
+bigloo &amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;-no-hello&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;-q&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;-w&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;-load&amp;lt;/span&amp;gt;  intersection-cl-el-r5rs.lisp &amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;-eval&amp;lt;/span&amp;gt; &#039;(quit)&#039;
+
+(booted a lisp over scheme)
+((fact 10) = 3628800)
+&amp;lt;span class=&amp;quot;comint-highlight-prompt&amp;quot;&amp;gt;[pjb@kuiper :0 intersection-r5rs-common-lisp-emacs-lisp]$&amp;lt;/span&amp;gt;&amp;lt;/pre&amp;gt;
+
+
+
+&amp;lt;/p&amp;gt;
 &amp;lt;/div&amp;gt;
-en&amp;lt;/div&amp;gt;
-</description></item><item><dc:identifier>http://www.informatimago.com/articles/flpl/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language><nil/></dc:language><dc:format>text/html</dc:format><title>A Fortran-Compiled List-Processing Language</title><link>http://www.informatimago.com/articles/flpl/index.html</link><guid isPermaLink="true">http://www.informatimago.com/articles/flpl/index.html</guid><category>lisp</category><pubDate>Wed, 19 Jan 2011 01:55:26 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
+&amp;lt;/div&amp;gt;
+</description></item><item><dc:identifier>http://www.informatimago.com/articles/flpl/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>en</dc:language><dc:format>text/html</dc:format><title>A Fortran-Compiled List-Processing Language</title><link>http://www.informatimago.com/articles/flpl/index.html</link><guid isPermaLink="true">http://www.informatimago.com/articles/flpl/index.html</guid><category>lisp</category><pubDate>Wed, 19 Jan 2011 01:55:26 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
 &amp;lt;div class=&amp;quot;header&amp;quot;&amp;gt;
 &amp;lt;img src=&amp;quot;http://www.informatimago.com/blog/IBM704b.jpg&amp;quot; height=&amp;quot;100px&amp;quot; class=&amp;quot;floatRight&amp;quot;&amp;gt;&amp;lt;/img&amp;gt;
 &amp;lt;h1&amp;gt;&amp;lt;/h1&amp;gt;
@@ -64,8 +1062,28 @@ en&amp;lt;/div&amp;gt;
 &amp;lt;p&amp;gt;&amp;lt;small&amp;gt;&amp;lt;a href=&amp;quot;mailto:pjb+blog@informatimago.com&amp;quot;&amp;gt;Pascal J. Bourguignon&amp;lt;/a&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
 &amp;lt;p&amp;gt;&amp;lt;small&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
 &amp;lt;/div&amp;gt;
-en&amp;lt;/div&amp;gt;
-</description></item><item><dc:identifier>http://www.informatimago.com/articles/emacs-colors/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language><nil/></dc:language><dc:format>text/html</dc:format><title>Playing with colors in emacs</title><link>http://www.informatimago.com/articles/emacs-colors/index.html</link><guid isPermaLink="true">http://www.informatimago.com/articles/emacs-colors/index.html</guid><category>lisp</category><pubDate>Wed, 20 Oct 2010 08:16:58 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
+&amp;lt;div class=&amp;quot;document&amp;quot; id=&amp;quot;flpl&amp;quot;&amp;gt;
+&amp;lt;h1&amp;gt;A Fortran-Compiled List-Processing Language&amp;lt;/h1&amp;gt;
+
+
+
+&amp;lt;p&amp;gt;Here is a transcription of the April 1959 article  &amp;quot;A
+Fortran-Compiled List-Processing Language&amp;quot; by: H. Gelernter,
+J. R. Hansen, C. L. Gerberich.
+
+&amp;lt;ul&amp;gt;
+&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;flpl.pdf&amp;quot;&amp;gt;PDF file&amp;lt;/a&amp;gt;
+&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;flpl.html&amp;quot;&amp;gt;HTML file&amp;lt;/a&amp;gt;
+&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;flpl.txt&amp;quot;&amp;gt;reStructured source&amp;lt;/a&amp;gt; with &amp;lt;a href=&amp;quot;figures.lisp&amp;quot;&amp;gt;lisp source&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
+&amp;lt;/li&amp;gt;
+&amp;lt;/li&amp;gt;
+&amp;lt;/ul&amp;gt;
+
+
+&amp;lt;/p&amp;gt;
+&amp;lt;/div&amp;gt;
+&amp;lt;/div&amp;gt;
+</description></item><item><dc:identifier>http://www.informatimago.com/articles/emacs-colors/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>en</dc:language><dc:format>text/html</dc:format><title>Playing with colors in emacs</title><link>http://www.informatimago.com/articles/emacs-colors/index.html</link><guid isPermaLink="true">http://www.informatimago.com/articles/emacs-colors/index.html</guid><category>lisp</category><pubDate>Wed, 20 Oct 2010 08:16:58 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
 &amp;lt;div class=&amp;quot;header&amp;quot;&amp;gt;
 &amp;lt;img src=&amp;quot;http://www.informatimago.com/blog/colors.jpg&amp;quot; height=&amp;quot;100px&amp;quot; class=&amp;quot;floatRight&amp;quot;&amp;gt;&amp;lt;/img&amp;gt;
 &amp;lt;h1&amp;gt;&amp;lt;/h1&amp;gt;
@@ -73,8 +1091,81 @@ en&amp;lt;/div&amp;gt;
 &amp;lt;p&amp;gt;&amp;lt;small&amp;gt;&amp;lt;a href=&amp;quot;mailto:pjb+blog@informatimago.com&amp;quot;&amp;gt;Pascal J. Bourguignon&amp;lt;/a&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
 &amp;lt;p&amp;gt;&amp;lt;small&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
 &amp;lt;/div&amp;gt;
-en&amp;lt;/div&amp;gt;
-</description></item><item><dc:identifier>http://www.informatimago.com/articles/life-saver.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language><nil/></dc:language><dc:format>text/html</dc:format><title>Life Saver</title><link>http://www.informatimago.com/articles/life-saver.html</link><guid isPermaLink="true">http://www.informatimago.com/articles/life-saver.html</guid><category>lisp</category><pubDate>Thu, 14 Oct 2010 23:48:34 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
+&amp;lt;div class=&amp;quot;document&amp;quot; id=&amp;quot;emacs-color&amp;quot;&amp;gt;
+&amp;lt;h1&amp;gt;Playing with colors in emacs&amp;lt;/h1&amp;gt;
+
+
+&amp;lt;p&amp;gt;The fundamental feature to set the color of characters in emacs are
+the text properties, namely, the face text property.&amp;lt;/p&amp;gt;
+
+
+&amp;lt;p&amp;gt;An important precondition is to disable font-locking, since this
+feature will override any colorizing you may be doing, usually soon
+enough that you won&#039;t even see the result of your settings.&amp;lt;/p&amp;gt;
+
+
+&amp;lt;pre&amp;gt;
+(add-text-properties start end
+     `(face (:foreground ,(format &amp;quot;#%02x%02x%02x&amp;quot; red green blue)))
+&amp;lt;/pre&amp;gt;
+
+
+
+&amp;lt;img src=&amp;quot;rainbow.png&amp;quot; alt=&amp;quot;A picture of the code of the rainbow function, applied to itself.&amp;quot;&amp;gt;
+
+
+&amp;lt;pre&amp;gt;
+
+(require &#039;cl)
+
+(defun gradient (start end start-color end-color)
+  (destructuring-bind (red green blue) start-color
+    (destructuring-bind (ered egreen eblue) end-color
+      (let* ((count     (coerce (- end    start) &#039;float))
+             (ired   (/ (- ered   red)   count))
+             (igreen (/ (- egreen green) count))
+             (iblue  (/ (- eblue  blue)  count)))
+        (while (&amp;amp;lt; 0 count)
+          (add-text-properties start (incf start)
+                               `(face (:foreground ,(format &amp;quot;#%02x%02x%02x&amp;quot;
+                                                            red green blue))))
+          (incf red   ired)
+          (incf green igreen)
+          (incf blue  iblue)
+          (decf       count))))))
+
+
+(defun rgb (name)
+  (let ((entry (assoc name color-name-rgb-alist)))
+    (if entry
+        (mapcar (lambda (x) (/ x 256.0)) (rest entry))
+        &#039;(0 0 0))))
+
+(defun rainbow (start end)
+  (interactive &amp;quot;r&amp;quot;)
+  (let ((range (truncate (- end start) 5)))
+    (loop
+       for (from to) on (list (rgb &amp;quot;red&amp;quot;)
+                              (rgb &amp;quot;orange&amp;quot;)
+                              (rgb &amp;quot;yellow&amp;quot;)
+                              (rgb &amp;quot;green&amp;quot;)
+                              (rgb &amp;quot;blue&amp;quot;)
+                              (rgb &amp;quot;violet&amp;quot;))
+       while to
+       for start from start           by range
+       for next  from (+ start range) by range
+       do (gradient start (if to next end) from to))))
+
+(progn (font-lock-mode -1)
+       (rainbow (point-min) (point-max)))
+
+&amp;lt;/pre&amp;gt;
+
+
+&amp;lt;/img&amp;gt;
+&amp;lt;/div&amp;gt;
+&amp;lt;/div&amp;gt;
+</description></item><item><dc:identifier>http://www.informatimago.com/articles/life-saver.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>en</dc:language><dc:format>text/html</dc:format><title>Life Saver</title><link>http://www.informatimago.com/articles/life-saver.html</link><guid isPermaLink="true">http://www.informatimago.com/articles/life-saver.html</guid><category>lisp</category><pubDate>Thu, 14 Oct 2010 23:48:34 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
 &amp;lt;div class=&amp;quot;header&amp;quot;&amp;gt;
 &amp;lt;img src=&amp;quot;http://www.informatimago.com/articles/lifesaver.jpg&amp;quot; height=&amp;quot;100px&amp;quot; class=&amp;quot;floatRight&amp;quot;&amp;gt;&amp;lt;/img&amp;gt;
 &amp;lt;h1&amp;gt;&amp;lt;/h1&amp;gt;
@@ -82,8 +1173,450 @@ en&amp;lt;/div&amp;gt;
 &amp;lt;p&amp;gt;&amp;lt;small&amp;gt;&amp;lt;a href=&amp;quot;mailto:pjb+blog@informatimago.com&amp;quot;&amp;gt;Pascal J. Bourguignon&amp;lt;/a&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
 &amp;lt;p&amp;gt;&amp;lt;small&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
 &amp;lt;/div&amp;gt;
-en&amp;lt;/div&amp;gt;
-</description></item><item><dc:identifier>http://www.informatimago.com/articles/cl-types/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language><nil/></dc:language><dc:format>text/html</dc:format><title>Graphs of Common Lisp Types</title><link>http://www.informatimago.com/articles/cl-types/index.html</link><guid isPermaLink="true">http://www.informatimago.com/articles/cl-types/index.html</guid><category>lisp</category><pubDate>Sun, 10 Oct 2010, 10:10:10 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
+&amp;lt;div class=&amp;quot;document&amp;quot; id=&amp;quot;emacs-color&amp;quot;&amp;gt;
+
+&amp;lt;img src=&amp;quot;lifesaver.jpg&amp;quot; class=&amp;quot;floatRight&amp;quot; alt=&amp;quot;A picture of a life saver of the Titanic, the later representing about any C++ project...&amp;quot;&amp;gt;
+
+&amp;lt;h1&amp;gt;Life Saver &amp;amp;#8212; Help to the Lisp programmer having to write C++ code&amp;lt;/h1&amp;gt;
+
+
+
+&amp;lt;p&amp;gt;If you have to write a program in C++, condolences.&amp;lt;/p&amp;gt;
+
+
+&amp;lt;p&amp;gt;Now to relieve the pain somewhat, here are some libraries and tools that may be of use.&amp;lt;/p&amp;gt;
+
+
+
+&amp;lt;small&amp;gt;
+&amp;lt;ol&amp;gt;
+&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#openc++&amp;quot;&amp;gt;Metaprogramming: OpenC++&amp;lt;/a&amp;gt;
+&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#lpp&amp;quot;&amp;gt;Sexps and Dynamic Data Structures: Lpp&amp;lt;/a&amp;gt;
+&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#sexp&amp;quot;&amp;gt;Writing Sexp-formated data: Rivest&#039;s SEXP&amp;lt;/a&amp;gt;
+&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#intelib&amp;quot;&amp;gt;Writing Lisp code in C++: InteLib&amp;lt;/a&amp;gt;
+&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#boehmgc&amp;quot;&amp;gt;Garbage Collection: BoehmGC&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
+&amp;lt;/li&amp;gt;
+&amp;lt;/li&amp;gt;
+&amp;lt;/li&amp;gt;
+&amp;lt;/li&amp;gt;
+&amp;lt;/ol&amp;gt;
+&amp;lt;/small&amp;gt;
+
+&amp;lt;p&amp;gt;&amp;lt;small&amp;gt;Colophon: The examples below are taken from the
+documentations of each of these libraries, and are copyrighted by
+their respective authors.  The diagram is linked directly from the
+OpenC++ site.  The Titanic life saver picture has been ruthelessly
+copied from the web.  The examples are formated with the &amp;lt;a href=&amp;quot;http://www.gnu.org/software/emacs&amp;quot;&amp;gt;GNU emacs&amp;lt;/a&amp;gt;&amp;lt;code&amp;gt;htmlize-region&amp;lt;/code&amp;gt; command.&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
+
+
+
+
+
+
+&amp;lt;br&amp;gt;
+&amp;lt;hr&amp;gt;
+&amp;lt;br&amp;gt;&amp;lt;a name=&amp;quot;openc++&amp;quot;&amp;gt;
+&amp;lt;h2&amp;gt;Metaprogramming: OpenC++&amp;lt;/h2&amp;gt;
+
+
+&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;http://www.csg.is.titech.ac.jp/~chiba/openc++.html&amp;quot;&amp;gt;OpenC++&amp;lt;/a&amp;gt;
+is a pre-processor to C++, which extends C++ with a Meta Object
+Protocol (MOP), which allow you to do metaprogramming in a sane way
+(nothing to do with templates and boost hell).&amp;lt;/p&amp;gt;
+
+
+
+&amp;lt;center&amp;gt;
+&amp;lt;img src=&amp;quot;http://www.csg.is.titech.ac.jp/~chiba/opencxx/html/occ.gif&amp;quot; alt=&amp;quot;[metal-level program .cc] --&amp;gt; &amp;lt;OpenC++ compiler&amp;gt; --&amp;gt; &amp;lt;C++ compiler&amp;gt; --&amp;gt; [C++ module .so],[base-level program .cc] --&amp;gt; [OpenC++ compiler] --&amp;gt; [C++ compiler] --&amp;gt; [object .o]&amp;quot;&amp;gt;&amp;lt;/img&amp;gt;
+&amp;lt;/center&amp;gt;
+
+
+
+&amp;lt;blockquote&amp;gt;
+&amp;lt;em&amp;gt;Notice that gcc 4.4.3 on Linux x86_64 can&#039;t compile occ programs:&amp;lt;/em&amp;gt;
+&amp;lt;pre&amp;gt;
+/usr/include/wchar.h:220: parse error before `&amp;quot;wcschr&amp;quot;&#039;
+/usr/include/stdlib.h:525: parse error before `&amp;quot;at_quick_exit&amp;quot;&#039;
+/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.3
+&amp;lt;/pre&amp;gt;
+&amp;lt;em&amp;gt;We&#039;d probably need to use an older gcc.&amp;lt;/em&amp;gt;
+&amp;lt;/blockquote&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;Meta programs have the same form and syntax as normal C++ program,
+the only syntactic extensions being a &amp;lt;em&amp;gt;metaclass&amp;lt;/em&amp;gt; keyword.
+&amp;lt;p&amp;gt;
+
+
+&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;VerboseClass.cc&amp;lt;/code&amp;gt;:
+
+&amp;lt;pre&amp;gt;
+
+&amp;lt;span class=&amp;quot;comment-delimiter&amp;quot;&amp;gt;// &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;VerboseClass.mc
+&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;preprocessor&amp;quot;&amp;gt;#include&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;quot;mop.h&amp;quot;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;class&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;VerboseClass&amp;lt;/span&amp;gt; : &amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;Class&amp;lt;/span&amp;gt; {
+&amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;public&amp;lt;/span&amp;gt;:
+    &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;Ptree&amp;lt;/span&amp;gt;* &amp;lt;span class=&amp;quot;function-name&amp;quot;&amp;gt;TranslateMemberCall&amp;lt;/span&amp;gt;(&amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;Environment&amp;lt;/span&amp;gt;*, &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;Ptree&amp;lt;/span&amp;gt;*, &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;Ptree&amp;lt;/span&amp;gt;*,
+                               &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;Ptree&amp;lt;/span&amp;gt;*, &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;Ptree&amp;lt;/span&amp;gt;*);
+};
+&amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;Ptree&amp;lt;/span&amp;gt;* &amp;lt;span class=&amp;quot;constant&amp;quot;&amp;gt;VerboseClass&amp;lt;/span&amp;gt;::&amp;lt;span class=&amp;quot;function-name&amp;quot;&amp;gt;TranslateMemberCall&amp;lt;/span&amp;gt;(&amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;Environment&amp;lt;/span&amp;gt;* &amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;env&amp;lt;/span&amp;gt;,
+                                         &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;Ptree&amp;lt;/span&amp;gt;* &amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;object&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;Ptree&amp;lt;/span&amp;gt;* &amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;op&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;Ptree&amp;lt;/span&amp;gt;* &amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;member&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;Ptree&amp;lt;/span&amp;gt;* &amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;arglist&amp;lt;/span&amp;gt;)
+{
+    &amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;return&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;constant&amp;quot;&amp;gt;Ptree&amp;lt;/span&amp;gt;::Make(&amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;quot;(puts(\&amp;quot;%p()\&amp;quot;), %p)&amp;quot;&amp;lt;/span&amp;gt;,
+                       member,
+                       &amp;lt;span class=&amp;quot;constant&amp;quot;&amp;gt;Class&amp;lt;/span&amp;gt;::TranslateMemberCall(env, object,
+                                                  op,
+                                                  member, arglist));
+}
+
+&amp;lt;/pre&amp;gt;
+
+
+&amp;lt;code&amp;gt;person.cc&amp;lt;/code&amp;gt;:
+&amp;lt;pre&amp;gt;
+
+&amp;lt;span class=&amp;quot;comment-delimiter&amp;quot;&amp;gt;// &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;person.cc
+&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;preprocessor&amp;quot;&amp;gt;#include&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;amp;lt;stdio.h&amp;amp;gt;&amp;lt;/span&amp;gt;
+metaclass &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;VerboseClass&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;Person&amp;lt;/span&amp;gt;; &amp;lt;span class=&amp;quot;comment-delimiter&amp;quot;&amp;gt;// &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;metaclass declaration
+&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;class&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;Person&amp;lt;/span&amp;gt; {
+&amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;public&amp;lt;/span&amp;gt;:
+    &amp;lt;span class=&amp;quot;function-name&amp;quot;&amp;gt;Person&amp;lt;/span&amp;gt;(&amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;int&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;age&amp;lt;/span&amp;gt;);
+    &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;int&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;function-name&amp;quot;&amp;gt;Age&amp;lt;/span&amp;gt;() { &amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;return&amp;lt;/span&amp;gt; age; }
+    &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;int&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;function-name&amp;quot;&amp;gt;BirthdayComes&amp;lt;/span&amp;gt;() { &amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;return&amp;lt;/span&amp;gt; ++age; }
+    2
+    &amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;private&amp;lt;/span&amp;gt;:
+    &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;int&amp;lt;/span&amp;gt; age;
+};
+&amp;lt;span class=&amp;quot;function-name&amp;quot;&amp;gt;main&amp;lt;/span&amp;gt;()
+{
+    &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;Person&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;billy&amp;lt;/span&amp;gt;(24);
+    printf(&amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;quot;age %d\n&amp;quot;&amp;lt;/span&amp;gt;, billy.Age());
+    printf(&amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;quot;age %d\n&amp;quot;&amp;lt;/span&amp;gt;, billy.BirthdayComes());
+}
+
+&amp;lt;/pre&amp;gt;
+
+
+When compiled with:
+
+&amp;lt;pre&amp;gt;
+
+% occ -m -- -g VerboseClass.mc
+% occ -- -g -o person person.cc
+
+&amp;lt;/pre&amp;gt;
+
+
+produces:
+
+&amp;lt;pre&amp;gt;
+
+% person
+Age()
+age 24
+BirthdayComes()
+age 25
+
+&amp;lt;/pre&amp;gt;
+
+
+&amp;lt;p&amp;gt;It also allow to easily define new control structures (patterned after
+the existing ones) such as:
+
+&amp;lt;pre&amp;gt;
+
+{
+    &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;Matrix&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;m&amp;lt;/span&amp;gt;;
+    m.forall(e){ e = 0.0; }
+}
+
+&amp;lt;/pre&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;Notice that the OpenC++ preprocessor is able to output the syntax
+tree of a C++ source in a processable form!&amp;lt;/p&amp;gt;
+
+
+
+&amp;lt;pre&amp;gt;
+
+% myocc -s person.cc
+[&amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;typedef&amp;lt;/span&amp;gt; [&amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;char&amp;lt;/span&amp;gt;] [* __gnuc_va_list] ;]
+    :
+    :
+[metaclass VerboseClass Person nil ;]
+[[[class Person nil [{ [
+                        [public :]
+                        [nil [Person ( [[[&amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;int&amp;lt;/span&amp;gt;] [i]]] )] [{ [
+                                                            [[age = i] ;]
+                                                            ] }]]
+                        [[&amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;int&amp;lt;/span&amp;gt;] [Age ( nil )] [{ [
+                                                 [&amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;return&amp;lt;/span&amp;gt; age ;]
+                                                 ] }]]
+                        [[&amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;int&amp;lt;/span&amp;gt;] [BirthdayComes ( nil )] [{ [
+                                                           [&amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;return&amp;lt;/span&amp;gt; [++ age] ;]
+                                                           ] }]]
+                        [private :]
+                        [[&amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;int&amp;lt;/span&amp;gt;] [age] ;]
+                        ] }]]] ;]
+[nil nil [main ( nil )] [{ [
+                            [[Person] [billy ( [24] )] ;]
+                            [[printf [( [&amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;quot;age %d\n&amp;quot;&amp;lt;/span&amp;gt; , [billy . Age [( nil )]]] )]] ;]
+                            [[printf [( [&amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;quot;age %d\n&amp;quot;&amp;lt;/span&amp;gt; , [billy . BirthdayComes ...
+                                                       ] }]]
+%
+
+&amp;lt;/pre&amp;gt;
+
+
+
+
+
+
+
+&amp;lt;br&amp;gt;
+&amp;lt;hr&amp;gt;
+&amp;lt;br&amp;gt;&amp;lt;a name=&amp;quot;lpp&amp;quot;&amp;gt;
+&amp;lt;h2&amp;gt;Sexps and Dynamic Data Structures: Lpp&amp;lt;/h2&amp;gt;
+
+
+&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;http://www.interhack.net/projects/lpp/&amp;quot;&amp;gt;Lpp&amp;lt;/a&amp;gt; is a C++
+library of Lisp-like functions and macros, providing the various data
+types commonly found in Lisp, such as symbols, lists, hash-tables,
+etc.
+
+&amp;lt;blockquote&amp;gt;
+&amp;lt;em&amp;gt;Unfortunately, the latest versions of &amp;lt;b&amp;gt;Lpp&amp;lt;/b&amp;gt; (1.21.2 and
+previous) don&#039;t compile with gcc-4.4.3; there are a lot of missing
+extern declarations...&amp;lt;/em&amp;gt;
+&amp;lt;/blockquote&amp;gt;
+
+
+
+
+&amp;lt;pre&amp;gt;
+
+     &amp;lt;span class=&amp;quot;comment-delimiter&amp;quot;&amp;gt;/////////////////////////////////////////////////////////////////&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;     &amp;lt;span class=&amp;quot;comment-delimiter&amp;quot;&amp;gt;// &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;main.cc = Introduction Simple Data Base example.
+&amp;lt;/span&amp;gt;
+&amp;lt;span class=&amp;quot;preprocessor&amp;quot;&amp;gt;     #include&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;amp;lt;Lpp.hh&amp;amp;gt;&amp;lt;/span&amp;gt;
+
+     &amp;lt;span class=&amp;quot;comment-delimiter&amp;quot;&amp;gt;// &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;Data Base class.
+&amp;lt;/span&amp;gt;     &amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;class&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;DataBase&amp;lt;/span&amp;gt; {
+       &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;int&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;size&amp;lt;/span&amp;gt;;
+       &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;let&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;contents&amp;lt;/span&amp;gt;;
+     &amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;public&amp;lt;/span&amp;gt;:
+       &amp;lt;span class=&amp;quot;function-name&amp;quot;&amp;gt;DataBase&amp;lt;/span&amp;gt;();
+       &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;int&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;function-name&amp;quot;&amp;gt;getSize&amp;lt;/span&amp;gt;() {&amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;return&amp;lt;/span&amp;gt; size;}
+       &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;void&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;function-name&amp;quot;&amp;gt;addEntity&amp;lt;/span&amp;gt;(&amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;let&amp;lt;/span&amp;gt;);
+       &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;void&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;function-name&amp;quot;&amp;gt;setValue&amp;lt;/span&amp;gt;(&amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;let&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;let&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;let&amp;lt;/span&amp;gt;);
+       &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;let&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;function-name&amp;quot;&amp;gt;getValue&amp;lt;/span&amp;gt;(&amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;let&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;let&amp;lt;/span&amp;gt;);};
+
+     &amp;lt;span class=&amp;quot;comment-delimiter&amp;quot;&amp;gt;// &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;Data Base constructor.
+&amp;lt;/span&amp;gt;     &amp;lt;span class=&amp;quot;constant&amp;quot;&amp;gt;DataBase&amp;lt;/span&amp;gt;::&amp;lt;span class=&amp;quot;function-name&amp;quot;&amp;gt;DataBase&amp;lt;/span&amp;gt;() {size = 0; contents = makeHashTable();}
+
+     &amp;lt;span class=&amp;quot;comment-delimiter&amp;quot;&amp;gt;// &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;Add an entity to the Data Base.
+&amp;lt;/span&amp;gt;     &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;void&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;constant&amp;quot;&amp;gt;DataBase&amp;lt;/span&amp;gt;::&amp;lt;span class=&amp;quot;function-name&amp;quot;&amp;gt;addEntity&amp;lt;/span&amp;gt;(&amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;let&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;entity&amp;lt;/span&amp;gt;) {
+       &amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;if&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;negation-char&amp;quot;&amp;gt;!&amp;lt;/span&amp;gt;gethash(entity, contents)) {
+         puthash(entity, contents, 0);
+         size++;}}
+
+     &amp;lt;span class=&amp;quot;comment-delimiter&amp;quot;&amp;gt;// &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;Set the value of an attribute for given entity.
+&amp;lt;/span&amp;gt;     &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;void&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;constant&amp;quot;&amp;gt;DataBase&amp;lt;/span&amp;gt;::&amp;lt;span class=&amp;quot;function-name&amp;quot;&amp;gt;setValue&amp;lt;/span&amp;gt;(&amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;let&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;entity&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;let&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;attribute&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;let&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;value&amp;lt;/span&amp;gt;) {
+       &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;let&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;attributes&amp;lt;/span&amp;gt; = gethash(entity, contents);
+       &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;let&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;old&amp;lt;/span&amp;gt; = assoc(attribute, attributes);
+       &amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;if&amp;lt;/span&amp;gt; (old) rplacd(old, value);
+       &amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;else&amp;lt;/span&amp;gt; {
+         push(cons(attribute, value), attributes);
+         puthash(entity, contents, attributes);}}
+
+     &amp;lt;span class=&amp;quot;comment-delimiter&amp;quot;&amp;gt;// &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;Return the value of an attribute for given entity.
+&amp;lt;/span&amp;gt;     &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;let&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;constant&amp;quot;&amp;gt;DataBase&amp;lt;/span&amp;gt;::&amp;lt;span class=&amp;quot;function-name&amp;quot;&amp;gt;getValue&amp;lt;/span&amp;gt;(&amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;let&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;entity&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;let&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;attribute&amp;lt;/span&amp;gt;) {
+       &amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;return&amp;lt;/span&amp;gt; cdr(assoc(attribute, gethash(entity, contents)));}
+
+&amp;lt;/pre&amp;gt;
+
+
+
+
+
+
+&amp;lt;br&amp;gt;
+&amp;lt;hr&amp;gt;
+&amp;lt;br&amp;gt;&amp;lt;a name=&amp;quot;sexp&amp;quot;&amp;gt;
+&amp;lt;h2&amp;gt;Writing Sexp-formated data in C: Rivest&#039;s SEXP&amp;lt;/h2&amp;gt;
+
+
+&amp;lt;p&amp;gt;Ronald L. Rivest&#039;s &amp;lt;a href=&amp;quot;http://people.csail.mit.edu/rivest/sexp.html&amp;quot;&amp;gt;SEXP&amp;lt;/a&amp;gt;
+format writes and reads data in a sexp-like format, with some provision for binary data.
+
+&amp;lt;p&amp;gt;It may be a nice alternative to JSON or XML.   Of course, one can
+always read or parse Common Lisp sexps too.&amp;lt;/p&amp;gt;
+
+
+&amp;lt;p&amp;gt;A short example:
+&amp;lt;pre&amp;gt;
+
+    (6:issuer3:bob)
+
+    (4:icon[12:image/bitmap]9:xxxxxxxxx)
+
+    (7:subject(3:ref5:alice6:mother))
+
+&amp;lt;/pre&amp;gt;
+
+
+
+&amp;lt;br&amp;gt;
+&amp;lt;hr&amp;gt;
+&amp;lt;br&amp;gt;&amp;lt;a name=&amp;quot;intelib&amp;quot;&amp;gt;
+&amp;lt;h2&amp;gt;Writing Lisp code in C++: InteLib&amp;lt;/h2&amp;gt;
+
+
+&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;http://www.intelib.org/&amp;quot;&amp;gt;InteLib&amp;lt;/a&amp;gt; is a C++ library
+allowing us to write dynamic code, using a subset of C++ syntax similar
+to Lisp syntax, without any preprocessing.
+&amp;lt;p&amp;gt;
+
+&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;isomorph.cpp&amp;lt;/code&amp;gt;:
+
+
+&amp;lt;pre&amp;gt;
+
+ &amp;lt;span class=&amp;quot;comment-delimiter&amp;quot;&amp;gt;//       &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;File isomorph.cpp
+&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;preprocessor&amp;quot;&amp;gt; #include&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;amp;lt;intelib/lisp/lisp.hpp&amp;amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;preprocessor&amp;quot;&amp;gt; #include&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;amp;lt;intelib/lisp/lsymbol.hpp&amp;amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;preprocessor&amp;quot;&amp;gt; #include&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;amp;lt;intelib/lfun_std.hpp&amp;amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;preprocessor&amp;quot;&amp;gt; #include&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;amp;lt;intelib/lfun_sel.hpp&amp;amp;gt;&amp;lt;/span&amp;gt;
+
+
+ &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;LSymbol&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;function-name&amp;quot;&amp;gt;ISOMORPHIC&amp;lt;/span&amp;gt;(&amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;quot;ISOMORPHIC&amp;quot;&amp;lt;/span&amp;gt;);
+
+ &amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;static&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;LFunctionalSymbol&amp;lt;/span&amp;gt;&amp;amp;lt;LFunctionDefun&amp;amp;gt; &amp;lt;span class=&amp;quot;function-name&amp;quot;&amp;gt;DEFUN&amp;lt;/span&amp;gt;(&amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;quot;DEFUN&amp;quot;&amp;lt;/span&amp;gt;);
+ &amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;static&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;LFunctionalSymbol&amp;lt;/span&amp;gt;&amp;amp;lt;LFunctionCond&amp;amp;gt; &amp;lt;span class=&amp;quot;function-name&amp;quot;&amp;gt;COND&amp;lt;/span&amp;gt;(&amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;quot;COND&amp;quot;&amp;lt;/span&amp;gt;);
+ &amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;static&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;LFunctionalSymbol&amp;lt;/span&amp;gt;&amp;amp;lt;LFunctionAtom&amp;amp;gt; &amp;lt;span class=&amp;quot;function-name&amp;quot;&amp;gt;ATOM&amp;lt;/span&amp;gt;(&amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;quot;ATOM&amp;quot;&amp;lt;/span&amp;gt;);
+ &amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;static&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;LFunctionalSymbol&amp;lt;/span&amp;gt;&amp;amp;lt;LFunctionAnd&amp;amp;gt; &amp;lt;span class=&amp;quot;function-name&amp;quot;&amp;gt;AND&amp;lt;/span&amp;gt;(&amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;quot;AND&amp;quot;&amp;lt;/span&amp;gt;);
+ &amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;static&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;LFunctionalSymbol&amp;lt;/span&amp;gt;&amp;amp;lt;LFunctionCar&amp;amp;gt; &amp;lt;span class=&amp;quot;function-name&amp;quot;&amp;gt;CAR&amp;lt;/span&amp;gt;(&amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;quot;CAR&amp;quot;&amp;lt;/span&amp;gt;);
+ &amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;static&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;LFunctionalSymbol&amp;lt;/span&amp;gt;&amp;amp;lt;LFunctionCdr&amp;amp;gt; &amp;lt;span class=&amp;quot;function-name&amp;quot;&amp;gt;CDR&amp;lt;/span&amp;gt;(&amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;quot;CDR&amp;quot;&amp;lt;/span&amp;gt;);
+
+ &amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;static&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;LListConstructor&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;L&amp;lt;/span&amp;gt;;
+
+ &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;void&amp;lt;/span&amp;gt; LispInit_isomorphic() {
+   &amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;static&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;LSymbol&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;TREE1&amp;lt;/span&amp;gt;(&amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;quot;TREE1&amp;quot;&amp;lt;/span&amp;gt;);
+   &amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;static&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;LSymbol&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;TREE2&amp;lt;/span&amp;gt;(&amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;quot;TREE2&amp;quot;&amp;lt;/span&amp;gt;);
+   &amp;lt;span class=&amp;quot;comment-delimiter&amp;quot;&amp;gt;////////////////////////////////////////////////&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;   &amp;lt;span class=&amp;quot;comment-delimiter&amp;quot;&amp;gt;//&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;   (L|DEFUN, ISOMORPHIC, (L|TREE1, TREE2),
+     (L|COND,
+       (L|(L|ATOM, TREE1), (L|ATOM, TREE2)),
+       (L|(L|ATOM, TREE2), NIL),
+       (L|T, (L|AND,
+         (L|ISOMORPHIC, (L|CAR, TREE1),
+                        (L|CAR, TREE2)),
+         (L|ISOMORPHIC, (L|CDR, TREE1),
+                        (L|CDR, TREE2))
+   )))).Evaluate();
+   &amp;lt;span class=&amp;quot;comment-delimiter&amp;quot;&amp;gt;//&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;   &amp;lt;span class=&amp;quot;comment-delimiter&amp;quot;&amp;gt;////////////////////////////////////////////////&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; }
+ &amp;lt;span class=&amp;quot;comment-delimiter&amp;quot;&amp;gt;//      &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;end of file
+&amp;lt;/span&amp;gt;&amp;lt;/pre&amp;gt;
+
+
+&amp;lt;code&amp;gt;main.cpp&amp;lt;/code&amp;gt;:
+
+&amp;lt;pre&amp;gt;
+
+ &amp;lt;span class=&amp;quot;comment-delimiter&amp;quot;&amp;gt;// &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;file main.cpp
+&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;preprocessor&amp;quot;&amp;gt; #include&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;amp;lt;stdio.h&amp;amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;preprocessor&amp;quot;&amp;gt; #include&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;amp;lt;stdlib.h&amp;amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;preprocessor&amp;quot;&amp;gt; #include&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;amp;lt;intelib/sexpress/sexpress.hpp&amp;amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;preprocessor&amp;quot;&amp;gt; #include&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;amp;lt;intelib/sexpress/sstring.hpp&amp;amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;preprocessor&amp;quot;&amp;gt; #include&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;amp;lt;intelib/lisp/lsymbol.hpp&amp;amp;gt;&amp;lt;/span&amp;gt;
+
+ &amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;extern&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;LSymbol&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;ISOMORPHIC&amp;lt;/span&amp;gt;;
+ &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;void&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;function-name&amp;quot;&amp;gt;LispInit_isomorphic&amp;lt;/span&amp;gt;();
+
+ &amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;static&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;LListConstructor&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;L&amp;lt;/span&amp;gt;;
+
+ &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;void&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;function-name&amp;quot;&amp;gt;call_isomorph&amp;lt;/span&amp;gt;(&amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;const&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;SReference&amp;lt;/span&amp;gt; &amp;amp;amp;&amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;l1&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;const&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;SReference&amp;lt;/span&amp;gt; &amp;amp;amp;&amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;l2&amp;lt;/span&amp;gt;)
+ {
+     &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;SReference&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;res&amp;lt;/span&amp;gt; = (L|ISOMORPHIC, ~l1, ~l2).Evaluate();
+     printf(&amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;quot;%s ~~ %s : %s\n&amp;quot;&amp;lt;/span&amp;gt;,
+            l1-&amp;amp;gt;TextRepresentation().c_str(),
+            l2-&amp;amp;gt;TextRepresentation().c_str(),
+            res-&amp;amp;gt;TextRepresentation().c_str());
+ }
+
+ &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;int&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;function-name&amp;quot;&amp;gt;main&amp;lt;/span&amp;gt;(&amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;int&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;argc&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;char&amp;lt;/span&amp;gt; *&amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;argv&amp;lt;/span&amp;gt;[])
+ {
+     LispInit_isomorphic();
+     &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;SReference&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;ls1&amp;lt;/span&amp;gt; = (L|(L|1, 2), 3, 4);         &amp;lt;span class=&amp;quot;comment-delimiter&amp;quot;&amp;gt;// &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;((1 2) 3 4)
+&amp;lt;/span&amp;gt;     &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;SReference&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;ls2&amp;lt;/span&amp;gt; = (L|(L|&amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;quot;a&amp;quot;&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;quot;b&amp;quot;&amp;lt;/span&amp;gt;), &amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;quot;c&amp;quot;&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;quot;d&amp;quot;&amp;lt;/span&amp;gt;); &amp;lt;span class=&amp;quot;comment-delimiter&amp;quot;&amp;gt;// &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;((&amp;quot;a&amp;quot; &amp;quot;b&amp;quot;) &amp;quot;c&amp;quot; &amp;quot;d&amp;quot;)
+&amp;lt;/span&amp;gt;     &amp;lt;span class=&amp;quot;type&amp;quot;&amp;gt;SReference&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;variable-name&amp;quot;&amp;gt;ls3&amp;lt;/span&amp;gt; = (L|(L|1, 2), (L|3, 4));     &amp;lt;span class=&amp;quot;comment-delimiter&amp;quot;&amp;gt;// &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;((1 2) (3 4))
+&amp;lt;/span&amp;gt;     call_isomorph(ls1, ls2);
+     call_isomorph(ls1, ls3);
+     &amp;lt;span class=&amp;quot;keyword&amp;quot;&amp;gt;return&amp;lt;/span&amp;gt; 0;
+ }
+ &amp;lt;span class=&amp;quot;comment-delimiter&amp;quot;&amp;gt;// &amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;comment&amp;quot;&amp;gt;end of file
+&amp;lt;/span&amp;gt;&amp;lt;/pre&amp;gt;
+
+
+Compiled with:
+
+&amp;lt;pre&amp;gt;
+
+ g++ -Wall -g isomorph.cpp main.cpp -lintelib -o isomorph &amp;amp;&amp;amp; ./isomorph
+
+&amp;lt;/pre&amp;gt;
+
+
+will produce:
+
+&amp;lt;pre&amp;gt;
+
+ ((1 2) 3 4) ~~ ((&amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;quot;a&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;quot;b&amp;quot;&amp;lt;/span&amp;gt;) &amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;quot;c&amp;quot;&amp;lt;/span&amp;gt; &amp;lt;span class=&amp;quot;string&amp;quot;&amp;gt;&amp;quot;d&amp;quot;&amp;lt;/span&amp;gt;) : T
+ ((1 2) 3 4) ~~ ((1 2) (3 4)) : NIL
+
+&amp;lt;/pre&amp;gt;
+
+
+
+
+
+
+
+&amp;lt;br&amp;gt;
+&amp;lt;hr&amp;gt;
+&amp;lt;br&amp;gt;&amp;lt;a name=&amp;quot;boehmgc&amp;quot;&amp;gt;
+&amp;lt;h2&amp;gt;Garbage Collection: BoehmGC&amp;lt;/h2&amp;gt;
+
+
+&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;http://www.hpl.hp.com/personal/Hans_Boehm/gc/&amp;quot;&amp;gt;BoehmGC&amp;lt;/a&amp;gt;
+is probably the most under-used piece of software worldwide.  It
+should be included in any application written in C or C++.
+
+&amp;lt;/p&amp;gt;
+&amp;lt;/a&amp;gt;&amp;lt;/br&amp;gt;
+&amp;lt;/hr&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/p&amp;gt;
+&amp;lt;/p&amp;gt;
+&amp;lt;/p&amp;gt;
+&amp;lt;/a&amp;gt;&amp;lt;/br&amp;gt;
+&amp;lt;/hr&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/p&amp;gt;
+&amp;lt;/p&amp;gt;
+&amp;lt;/a&amp;gt;&amp;lt;/br&amp;gt;
+&amp;lt;/hr&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/p&amp;gt;
+&amp;lt;/a&amp;gt;&amp;lt;/br&amp;gt;
+&amp;lt;/hr&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/p&amp;gt;
+&amp;lt;/p&amp;gt;
+&amp;lt;/p&amp;gt;
+&amp;lt;/p&amp;gt;
+&amp;lt;/a&amp;gt;&amp;lt;/br&amp;gt;
+&amp;lt;/hr&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/img&amp;gt;
+&amp;lt;/div&amp;gt;
+&amp;lt;/div&amp;gt;
+</description></item><item><dc:identifier>http://www.informatimago.com/articles/cl-types/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>en</dc:language><dc:format>text/html</dc:format><title>Graphs of Common Lisp Types</title><link>http://www.informatimago.com/articles/cl-types/index.html</link><guid isPermaLink="true">http://www.informatimago.com/articles/cl-types/index.html</guid><category>lisp</category><pubDate>Sun, 10 Oct 2010, 10:10:10 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
 &amp;lt;div class=&amp;quot;header&amp;quot;&amp;gt;
 &amp;lt;img src=&amp;quot;http://www.informatimago.com/blog/graph.jpg&amp;quot; height=&amp;quot;100px&amp;quot; class=&amp;quot;floatRight&amp;quot;&amp;gt;&amp;lt;/img&amp;gt;
 &amp;lt;h1&amp;gt;&amp;lt;/h1&amp;gt;
@@ -91,35 +1624,1293 @@ en&amp;lt;/div&amp;gt;
 &amp;lt;p&amp;gt;&amp;lt;small&amp;gt;&amp;lt;a href=&amp;quot;mailto:pjb+blog@informatimago.com&amp;quot;&amp;gt;Pascal J. Bourguignon&amp;lt;/a&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
 &amp;lt;p&amp;gt;&amp;lt;small&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
 &amp;lt;/div&amp;gt;
-en&amp;lt;/div&amp;gt;
-</description></item><item><dc:identifier>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/sedit/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>Common Lisp, Lisp, Sexp, Editor, Structure Editor</dc:language><dc:format>text/html</dc:format><title>A Simple Sexp Structure Editor</title><link>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/sedit/index.html</link><guid isPermaLink="true">http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/sedit/index.html</guid><category>lisp</category><pubDate>Wed, 08 Sep 2010 12:00:00 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
+&amp;lt;div class=&amp;quot;document&amp;quot; id=&amp;quot;cl-types&amp;quot;&amp;gt;
+
+&amp;lt;h1&amp;gt;Graphs of Common Lisp Types&amp;lt;/h1&amp;gt;
+
+
+&amp;lt;p&amp;gt;A newbie asked about the types defined in Common Lisp. There was a
+nice graph of Common Lisp types published some times, but despite my
+google-foo, I couldn&#039;t find it again.  It&#039;s not the first time.  So I
+decided to write a little quick &amp;amp;amp; dirty program to build those
+graphs by introspecting the Common Lisp implementation.&amp;lt;/p&amp;gt;
+
+
+&amp;lt;p&amp;gt;Notice that the graph of type hierarchy depends on the
+implementation, because some type relationships are left to the
+implementations to be defined (eg. the subtypes of FLOAT may all be
+the same, or all distinct, or some combination as long as some order
+on the significant bits they have).&amp;lt;/p&amp;gt;
+
+
+&amp;lt;p&amp;gt;So here is the code of
+&amp;lt;a href=&amp;quot;cl-types-graph.lisp&amp;quot;&amp;gt;cl-types-graph.lisp&amp;lt;/a&amp;gt; which gets all the
+symbols exported from the COMMON-LISP package, and check their subtype
+relationships.&amp;lt;/p&amp;gt;
+
+
+&amp;lt;p&amp;gt;In the case of some implementations such as Clozure or SBCL, any
+symbol denotes a type, so is integrated to the graph, between the NIL
+and T types.  This is not meaningful, so we remove them.&amp;lt;/p&amp;gt;
+
+
+&amp;lt;p&amp;gt;Equivalent type names are drawn in a single box labelled by a list
+containing all the equivalent type names.&amp;lt;/p&amp;gt;
+
+
+&amp;lt;p&amp;gt;Finally, notice that we only consider here the types denoted by a
+single symbol.   The
+&amp;lt;a href=&amp;quot;http://www.lispworks.com/documentation/HyperSpec/Front/index.htm&amp;quot;&amp;gt;
+Common Lisp standard&amp;lt;/a&amp;gt; actually defines families of types denoted by sexps,
+such as &amp;lt;code&amp;gt;(vector 42 single-float)&amp;lt;/code&amp;gt;.
+
+&amp;lt;p&amp;gt;The graph thus obtained is written as a &amp;lt;a href=&amp;quot;http://www.graphviz.org/&amp;quot;&amp;gt;Graphviz&amp;lt;/a&amp;gt; &amp;lt;code&amp;gt;dot&amp;lt;/code&amp;gt; file and
+graphviz &amp;lt;code&amp;gt;tred&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;dot&amp;lt;/code&amp;gt; are used to generate
+the graph image. For example: &amp;lt;/p&amp;gt;
+
+
+&amp;lt;pre&amp;gt;
+    clall &#039;(load &amp;quot;cl-types-graph.lisp&amp;quot;)&#039;
+    for f in cl-types-in-*.dot ; do
+       tred &amp;amp;lt; $f |dot -Tps /dev/stdin &amp;amp;gt; ${f/.dot/.ps}
+    done
+    for f in  cl-types-in-*.ps ; do
+       gsview $f &amp;amp;amp;
+    done
+&amp;lt;/pre&amp;gt;
+
+
+&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;clall&amp;lt;/code&amp;gt; can be get from &amp;lt;a href=&amp;quot;http://tinyurl.com/2urswh9&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt; in &amp;lt;a href=&amp;quot;http://git.informatimago.com/viewgit/index.php?a=summary&amp;amp;p=public/bin&amp;quot;&amp;gt;http://git.informatimago.com/viewgit/index.php?a=summary&amp;amp;amp;p=public/bin&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;
+
+
+
+&amp;lt;p&amp;gt;Finally, you can get the generated graphs to compare the type
+hierarchy of these various implementations:&amp;lt;/p&amp;gt;
+
+
+&amp;lt;table&amp;gt;
+
+
+&amp;lt;tr&amp;gt;
+&amp;lt;th&amp;gt;clisp 2.48&amp;lt;/th&amp;gt;
+&amp;lt;td&amp;gt;&amp;lt;a href=&amp;quot;cl-types-in-clisp.dot&amp;quot;&amp;gt;cl-types-in-clisp.dot&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;
+&amp;lt;td&amp;gt;&amp;lt;a href=&amp;quot;cl-types-in-clisp.ps&amp;quot;&amp;gt;cl-types-in-clisp.ps&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;
+&amp;lt;/tr&amp;gt;
+
+
+&amp;lt;tr&amp;gt;
+&amp;lt;th&amp;gt;Clozure Common Lisp 1.5&amp;lt;/th&amp;gt;
+&amp;lt;td&amp;gt;&amp;lt;a href=&amp;quot;cl-types-in-clozure-common-lisp.dot&amp;quot;&amp;gt;cl-types-in-clozure-common-lisp.dot&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;
+&amp;lt;td&amp;gt;&amp;lt;a href=&amp;quot;cl-types-in-clozure-common-lisp.ps&amp;quot;&amp;gt;cl-types-in-clozure-common-lisp.ps&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;
+&amp;lt;/tr&amp;gt;
+
+
+&amp;lt;tr&amp;gt;
+&amp;lt;th&amp;gt;ecl 9.12.3&amp;lt;/th&amp;gt;
+&amp;lt;td&amp;gt;&amp;lt;a href=&amp;quot;cl-types-in-ecl.dot&amp;quot;&amp;gt;cl-types-in-ecl.dot&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;
+&amp;lt;td&amp;gt;&amp;lt;a href=&amp;quot;cl-types-in-ecl.ps&amp;quot;&amp;gt;cl-types-in-ecl.ps&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;
+&amp;lt;/tr&amp;gt;
+
+
+&amp;lt;tr&amp;gt;
+&amp;lt;th&amp;gt;SBCL 1.0.19-gentoo&amp;lt;/th&amp;gt;
+&amp;lt;td&amp;gt;&amp;lt;a href=&amp;quot;cl-types-in-sbcl.dot&amp;quot;&amp;gt;cl-types-in-sbcl.dot&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;
+&amp;lt;td&amp;gt;&amp;lt;a href=&amp;quot;cl-types-in-sbcl.ps&amp;quot;&amp;gt;cl-types-in-sbcl.ps&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;
+&amp;lt;/tr&amp;gt;
+
+
+&amp;lt;/table&amp;gt;
+
+
+&amp;lt;/p&amp;gt;
+&amp;lt;/div&amp;gt;
+&amp;lt;/div&amp;gt;
+</description></item><item><dc:identifier>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/sedit/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>en</dc:language><dc:format>text/html</dc:format><title>A Simple Sexp Structure Editor</title><link>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/sedit/index.html</link><guid isPermaLink="true">http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/sedit/index.html</guid><category>lisp</category><pubDate>Wed, 08 Sep 2010 12:00:00 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
 &amp;lt;div class=&amp;quot;header&amp;quot;&amp;gt;
 &amp;lt;img src=&amp;quot;http://www.informatimago.com/blog/sedit.jpg&amp;quot; height=&amp;quot;100px&amp;quot; class=&amp;quot;floatRight&amp;quot;&amp;gt;&amp;lt;/img&amp;gt;
 &amp;lt;h1&amp;gt;Sexp Edit&amp;lt;/h1&amp;gt;
 &amp;lt;p&amp;gt;A simple sexp structure editor to demonstrate how we can edit lisp sources directly.&amp;lt;/p&amp;gt;
 &amp;lt;p&amp;gt;&amp;lt;small&amp;gt;&amp;lt;a href=&amp;quot;mailto:pjb+blog@informatimago.com&amp;quot;&amp;gt;Pascal J. Bourguignon&amp;lt;/a&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
-&amp;lt;p&amp;gt;&amp;lt;small&amp;gt;A Simple Sexp Structure Editor.&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
+&amp;lt;p&amp;gt;&amp;lt;small&amp;gt;Common Lisp, Lisp, Sexp, Editor, Structure Editor&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
+&amp;lt;/div&amp;gt;
+&amp;lt;div class=&amp;quot;document&amp;quot; id=&amp;quot;sedit&amp;quot;&amp;gt;
+
+
+&amp;lt;h1&amp;gt;A Simple Sexp Structure Editor&amp;lt;/h1&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;This is a simple sexp structure editor to demonstrate how we can
+     edit lisp sources directly instead of going thru the
+     deserialization and serialization (converting the sexps into a
+     textual representation and using a text editor such as emacs).
+&amp;lt;p&amp;gt;
+
+
+&amp;lt;p&amp;gt;This editor manipulates directly the sexp data structure.&amp;lt;/p&amp;gt;
+
+
+
+
+&amp;lt;ul&amp;gt;
+
+
+
+&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;sedit.lisp&amp;quot;&amp;gt;sedit.lisp&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
+
+
+
+&amp;lt;/ul&amp;gt;
+
+
+
+
+
+&amp;lt;p&amp;gt;It is invoked as (sedit sexp), and returns the modified sexp.
+     (The sexp is modified destructively).&amp;lt;/p&amp;gt;
+
+
+
+&amp;lt;pre class=&amp;quot;command&amp;quot;&amp;gt;
+ (sedit (copy-tree &#039;(an example)))
+  &amp;lt;/pre&amp;gt;
+
+
+
+&amp;lt;p&amp;gt;At each interaction loop, it prints the whole sexp, showing the selected
+    sub-sexp, and query a command. The list of commands are:&amp;lt;/p&amp;gt;
+
+
+
+&amp;lt;ul&amp;gt;
+
+
+
+&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt; q quit               &amp;lt;/tt&amp;gt; to return the modified sexp from sedit.
+
+&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt; i in                 &amp;lt;/tt&amp;gt; to enter inside the selected list.
+
+&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt; o out                &amp;lt;/tt&amp;gt; to select the list containing the selection.
+
+&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt; f forward n next     &amp;lt;/tt&amp;gt; to select the sexp following the selection (or out).
+
+&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt; b backward p previous&amp;lt;/tt&amp;gt; to select the sexp preceding the selection (or out).
+
+&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt; s insert             &amp;lt;/tt&amp;gt; to insert a new sexp before the selection.
+
+&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt; r replace            &amp;lt;/tt&amp;gt; to replace the selection with a new sexp.
+
+&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt; a add                &amp;lt;/tt&amp;gt; to add a new sexp after the selection.
+
+&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt; x cut                &amp;lt;/tt&amp;gt; to cut the selection into a *clipboard*.
+
+&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt; c copy               &amp;lt;/tt&amp;gt; to copy the selection into a *clipboard*.
+
+&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt; y paste              &amp;lt;/tt&amp;gt; to paste the *clipboard* replacing the selection.
+  &amp;lt;/li&amp;gt;
+&amp;lt;/li&amp;gt;
+&amp;lt;/li&amp;gt;
+&amp;lt;/li&amp;gt;
+&amp;lt;/li&amp;gt;
+&amp;lt;/li&amp;gt;
+&amp;lt;/li&amp;gt;
+&amp;lt;/li&amp;gt;
+&amp;lt;/li&amp;gt;
+&amp;lt;/li&amp;gt;
+&amp;lt;/li&amp;gt;
+&amp;lt;/ul&amp;gt;
+
+
+
+  Example:
+
+&amp;lt;pre class=&amp;quot;dribble&amp;quot;&amp;gt;
+
+C/IBCL-USER[4]&amp;amp;gt; (sedit &#039;())
+
+Sexp Editor:
+&amp;#227;&amp;#128;&amp;#144;NIL&amp;#227;&amp;#128;&amp;#145;
+&amp;amp;gt; r
+replacement sexp: (let ((*package #.*package*)) (print &#039;hello))
+&amp;#227;&amp;#128;&amp;#144;(LET ((*PACKAGE #&amp;amp;lt;PACKAGE IMAGE-BASED-COMMON-LISP-USER&amp;amp;gt;)) (PRINT (QUOTE HELLO)))&amp;#227;&amp;#128;&amp;#145;
+&amp;amp;gt; i
+(&amp;#227;&amp;#128;&amp;#144;LET&amp;#227;&amp;#128;&amp;#145; ((*PACKAGE #&amp;amp;lt;PACKAGE IMAGE-BASED-COMMON-LISP-USER&amp;amp;gt;)) (PRINT (QUOTE HELLO)))
+&amp;amp;gt; n
+(LET &amp;#227;&amp;#128;&amp;#144;((*PACKAGE #&amp;amp;lt;PACKAGE IMAGE-BASED-COMMON-LISP-USER&amp;amp;gt;))&amp;#227;&amp;#128;&amp;#145; (PRINT (QUOTE HELLO)))
+&amp;amp;gt; i
+(LET (&amp;#227;&amp;#128;&amp;#144;(*PACKAGE #&amp;amp;lt;PACKAGE IMAGE-BASED-COMMON-LISP-USER&amp;amp;gt;)&amp;#227;&amp;#128;&amp;#145;) (PRINT (QUOTE HELLO)))
+&amp;amp;gt; i
+(LET ((&amp;#227;&amp;#128;&amp;#144;*PACKAGE&amp;#227;&amp;#128;&amp;#145; #&amp;amp;lt;PACKAGE IMAGE-BASED-COMMON-LISP-USER&amp;amp;gt;)) (PRINT (QUOTE HELLO)))
+&amp;amp;gt; r
+replacement sexp: *package*
+(LET ((&amp;#227;&amp;#128;&amp;#144;*PACKAGE*&amp;#227;&amp;#128;&amp;#145; #&amp;amp;lt;PACKAGE IMAGE-BASED-COMMON-LISP-USER&amp;amp;gt;)) (PRINT (QUOTE HELLO)))
+&amp;amp;gt; q
+(LET ((*PACKAGE* #&amp;amp;lt;PACKAGE IMAGE-BASED-COMMON-LISP-USER&amp;amp;gt;)) (PRINT &#039;HELLO))
+C/IBCL-USER[5]&amp;amp;gt; (eval *)
+
+HELLO
+HELLO
+C/IBCL-USER[6]&amp;amp;gt;
+
+  &amp;lt;/pre&amp;gt;
+&amp;lt;/p&amp;gt;
+&amp;lt;/p&amp;gt;
+&amp;lt;/div&amp;gt;
 &amp;lt;/div&amp;gt;
-en&amp;lt;/div&amp;gt;
-</description></item><item><dc:identifier>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/rpsls/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>Common Lisp, Lisp, game, Rock, Paper, Scissors, Gun, Dynamite, Nuke, Lightning, Devil, Dragon, Alien, Water, Bowl, Air, Moon, Sponge, Wolf, Cockroach, Tree, Man, Woman, Monkey, Snake, Axe, Fire, Sun, Lisard, Lizard, Spock</dc:language><dc:format>text/html</dc:format><title>Rock, Paper, Scissors, Gun, Dynamite, Nuke, Lightning, Devil, Dragon, Alien, Water, Bowl, Air, Moon, Sponge, Wolf, Cockroach, Tree, Man, Woman, Monkey, Snake, Axe, Fire, Sun</title><link>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/rpsls/index.html</link><guid isPermaLink="true">http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/rpsls/index.html</guid><category>lisp</category><pubDate>Sat, 17 Jul 2010 12:00:00 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
+</description></item><item><dc:identifier>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/rpsls/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>en</dc:language><dc:format>text/html</dc:format><title>Rock, Paper, Scissors, Gun, Dynamite, Nuke, Lightning, Devil, Dragon, Alien, Water, Bowl, Air, Moon, Sponge, Wolf, Cockroach, Tree, Man, Woman, Monkey, Snake, Axe, Fire, Sun</title><link>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/rpsls/index.html</link><guid isPermaLink="true">http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/rpsls/index.html</guid><category>lisp</category><pubDate>Sat, 17 Jul 2010 12:00:00 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
 &amp;lt;div class=&amp;quot;header&amp;quot;&amp;gt;
 &amp;lt;img src=&amp;quot;http://www.informatimago.com/blog/rps.png&amp;quot; height=&amp;quot;100px&amp;quot; class=&amp;quot;floatRight&amp;quot;&amp;gt;&amp;lt;/img&amp;gt;
 &amp;lt;h1&amp;gt;Rock, Paper, Scissors, Gun, Dynamite, Nuke, Lightning, Devil, Dragon, Alien, Water, Bowl, Air, Moon, Sponge, Wolf, Cockroach, Tree, Man, Woman, Monkey, Snake, Axe, Fire, Sun&amp;lt;/h1&amp;gt;
 &amp;lt;p&amp;gt;A little program implementing Rock, Paper, Scissor style games.&amp;lt;/p&amp;gt;
 &amp;lt;p&amp;gt;&amp;lt;small&amp;gt;&amp;lt;a href=&amp;quot;mailto:pjb+blog@informatimago.com&amp;quot;&amp;gt;Pascal J. Bourguignon&amp;lt;/a&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
-&amp;lt;p&amp;gt;&amp;lt;small&amp;gt;Rock, Paper, Scissors, Gun, Dynamite, Nuke, Lightning, Devil, Dragon, Alien, Water, Bowl, Air, Moon, Sponge, Wolf, Cockroach, Tree, Man, Woman, Monkey, Snake, Axe, Fire, Sun, Lisard, Lizard, Spock&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
+&amp;lt;p&amp;gt;&amp;lt;small&amp;gt;Common Lisp, Lisp, game, Rock, Paper, Scissors, Gun, Dynamite, Nuke, Lightning, Devil, Dragon, Alien, Water, Bowl, Air, Moon, Sponge, Wolf, Cockroach, Tree, Man, Woman, Monkey, Snake, Axe, Fire, Sun, Lisard, Lizard, Spock&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
 &amp;lt;/div&amp;gt;
-en&amp;lt;/div&amp;gt;
-</description></item><item><dc:identifier>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/playtomo-stonedge/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>Common Lisp, Lisp, game, playtomo, stonedge, solver</dc:language><dc:format>text/html</dc:format><title>Playtomo Stonedge Game</title><link>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/playtomo-stonedge/index.html</link><guid isPermaLink="true">http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/playtomo-stonedge/index.html</guid><category>lisp</category><pubDate>Fri, 09 Jul 2010 12:00:00 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
+&amp;lt;div class=&amp;quot;document&amp;quot; id=&amp;quot;rpsls&amp;quot;&amp;gt;
+
+
+&amp;lt;h1&amp;gt;Rock, Paper, Scissors, Gun, Dynamite, Nuke, Lightning, Devil, Dragon, Alien, Water, Bowl, Air, Moon, Sponge, Wolf, Cockroach, Tree, Man, Woman, Monkey, Snake, Axe, Fire, Sun&amp;lt;/h1&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;This little program implements Rock, Paper, Scissor style games.&amp;lt;/p&amp;gt;
+
+
+
+&amp;lt;p&amp;gt;Graphs are defined for:&amp;lt;/p&amp;gt;
+
+
+
+&amp;lt;ul&amp;gt;
+
+
+
+&amp;lt;li&amp;gt;Rock, Paper, Scissor;&amp;lt;/li&amp;gt;
+
+
+
+&amp;lt;li&amp;gt;Rock, Paper, Scissor, Lizard, Spock; and&amp;lt;/li&amp;gt;
+
+
+
+&amp;lt;li&amp;gt;Rock, Paper, Scissors, Gun, Dynamite, Nuke, Lightning, Devil, Dragon, Alien, Water, Bowl, Air, Moon, Sponge, Wolf, Cockroach, Tree, Man, Woman, Monkey, Snake, Axe, Fire, Sun. (see the &amp;lt;a href=&amp;quot;rpsls-25.jpg&amp;quot;&amp;gt;table&amp;lt;/a&amp;gt;)&amp;lt;/li&amp;gt;
+
+
+
+&amp;lt;/ul&amp;gt;
+
+
+
+
+&amp;lt;ul&amp;gt;
+
+
+
+&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;rpsls.lisp&amp;quot;&amp;gt;rpsls.lisp&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
+
+
+
+&amp;lt;/ul&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;Example:&amp;lt;/p&amp;gt;
+
+
+
+&amp;lt;pre class=&amp;quot;dribble&amp;quot;&amp;gt;
+CL-USER&amp;amp;gt; (RPSLS:main RPSLS::*rock-paper-scissors-gun-dynamite-nuke-lightning-devil-dragon-alien-water-bowl-air-moon-sponge-wolf-cockroach-tree-man-woman-monkey-snake-axe-fire-sun*)
+Please choose an item amongst:
+  quit air alien axe bowl cockroach devil dragon dynamite fire gun lightning man monkey moon nuke paper rock scissors snake sponge sun tree water wolf woman
+&amp;amp;gt; air
+You chose AIR.
+Computer chose MAN.
+Man breathes air.
+Therefore you lose.
+
+Please choose an item amongst:
+  quit air alien axe bowl cockroach devil dragon dynamite fire gun lightning man monkey moon nuke paper rock scissors snake sponge sun tree water wolf woman
+&amp;amp;gt; man
+You chose MAN.
+Computer chose MOON.
+Man travels to moon.
+Therefore you win.
+
+Please choose an item amongst:
+  quit air alien axe bowl cockroach devil dragon dynamite fire gun lightning man monkey moon nuke paper rock scissors snake sponge sun tree water wolf woman
+&amp;amp;gt; moon
+You chose MOON.
+Computer chose WATER.
+Moon has no water.
+Therefore you win.
+
+Please choose an item amongst:
+  quit air alien axe bowl cockroach devil dragon dynamite fire gun lightning man monkey moon nuke paper rock scissors snake sponge sun tree water wolf woman
+&amp;amp;gt; water
+You chose WATER.
+Computer chose WOLF.
+Wolf drinks water.
+Therefore you lose.
+
+Please choose an item amongst:
+  quit air alien axe bowl cockroach devil dragon dynamite fire gun lightning man monkey moon nuke paper rock scissors snake sponge sun tree water wolf woman
+&amp;amp;gt; wolf
+You chose WOLF.
+Computer chose FIRE.
+Fire burns wolf.
+Therefore you lose.
+
+Please choose an item amongst:
+  quit air alien axe bowl cockroach devil dragon dynamite fire gun lightning man monkey moon nuke paper rock scissors snake sponge sun tree water wolf woman
+&amp;amp;gt; quit
+You      won 2 of 6 games.
+Computer won 3 of 6 games.
+2
+3
+1
+6
+CL-USER&amp;amp;gt;
+  &amp;lt;/pre&amp;gt;
+&amp;lt;/div&amp;gt;
+&amp;lt;/div&amp;gt;
+</description></item><item><dc:identifier>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/playtomo-stonedge/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>en</dc:language><dc:format>text/html</dc:format><title>Playtomo Stonedge Game</title><link>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/playtomo-stonedge/index.html</link><guid isPermaLink="true">http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/playtomo-stonedge/index.html</guid><category>lisp</category><pubDate>Fri, 09 Jul 2010 12:00:00 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
 &amp;lt;div class=&amp;quot;header&amp;quot;&amp;gt;
 &amp;lt;img src=&amp;quot;http://www.informatimago.com/blog/stoneedge.jpg&amp;quot; height=&amp;quot;100px&amp;quot; class=&amp;quot;floatRight&amp;quot;&amp;gt;&amp;lt;/img&amp;gt;
 &amp;lt;h1&amp;gt;An implementation of the Playtomo Stonedge game, with its solver&amp;lt;/h1&amp;gt;
 &amp;lt;p&amp;gt;An implementation of the Playtomo Stonedge Game, and its solver.&amp;lt;/p&amp;gt;
 &amp;lt;p&amp;gt;&amp;lt;small&amp;gt;&amp;lt;a href=&amp;quot;mailto:pjb+blog@informatimago.com&amp;quot;&amp;gt;Pascal J. Bourguignon&amp;lt;/a&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
-&amp;lt;p&amp;gt;&amp;lt;small&amp;gt;An implementation of the Playtomo Stonedge game, with its solver.&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
+&amp;lt;p&amp;gt;&amp;lt;small&amp;gt;Common Lisp, Lisp, game, playtomo, stonedge, solver&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
 &amp;lt;/div&amp;gt;
-en&amp;lt;/div&amp;gt;
-</description></item><item><dc:identifier>http://www.informatimago.com/articles/ffn=-n/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language><nil/></dc:language><dc:format>text/html</dc:format><title>f(f(n)) = -n</title><link>http://www.informatimago.com/articles/ffn=-n/index.html</link><guid isPermaLink="true">http://www.informatimago.com/articles/ffn=-n/index.html</guid><category>lisp</category><pubDate>Tue, 09 Mar 2008 12:00:00 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
+&amp;lt;div class=&amp;quot;document&amp;quot; id=&amp;quot;playtomo-stonedge&amp;quot;&amp;gt;
+
+
+&amp;lt;h1&amp;gt;An implementation of the Playtomo Stonedge game, with its solver&amp;lt;/h1&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;This is an implementation of the Playtomo Stonedge Game, and its
+     solver.
+     See &amp;lt;a href=&amp;quot;http://www.playtomo.com/&amp;quot;&amp;gt;http://www.playtomo.com/&amp;lt;/a&amp;gt;
+     (not much here when I went); Download the playtomo games on
+     BlackBerry.
+
+
+
+&amp;lt;ul&amp;gt;
+
+
+
+&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;playtomo-stonedge.lisp&amp;quot;&amp;gt;playtomo-stonedge.lisp&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
+
+
+
+&amp;lt;/ul&amp;gt;
+
+
+  &amp;lt;/p&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;Playtomo&#039;s implementation is nicer (graphical), but here, we
+     provide a solver that will find all the solutions to a given
+     level. &amp;lt;strong&amp;gt;Even nicer!&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;
+
+
+
+
+&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;
+                  +---+
+block             |BBB|
+                  +---+
+empty cell        |   |
+                  +---+
+solid cell        |SSS|
+                  +---+
+red button cell   |[R]|
+                  +---+
+blue button cell  |[B]|
+                  +---+
+ice cell          |,,,|
+                  +---+
+target cell       |TTT|
+                  +---+
+closed door       | / |
+                  +---+
+open door         |---|
+                  +---+
+&amp;lt;/pre&amp;gt;
+
+
+
+
+
+&amp;lt;p&amp;gt;To move the block, use:&amp;lt;/p&amp;gt;
+
+
+
+&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;
+      8           i
+    4   6   or  j   l
+      2           k
+  &amp;lt;/pre&amp;gt;
+
+
+
+
+
+&amp;lt;p&amp;gt;Example:&amp;lt;/p&amp;gt;
+
+
+
+&amp;lt;pre class=&amp;quot;dribble&amp;quot;&amp;gt;
+CL-USER&amp;amp;gt; (stonedge *level-39*)
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|[B]| / |[R]| / |CCC|[R]|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   | / |SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |,,,|SSS|   |   |   |SSS|TTT|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |BBB|SSS|   |   |   |CCC|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |SSS|CCC|SSS|CCC|SSS|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+Your move: 8
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|[B]| / |[R]| / |CCC|[R]|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   | / |SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |BBB|   |   |   |   |   |SSS|SSS|   |   |
++---+---+---+---+BBB+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |BBB|SSS|   |   |   |SSS|TTT|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|SSS|   |   |   |CCC|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |SSS|CCC|SSS|CCC|SSS|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+Your move: 8
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|[B]| / |[R]| / |CCC|[R]|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |BBB|   |   |   |   |   | / |SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |,,,|SSS|   |   |   |SSS|TTT|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|SSS|   |   |   |CCC|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |SSS|CCC|SSS|CCC|SSS|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+Your move: 8
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|[B]| / |[R]| / |CCC|[R]|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|BBB|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+BBB+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |BBB|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   | / |SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |,,,|SSS|   |   |   |SSS|TTT|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|SSS|   |   |   |CCC|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |SSS|CCC|SSS|CCC|SSS|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+Your move: 8
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|BBB|---|[R]| / |CCC|[R]|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   | / |SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |,,,|SSS|   |   |   |SSS|TTT|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|SSS|   |   |   |CCC|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |SSS|CCC|SSS|CCC|SSS|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+Your move: 6
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|[B]|BBBBBBB|---|CCC|[R]|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   | / |SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |,,,|SSS|   |   |   |SSS|TTT|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|SSS|   |   |   |CCC|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |SSS|CCC|SSS|CCC|SSS|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+Your move: 6
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|[B]|---|[R]|BBB|CCC|[R]|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   | / |SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |,,,|SSS|   |   |   |SSS|TTT|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|SSS|   |   |   |CCC|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |SSS|CCC|SSS|CCC|SSS|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+Your move: 6
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|[B]|---|[R]|---|BBBBBBB|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |---|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |,,,|SSS|   |   |   |SSS|TTT|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|SSS|   |   |   |CCC|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |SSS|CCC|SSS|CCC|SSS|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+Your move: 4
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|[B]|---|[R]|BBB|   |[R]|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |---|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |,,,|SSS|   |   |   |SSS|TTT|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|SSS|   |   |   |CCC|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |SSS|CCC|SSS|CCC|SSS|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+Your move: 4
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|[B]|BBBBBBB| / |   |[R]|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |---|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |,,,|SSS|   |   |   |SSS|TTT|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|SSS|   |   |   |CCC|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |SSS|CCC|SSS|CCC|SSS|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+Your move: 4
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|BBB| / |[R]| / |   |[R]|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |---|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |,,,|SSS|   |   |   |SSS|TTT|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|SSS|   |   |   |CCC|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |SSS|CCC|SSS|CCC|SSS|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+Your move: 4
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |BBBBBBB|[B]| / |[R]| / |   |[R]|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |---|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |,,,|SSS|   |   |   |SSS|TTT|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|SSS|   |   |   |CCC|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |SSS|CCC|SSS|CCC|SSS|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+Your move: 2
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|[B]| / |[R]| / |   |[R]|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |BBBBBBB|SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |---|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |,,,|SSS|   |   |   |SSS|TTT|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|SSS|   |   |   |CCC|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |SSS|CCC|SSS|CCC|SSS|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+Your move: 6
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|[B]| / |[R]| / |   |[R]|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|BBB|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |---|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |,,,|SSS|   |   |   |SSS|TTT|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|SSS|   |   |   |CCC|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |SSS|CCC|SSS|CCC|SSS|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+Your move: 2
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|[B]| / |[R]| / |   |[R]|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |BBB|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+BBB+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |BBB|   |   |   |   |   |---|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |,,,|SSS|   |   |   |SSS|TTT|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|SSS|   |   |   |CCC|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |SSS|CCC|SSS|CCC|SSS|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+Your move: 2
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|[B]| / |[R]| / |   |[R]|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |---|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |BBB|   |   |   |   |   |SSS|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |,,,|SSS|   |   |   |SSS|TTT|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|SSS|   |   |   |CCC|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |SSS|CCC|SSS|CCC|SSS|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+Your move: 2
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|[B]| / |[R]| / |   |[R]|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |---|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |BBB|SSS|   |   |   |SSS|TTT|SSS|   |   |
++---+---+---+---+BBB+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |BBB|SSS|   |   |   |CCC|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |SSS|CCC|SSS|CCC|SSS|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+Your move: 6
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|[B]| / |[R]| / |   |[R]|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |---|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |,,,|BBB|   |   |   |SSS|TTT|SSS|   |   |
++---+---+---+---+---+BBB+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|BBB|   |   |   |CCC|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |SSS|CCC|SSS|CCC|SSS|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+Your move: 2
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|[B]| / |[R]| / |   |[R]|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |---|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |,,,|SSS|   |   |   |SSS|TTT|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|SSS|   |   |   |CCC|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |BBB|CCC|SSS|CCC|SSS|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+Your move: 6
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|[B]| / |[R]| / |   |[R]|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |---|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |,,,|SSS|   |   |   |SSS|TTT|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|SSS|   |   |   |CCC|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |SSS|BBBBBBB|CCC|SSS|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+Your move: 6
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|[B]| / |[R]| / |   |[R]|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |---|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |,,,|SSS|   |   |   |SSS|TTT|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|SSS|   |   |   |CCC|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |SSS|   |SSS|BBB|SSS|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+Your move: 6
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|[B]| / |[R]| / |   |[R]|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |---|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |,,,|SSS|   |   |   |SSS|TTT|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|SSS|   |   |   |CCC|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |SSS|   |SSS|   |BBBBBBB|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+Your move: 8
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|[B]| / |[R]| / |   |[R]|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |---|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |,,,|SSS|   |   |   |SSS|TTT|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|SSS|   |   |   |BBBBBBB|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |SSS|   |SSS|   |SSS|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+Your move: 8
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|[B]| / |[R]| / |   |[R]|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |---|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |,,,|SSS|   |   |   |BBBBBBB|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|SSS|   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |SSS|   |SSS|   |SSS|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+Your move: 6
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|[B]| / |[R]| / |   |[R]|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |---|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |,,,|SSS|   |   |   |SSS|TTT|BBB|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|SSS|   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |SSS|   |SSS|   |SSS|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+Your move: 8
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|[B]| / |[R]| / |   |[R]|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |---|BBB|   |   |
++---+---+---+---+---+---+---+---+---+---+---+BBB+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|BBB|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |,,,|SSS|   |   |   |SSS|TTT|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|SSS|   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |SSS|   |SSS|   |SSS|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+Your move: 4
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|[B]| / |[R]| / |   |[R]|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |,,,|,,,|SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |BBB|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+BBB+---+---+---+
+|   |   |   |   |SSS|   |   |   |   |   |BBB|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |,,,|SSS|   |   |   |SSS|TTT|SSS|   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |SSS|SSS|   |   |   |   |SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |SSS|   |SSS|   |SSS|SSS|   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+Your move: 2
+
+You win!
+
+; No value
+CL-USER&amp;amp;gt; (solve-problem *level-39*)
+
+(NUMBER OF STATES = 990)
+((:WIN 10 5 10 5 :CLOSED :CLOSED :CLOSED :CLOSED :CLOSED :CLOSED :OPEN)
+ (:FRONT :FRONT :FRONT :FRONT :RIGHT :RIGHT :RIGHT :LEFT :LEFT :LEFT :LEFT
+  :BACK :RIGHT :BACK :BACK :BACK :RIGHT :BACK :RIGHT :RIGHT :RIGHT :FRONT
+  :FRONT :RIGHT :FRONT :LEFT :BACK))
+((:WIN 10 5 10 5 :OPEN :CLOSED :CLOSED :CLOSED :CLOSED :CLOSED :OPEN)
+ (:FRONT :FRONT :FRONT :FRONT :RIGHT :RIGHT :RIGHT :LEFT :LEFT :LEFT :LEFT
+  :RIGHT :LEFT :BACK :RIGHT :BACK :BACK :BACK :RIGHT :BACK :RIGHT :RIGHT :RIGHT
+  :FRONT :FRONT :RIGHT :FRONT :LEFT :BACK))
+((:WIN 10 5 10 5 :CLOSED :CLOSED :OPEN :CLOSED :CLOSED :CLOSED :OPEN)
+ (:FRONT :FRONT :FRONT :FRONT :RIGHT :RIGHT :RIGHT :LEFT :LEFT :LEFT :LEFT
+  :RIGHT :RIGHT :LEFT :LEFT :BACK :RIGHT :BACK :BACK :BACK :RIGHT :BACK :RIGHT
+  :RIGHT :RIGHT :FRONT :FRONT :RIGHT :FRONT :LEFT :BACK))
+((:WIN 10 5 10 5 :OPEN :CLOSED :OPEN :CLOSED :CLOSED :CLOSED :OPEN)
+ (:FRONT :FRONT :FRONT :FRONT :RIGHT :RIGHT :RIGHT :LEFT :LEFT :LEFT :LEFT
+  :RIGHT :RIGHT :LEFT :LEFT :RIGHT :LEFT :BACK :RIGHT :BACK :BACK :BACK :RIGHT
+  :BACK :RIGHT :RIGHT :RIGHT :FRONT :FRONT :RIGHT :FRONT :LEFT :BACK))
+Real time: 0.288899 sec.
+Run time: 0.288956 sec.
+Space: 6520144 Bytes
+GC: 1, GC time: 0.009999 sec.
+NIL
+CL-USER&amp;amp;gt;
+  &amp;lt;/pre&amp;gt;
+&amp;lt;/div&amp;gt;
+&amp;lt;/div&amp;gt;
+</description></item><item><dc:identifier>http://www.informatimago.com/articles/ffn=-n/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>en</dc:language><dc:format>text/html</dc:format><title>f(f(n)) = -n</title><link>http://www.informatimago.com/articles/ffn=-n/index.html</link><guid isPermaLink="true">http://www.informatimago.com/articles/ffn=-n/index.html</guid><category>lisp</category><pubDate>Tue, 09 Mar 2008 12:00:00 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
 &amp;lt;div class=&amp;quot;header&amp;quot;&amp;gt;
 &amp;lt;img src=&amp;quot;http://www.informatimago.com/blog/ffn=-n.jpg&amp;quot; height=&amp;quot;100px&amp;quot; class=&amp;quot;floatRight&amp;quot;&amp;gt;&amp;lt;/img&amp;gt;
 &amp;lt;h1&amp;gt;&amp;lt;/h1&amp;gt;
@@ -127,18 +2918,509 @@ en&amp;lt;/div&amp;gt;
 &amp;lt;p&amp;gt;&amp;lt;small&amp;gt;&amp;lt;a href=&amp;quot;mailto:pjb+blog@informatimago.com&amp;quot;&amp;gt;Pascal J. Bourguignon&amp;lt;/a&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
 &amp;lt;p&amp;gt;&amp;lt;small&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
 &amp;lt;/div&amp;gt;
-en&amp;lt;/div&amp;gt;
-</description></item><item><dc:identifier>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/m-expression/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>LISP, Common Lisp, M-Expressions</dc:language><dc:format>text/html</dc:format><title>A Parser for M-Expressions</title><link>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/m-expression/index.html</link><guid isPermaLink="true">http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/m-expression/index.html</guid><category>lisp</category><pubDate>Thu, 28 Sep 2006 12:00:00 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
+&amp;lt;div class=&amp;quot;document&amp;quot; id=&amp;quot;ffn=-n&amp;quot;&amp;gt;
+&amp;lt;h1&amp;gt;f(f(n)) = -n&amp;lt;/h1&amp;gt;
+
+
+&amp;lt;p&amp;gt;In a comment to Steve Yegge&#039;s blog &amp;lt;a href=&amp;quot;http://steve-yegge.blogspot.com/2008/02/portrait-of-n00b.html&amp;quot;&amp;gt;
+   http://steve-yegge.blogspot.com/2008/02/portrait-of-n00b.html&amp;lt;/a&amp;gt;,&amp;lt;/p&amp;gt;
+
+
+&amp;lt;blockquote&amp;gt;
+
+
+
+&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;&amp;lt;a href=&amp;quot;http://www.blogger.com/profile/13466586996802181998&amp;quot;&amp;gt;Vlad Patryshev&amp;lt;/a&amp;gt; said...&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;
+
+
+
+&amp;lt;p&amp;gt;Tactically, you are very right. Strategically... I don&#039;t know. You
+       mix two things together, strict typing in general, abuse of UML and
+       class hierarchy, and overuse of strict typing where it is not
+       necessary (I mean JavaScript).&amp;lt;/p&amp;gt;
+
+
+
+&amp;lt;p&amp;gt;Regarding class structures - it&#039;s probably hard to force people
+       that love bureaucracy not to fill their code with Managers,
+       Handlers, Helpers, and the like (none of these does any work, but
+       they pass it around, like in real life). But I&#039;m afraid this
+       anti-bureaucratic rant has nothing to do with the issue of modeling
+       in general.&amp;lt;/p&amp;gt;
+
+
+
+&amp;lt;p&amp;gt;I&#039;ll give you one example, an interview problem. Write a function f
+       on 32-bit integers that, applied twice, it negates the
+       integer. f(f(n)) = -n.&amp;lt;/p&amp;gt;
+
+
+
+&amp;lt;p&amp;gt;Try to solve it without any kind of model, by just applying
+       randomly ad-hoc xors and shifts.&amp;lt;/p&amp;gt;
+
+
+
+&amp;lt;p&amp;gt;9:00 PM, February 11, 2008&amp;lt;/p&amp;gt;
+
+
+&amp;lt;/blockquote&amp;gt;
+
+
+
+&amp;lt;p&amp;gt;Assuming Vlad means integers represented in two-complement, which
+   is the case with 99% of the processors nowadays, such a function
+   just doesn&#039;t exist. Here&#039;s the mathematical proof.&amp;lt;/p&amp;gt;
+
+
+&amp;lt;p&amp;gt;First, in &amp;#226;&amp;#132;&amp;#164;, such functions indeed exist. For example:&amp;lt;/p&amp;gt;
+
+
+&amp;lt;pre&amp;gt;&amp;lt;code&amp;gt;
+    (defun integer/f (n)
+      &amp;quot;
+    Assuming n is an INTEGER, (= (- n) (f (f n)))
+         0 --&amp;gt;  0
+        +1 --&amp;gt; -2 --&amp;gt; -1 --&amp;gt; +2 --&amp;gt; +1
+        +3 --&amp;gt; -4 --&amp;gt; -3 --&amp;gt; +4 --&amp;gt; +3
+        ...
+        +(2k+1) --&amp;gt; -(2k+2) --&amp;gt; -(2k+1) --&amp;gt; +(2k+2) --&amp;gt; +(2k+1)
+    &amp;quot;
+      (declare (type integer n))
+      (if (zerop n)
+          0
+          (if (plusp n)
+              (if (oddp n)
+                  (1- (- n))
+                  (1- n))
+              (if(oddp n)
+                  (1+ (- n))
+                  (1+ n)))))
+&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;
+
+
+&amp;lt;p&amp;gt;The same function works in one-complement representation, too
+   (assuming &amp;lt;code&amp;gt;zerop&amp;lt;/code&amp;gt; indicates both +0 and -0).&amp;lt;/p&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;But things are different in &amp;#226;&amp;#132;&amp;#164;/&amp;lt;sub&amp;gt;m&amp;lt;/sub&amp;gt;, because of the special
+   properties of the negation in these sets.&amp;lt;/p&amp;gt;
+
+
+&amp;lt;p&amp;gt;When m=2&amp;lt;sup&amp;gt;p&amp;lt;/sup&amp;gt; with p&amp;gt;2:&amp;lt;/p&amp;gt;
+&amp;lt;p&amp;gt;Let i be the identity function:  &amp;#226;&amp;#136;&amp;#128; a &amp;#226;&amp;#136;&amp;#136; &amp;#226;&amp;#132;&amp;#164;/&amp;lt;sub&amp;gt;m&amp;lt;/sub&amp;gt;, i(a)=a
+&amp;lt;p&amp;gt;Let n be the negation function in two-complement on
+   &amp;#226;&amp;#132;&amp;#164;/&amp;lt;sub&amp;gt;2&amp;lt;sup&amp;gt;p&amp;lt;/sup&amp;gt;&amp;lt;/sub&amp;gt;. n is defined as: n(x) = 1+(&amp;#194;&amp;#172;x), with &amp;#194;&amp;#172;x
+   being the bitwise not operation.&amp;lt;/p&amp;gt;
+&amp;lt;p&amp;gt;Here are some properties of n:
+&amp;lt;ol&amp;gt;
+&amp;lt;li&amp;gt;n(0)=0
+&amp;lt;li&amp;gt;let M = -2&amp;lt;sup&amp;gt;p-1&amp;lt;/sup&amp;gt;.  In two-complement arithmetic, n(M)=M.
+&amp;lt;li&amp;gt;&amp;#226;&amp;#136;&amp;#128; a &amp;#226;&amp;#136;&amp;#136; &amp;#226;&amp;#132;&amp;#164;/&amp;lt;sub&amp;gt;2&amp;lt;sup&amp;gt;p&amp;lt;/sup&amp;gt;&amp;lt;/sub&amp;gt;&amp;#226;&amp;#136;&amp;#150;{0, M}, n(a)&amp;#226;&amp;#137;&amp;#160;a
+&amp;lt;li&amp;gt;&amp;#226;&amp;#136;&amp;#128; a &amp;#226;&amp;#136;&amp;#136; &amp;#226;&amp;#132;&amp;#164;/&amp;lt;sub&amp;gt;2&amp;lt;sup&amp;gt;p&amp;lt;/sup&amp;gt;&amp;lt;/sub&amp;gt;, n(n(a))=a ; n&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; = i
+&amp;lt;li&amp;gt;&amp;#226;&amp;#136;&amp;#128; (a,b) &amp;#226;&amp;#136;&amp;#136; &amp;#226;&amp;#132;&amp;#164;/&amp;lt;sub&amp;gt;2&amp;lt;sup&amp;gt;p&amp;lt;/sup&amp;gt;&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;,
+    n(a)=n(b) &amp;#226;&amp;#135;&amp;#146; a=b (trivially deduced from 4.)
+&amp;lt;/li&amp;gt;
+&amp;lt;/li&amp;gt;
+&amp;lt;/li&amp;gt;
+&amp;lt;/li&amp;gt;
+&amp;lt;/li&amp;gt;
+&amp;lt;/ol&amp;gt;
+&amp;lt;/p&amp;gt;
+
+
+&amp;lt;p&amp;gt;Properties 3 and 4 allow partitionning
+&amp;#226;&amp;#132;&amp;#164;/&amp;lt;sub&amp;gt;2&amp;lt;sup&amp;gt;p&amp;lt;/sup&amp;gt;&amp;lt;/sub&amp;gt;&amp;#226;&amp;#136;&amp;#150;{0, M} in two symetrical subsets, one
+representing the positive integers, and the other their opposite
+negative integers.&amp;lt;/p&amp;gt;
+
+
+&amp;lt;br&amp;gt;
+&amp;lt;br&amp;gt;
+&amp;lt;p&amp;gt;Now, assume there is a function f such as &amp;#226;&amp;#136;&amp;#131; x &amp;#226;&amp;#136;&amp;#136; &amp;#226;&amp;#132;&amp;#164;/&amp;lt;sub&amp;gt;2&amp;lt;sup&amp;gt;p&amp;lt;/sup&amp;gt;&amp;lt;/sub&amp;gt;,  f(f(x))=n(x).&amp;lt;/p&amp;gt;
+&amp;lt;p&amp;gt;Let&#039;s denote the composition of functions by mere juxtaposition: fg = f&amp;#226;&amp;#151;&amp;#139;g.&amp;lt;/p&amp;gt;
+&amp;lt;ul&amp;gt;
+&amp;lt;li&amp;gt;f&amp;lt;sup&amp;gt;0&amp;lt;/sup&amp;gt; = i
+&amp;lt;li&amp;gt;f&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; = n
+&amp;lt;li&amp;gt;f&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = nf&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; = f&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;n
+&amp;lt;li&amp;gt;f&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; = nf&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = f&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;n = f
+&amp;lt;li&amp;gt;f&amp;lt;sup&amp;gt;4&amp;lt;/sup&amp;gt; = n&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; = i
+&amp;lt;/li&amp;gt;
+&amp;lt;/li&amp;gt;
+&amp;lt;/li&amp;gt;
+&amp;lt;/li&amp;gt;
+&amp;lt;/li&amp;gt;
+&amp;lt;/ul&amp;gt;
+
+and so on, &amp;#226;&amp;#136;&amp;#128; k &amp;#226;&amp;#136;&amp;#136; &amp;#226;&amp;#132;&amp;#149;, f&amp;lt;sup&amp;gt;4k&amp;lt;/sup&amp;gt;=i, f&amp;lt;sup&amp;gt;4k+1&amp;lt;/sup&amp;gt;=f, f&amp;lt;sup&amp;gt;4k+2&amp;lt;/sup&amp;gt;=n, f&amp;lt;sup&amp;gt;4k+3&amp;lt;/sup&amp;gt;=nf.
+
+&amp;lt;p&amp;gt;Let C be the function from &amp;#226;&amp;#132;&amp;#164;/&amp;lt;sub&amp;gt;2&amp;lt;sup&amp;gt;p&amp;lt;/sup&amp;gt;&amp;lt;/sub&amp;gt; to
+2&amp;lt;sup&amp;gt;&amp;#226;&amp;#132;&amp;#164;/&amp;lt;sub&amp;gt;2&amp;lt;sup&amp;gt;p&amp;lt;/sup&amp;gt;&amp;lt;/sub&amp;gt;&amp;lt;/sup&amp;gt; such as:
+C(x) = { f&amp;lt;sup&amp;gt;0&amp;lt;/sup&amp;gt;(x), f&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;(x),
+         f&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;(x), f&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;(x) }&amp;lt;/p&amp;gt;
+
+
+&amp;lt;p&amp;gt;Now, let (a,b) &amp;#226;&amp;#136;&amp;#136; &amp;#226;&amp;#132;&amp;#164;/&amp;lt;sub&amp;gt;2&amp;lt;sup&amp;gt;p&amp;lt;/sup&amp;gt;&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;, such as
+   a &amp;#226;&amp;#136;&amp;#137; {0, M}, f&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;(a)=n(a) and b &amp;#226;&amp;#136;&amp;#137; C(a) [H]&amp;lt;/p&amp;gt;
+
+
+&amp;lt;p&amp;gt;Since a &amp;#226;&amp;#136;&amp;#137; {0, M} and f&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;(a)=n(a), | C(a) | = 4.&amp;lt;/p&amp;gt;
+&amp;lt;p&amp;gt;And:
+&amp;lt;ul&amp;gt;
+&amp;lt;li&amp;gt;b = f&amp;lt;sup&amp;gt;0&amp;lt;/sup&amp;gt;(b) &amp;#226;&amp;#137;&amp;#160; a, by hypothesis [H].
+&amp;lt;li&amp;gt;f&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;(b) &amp;#226;&amp;#137;&amp;#160; a, since by hypothesis [H], b &amp;#226;&amp;#137;&amp;#160; f&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;(a).
+&amp;lt;li&amp;gt;f&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;(b) &amp;#226;&amp;#137;&amp;#160; a, since by hypothesis [H], b &amp;#226;&amp;#137;&amp;#160; f&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;(a).
+&amp;lt;li&amp;gt;f&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;(b) &amp;#226;&amp;#137;&amp;#160; a, since by hypothesis [H], b &amp;#226;&amp;#137;&amp;#160; f&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;(a).
+&amp;lt;/li&amp;gt;
+&amp;lt;/li&amp;gt;
+&amp;lt;/li&amp;gt;
+&amp;lt;/li&amp;gt;
+&amp;lt;/ul&amp;gt;
+&amp;lt;br&amp;gt;in consequence, all the subsets C(x) are disjoint and form a partition of &amp;#226;&amp;#132;&amp;#164;/&amp;lt;sub&amp;gt;2&amp;lt;sup&amp;gt;p&amp;lt;/sup&amp;gt;&amp;lt;/sub&amp;gt;.
+&amp;lt;/br&amp;gt;
+&amp;lt;/p&amp;gt;
+
+
+&amp;lt;p&amp;gt;However, since C(0) = { 0, f&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;(0) }, and C(M) = { M,
+f&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;(M) }, and &amp;#226;&amp;#132;&amp;#164;/&amp;lt;sub&amp;gt;2&amp;lt;sup&amp;gt;p&amp;lt;/sup&amp;gt;&amp;lt;/sub&amp;gt; is divisible by 4
+when p&amp;gt;2, there is at least two other elements of
+&amp;#226;&amp;#132;&amp;#164;/&amp;lt;sub&amp;gt;2&amp;lt;sup&amp;gt;p&amp;lt;/sup&amp;gt;&amp;lt;/sub&amp;gt;, let&#039;s call them N and O, such as C(O) = {
+O, f&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;(O) } and C(N) = { N, f&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;(N) }. &amp;lt;/p&amp;gt;
+
+
+&amp;lt;p&amp;gt;We have f&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;(O) = O and f&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;(N) = N, which shows
+that &amp;#226;&amp;#136;&amp;#131; x &amp;#226;&amp;#136;&amp;#136; &amp;#226;&amp;#132;&amp;#164;/&amp;lt;sub&amp;gt;2&amp;lt;sup&amp;gt;p&amp;lt;/sup&amp;gt;&amp;lt;/sub&amp;gt;, f(f(x)) &amp;#226;&amp;#137;&amp;#160; -x.
+
+&amp;lt;p&amp;gt;&amp;lt;em&amp;gt;Conclusion&amp;lt;/em&amp;gt;: When p&amp;gt;2, there is no function on
+&amp;#226;&amp;#132;&amp;#164;/&amp;lt;sub&amp;gt;2&amp;lt;sup&amp;gt;p&amp;lt;/sup&amp;gt;&amp;lt;/sub&amp;gt; such as f&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; = n.&amp;lt;/p&amp;gt;
+  At most, we
+can find functions such as f(f(x)) = -x for all elements x of
+&amp;#226;&amp;#132;&amp;#164;/&amp;lt;sub&amp;gt;2&amp;lt;sup&amp;gt;p&amp;lt;/sup&amp;gt;&amp;lt;/sub&amp;gt; but for two of our choosing.  Note that we
+can choose to break the formula for 0 and M, since -0 is not very
+interesting and -M in two-complement is pathologic anyways.&amp;lt;/p&amp;gt;
+
+
+&amp;lt;p&amp;gt;(For other sets, &amp;#226;&amp;#132;&amp;#164;/&amp;lt;sub&amp;gt;q&amp;lt;/sub&amp;gt; if q &amp;#226;&amp;#137;&amp;#161; 1 [4] or  q &amp;#226;&amp;#137;&amp;#161; 2 [4],
+then there are functions such as f&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;=n).&amp;lt;/p&amp;gt;
+
+
+
+&amp;lt;p&amp;gt;Finally, we can implement a function that does almost what was
+asked, only with a bug: we get to choose which two values for which
+f(f(x)) &amp;#226;&amp;#137;&amp;#160; -x.
+
+&amp;lt;p&amp;gt;But of course, not using only XOR and SHIFT operations!  Using only
+NAND and SHIFT, it would be possible (since NAND is all is needed to
+build all the boolean operators, but XOR is not powerful enough to do
+so, see Wikipedia articles on
+&amp;lt;a href=&amp;quot;http://en.wikipedia.org/wiki/Logical_connective&amp;quot;&amp;gt;Logical connective&amp;lt;/a&amp;gt;
+or on &amp;lt;a href=&amp;quot;http://en.wikipedia.org/wiki/Functional_completeness&amp;quot;&amp;gt;Functional completeness&amp;lt;/a&amp;gt;).
+&amp;lt;/p&amp;gt;
+&amp;lt;blockquote&amp;gt;
+&amp;lt;small&amp;gt;
+
+&amp;lt;p&amp;gt;Technically, we don&#039;t need full functional completeness for XOR
+   (&amp;#226;&amp;#138;&amp;#187;), we&#039;d only need to be able to implement logical not and
+   increment.  For logical not, there&#039;s no problem, a &amp;#226;&amp;#138;&amp;#187; 1 = &amp;#194;&amp;#172;a, but
+   for increment, we need to implement a semi-adder, where s = a &amp;#226;&amp;#138;&amp;#187; b
+   and c = a &amp;#226;&amp;#136;&amp;#167; b.  But there is no way to get AND from XOR, because
+   XOR is closed over {0, 1, a, b, &amp;#194;&amp;#172;a, &amp;#194;&amp;#172;b, a&amp;#226;&amp;#138;&amp;#187;b, &amp;#194;&amp;#172;(a&amp;#226;&amp;#138;&amp;#187;b)} (any
+   application of XOR on two elements of this set gives an element of
+   this set).&amp;lt;/p&amp;gt;
+
+
+&amp;lt;/small&amp;gt;
+&amp;lt;/blockquote&amp;gt;
+
+
+&amp;lt;p&amp;gt;Since two-complement negation on binary words of length w is
+defined as &amp;lt;code&amp;gt;(mod (1+ (lognot n)) (expt 2 w))&amp;lt;/code&amp;gt;, we need more
+than just XOR and SHIFT...  Two impossibilities for one &amp;lt;em&amp;gt;interview
+question&amp;lt;/em&amp;gt;.  Vicious!  And asking to do that &amp;quot;without any kind of
+model&amp;quot;, tskss, tskss, I wouldn&#039;t like to work at such a company,
+unless the question was designed exactly for that, to weed out people
+doing what they&#039;re told without thinking...&amp;lt;/p&amp;gt;
+
+
+
+&amp;lt;pre&amp;gt;&amp;lt;code&amp;gt;
+(declaim (ftype (function (integer) (unsigned-byte 32))
+                32-bit
+                32-bit/2-complement-neg))
+
+(defun 32-bit (x)
+  &amp;quot;Mask off 32-bits of X&amp;quot;
+  (logand #xffffffff x))
+
+(defun 32-bit/plusp (n)
+  &amp;quot;Whether N represents a positive integer.&amp;quot;
+  (declare (type (unsigned-byte 32) n))
+  (zerop (ldb (byte 1 31) n)))
+
+(defun 32-bit/2-complement-neg (n)
+  &amp;quot;Return the negation of N in 2-complement.&amp;quot;
+  (declare (type (unsigned-byte 32) n))
+  (32-bit (1+ (lognot n))))
+
+(defun 32-bit/f (n)
+  &amp;quot;
+Assuming n is a 32-bit 2-complement signed integer different
+from 0 and -2&amp;#194;&amp;#179;&amp;#194;&amp;#185;,  (= (- n) (f (f n)))
+&amp;quot;
+  (declare (type (unsigned-byte 32) n))
+  (32-bit
+   (case n                              ; (f (f n))
+     ((#x00000000) #x80000001)          ; --&amp;gt; 0x80000000
+     ((#x80000000) #x7FFFFFFF)          ; --&amp;gt; 0x00000000
+     ((#x7FFFFFFF) #x00000000)          ; --&amp;gt; 0x80000001
+     ((#x80000001) #x80000000)          ; --&amp;gt; 0x7fffffff
+     ;;  For the above exceptions, any permutation is valid;
+     ;;  we choose here to break it for 0 and M, with
+     ;;  f(f(0))=M and f(f(M))=0,
+     ;;  to keep f(f(2&amp;#194;&amp;#179;&amp;#194;&amp;#185;-1))= -(2&amp;#194;&amp;#179;&amp;#194;&amp;#185;-1) and f(f(-(2&amp;#194;&amp;#179;&amp;#194;&amp;#185;-1)))= 2&amp;#194;&amp;#179;&amp;#194;&amp;#185;-1
+     (otherwise
+      (if (32-bit/plusp n)
+          (if (oddp n)
+              (lognot n)
+              (1- n))
+          (if (oddp n)
+              (+ (lognot n) 2)
+              (1+ n)))))))
+
+&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;
+
+
+&amp;lt;hr&amp;gt;
+
+&amp;lt;pre&amp;gt;&amp;lt;code&amp;gt;
+
+C/USER[83]&amp;gt; (load&amp;quot;&amp;lt;a href=&amp;quot;ffn=-n.lisp&amp;quot;&amp;gt;ffn=-n.lisp&amp;lt;/a&amp;gt;&amp;quot;)
+;; Loading file ffn=-n.lisp ...
+;; Loaded file ffn=-n.lisp
+T
+C/USER[84]&amp;gt; (test-f)
+
+
+           i           -i    (f (f i))        (f i) (- (f (f i)))
+    00000000     00000000 /=  80000000    80000001     80000000
+    00000001     FFFFFFFF     FFFFFFFF    FFFFFFFE     00000001
+    00000002     FFFFFFFE     FFFFFFFE    00000001     00000002
+    00000003     FFFFFFFD     FFFFFFFD    FFFFFFFC     00000003
+    00000004     FFFFFFFC     FFFFFFFC    00000003     00000004
+    00000005     FFFFFFFB     FFFFFFFB    FFFFFFFA     00000005
+    00000006     FFFFFFFA     FFFFFFFA    00000005     00000006
+    00000007     FFFFFFF9     FFFFFFF9    FFFFFFF8     00000007
+    00000008     FFFFFFF8     FFFFFFF8    00000007     00000008
+    00000009     FFFFFFF7     FFFFFFF7    FFFFFFF6     00000009
+    0000000A     FFFFFFF6     FFFFFFF6    00000009     0000000A
+    0000000B     FFFFFFF5     FFFFFFF5    FFFFFFF4     0000000B
+    0000000C     FFFFFFF4     FFFFFFF4    0000000B     0000000C
+    0000000D     FFFFFFF3     FFFFFFF3    FFFFFFF2     0000000D
+    0000000E     FFFFFFF2     FFFFFFF2    0000000D     0000000E
+    0000000F     FFFFFFF1     FFFFFFF1    FFFFFFF0     0000000F
+    00000010     FFFFFFF0     FFFFFFF0    0000000F     00000010
+    00000011     FFFFFFEF     FFFFFFEF    FFFFFFEE     00000011
+    00000012     FFFFFFEE     FFFFFFEE    00000011     00000012
+    00000013     FFFFFFED     FFFFFFED    FFFFFFEC     00000013
+    FFFFFFFF     00000001     00000001    00000002     FFFFFFFF
+    FFFFFFFE     00000002     00000002    FFFFFFFF     FFFFFFFE
+    FFFFFFFD     00000003     00000003    00000004     FFFFFFFD
+    FFFFFFFC     00000004     00000004    FFFFFFFD     FFFFFFFC
+    FFFFFFFB     00000005     00000005    00000006     FFFFFFFB
+    FFFFFFFA     00000006     00000006    FFFFFFFB     FFFFFFFA
+    FFFFFFF9     00000007     00000007    00000008     FFFFFFF9
+    FFFFFFF8     00000008     00000008    FFFFFFF9     FFFFFFF8
+    FFFFFFF7     00000009     00000009    0000000A     FFFFFFF7
+    FFFFFFF6     0000000A     0000000A    FFFFFFF7     FFFFFFF6
+    FFFFFFF5     0000000B     0000000B    0000000C     FFFFFFF5
+    FFFFFFF4     0000000C     0000000C    FFFFFFF5     FFFFFFF4
+    FFFFFFF3     0000000D     0000000D    0000000E     FFFFFFF3
+    FFFFFFF2     0000000E     0000000E    FFFFFFF3     FFFFFFF2
+    FFFFFFF1     0000000F     0000000F    00000010     FFFFFFF1
+    FFFFFFF0     00000010     00000010    FFFFFFF1     FFFFFFF0
+    FFFFFFEF     00000011     00000011    00000012     FFFFFFEF
+    FFFFFFEE     00000012     00000012    FFFFFFEF     FFFFFFEE
+    FFFFFFED     00000013     00000013    00000014     FFFFFFED
+    FFFFFFEC     00000014     00000014    FFFFFFED     FFFFFFEC
+    7FFFFFEC     80000014     80000014    7FFFFFEB     7FFFFFEC
+    7FFFFFED     80000013     80000013    80000012     7FFFFFED
+    7FFFFFEE     80000012     80000012    7FFFFFED     7FFFFFEE
+    7FFFFFEF     80000011     80000011    80000010     7FFFFFEF
+    7FFFFFF0     80000010     80000010    7FFFFFEF     7FFFFFF0
+    7FFFFFF1     8000000F     8000000F    8000000E     7FFFFFF1
+    7FFFFFF2     8000000E     8000000E    7FFFFFF1     7FFFFFF2
+    7FFFFFF3     8000000D     8000000D    8000000C     7FFFFFF3
+    7FFFFFF4     8000000C     8000000C    7FFFFFF3     7FFFFFF4
+    7FFFFFF5     8000000B     8000000B    8000000A     7FFFFFF5
+    7FFFFFF6     8000000A     8000000A    7FFFFFF5     7FFFFFF6
+    7FFFFFF7     80000009     80000009    80000008     7FFFFFF7
+    7FFFFFF8     80000008     80000008    7FFFFFF7     7FFFFFF8
+    7FFFFFF9     80000007     80000007    80000006     7FFFFFF9
+    7FFFFFFA     80000006     80000006    7FFFFFF9     7FFFFFFA
+    7FFFFFFB     80000005     80000005    80000004     7FFFFFFB
+    7FFFFFFC     80000004     80000004    7FFFFFFB     7FFFFFFC
+    7FFFFFFD     80000003     80000003    80000002     7FFFFFFD
+    7FFFFFFE     80000002     80000002    7FFFFFFD     7FFFFFFE
+    7FFFFFFF     80000001     80000001    00000000     7FFFFFFF
+    80000013     7FFFFFED     7FFFFFED    7FFFFFEE     80000013
+    80000012     7FFFFFEE     7FFFFFEE    80000013     80000012
+    80000011     7FFFFFEF     7FFFFFEF    7FFFFFF0     80000011
+    80000010     7FFFFFF0     7FFFFFF0    80000011     80000010
+    8000000F     7FFFFFF1     7FFFFFF1    7FFFFFF2     8000000F
+    8000000E     7FFFFFF2     7FFFFFF2    8000000F     8000000E
+    8000000D     7FFFFFF3     7FFFFFF3    7FFFFFF4     8000000D
+    8000000C     7FFFFFF4     7FFFFFF4    8000000D     8000000C
+    8000000B     7FFFFFF5     7FFFFFF5    7FFFFFF6     8000000B
+    8000000A     7FFFFFF6     7FFFFFF6    8000000B     8000000A
+    80000009     7FFFFFF7     7FFFFFF7    7FFFFFF8     80000009
+    80000008     7FFFFFF8     7FFFFFF8    80000009     80000008
+    80000007     7FFFFFF9     7FFFFFF9    7FFFFFFA     80000007
+    80000006     7FFFFFFA     7FFFFFFA    80000007     80000006
+    80000005     7FFFFFFB     7FFFFFFB    7FFFFFFC     80000005
+    80000004     7FFFFFFC     7FFFFFFC    80000005     80000004
+    80000003     7FFFFFFD     7FFFFFFD    7FFFFFFE     80000003
+    80000002     7FFFFFFE     7FFFFFFE    80000003     80000002
+    80000001     7FFFFFFF     7FFFFFFF    80000000     80000001
+    80000000     80000000 /=  00000000    7FFFFFFF     00000000
+NIL
+C/USER[85]&amp;gt;
+
+&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;
+&amp;lt;/hr&amp;gt;
+&amp;lt;/p&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/p&amp;gt;
+&amp;lt;/div&amp;gt;
+&amp;lt;/div&amp;gt;
+</description></item><item><dc:identifier>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/m-expression/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>en</dc:language><dc:format>text/html</dc:format><title>A Parser for M-Expressions</title><link>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/m-expression/index.html</link><guid isPermaLink="true">http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/m-expression/index.html</guid><category>lisp</category><pubDate>Thu, 28 Sep 2006 12:00:00 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
 &amp;lt;div class=&amp;quot;header&amp;quot;&amp;gt;
 &amp;lt;img src=&amp;quot;http://www.informatimago.com/blog/m-expr-mccarthy.jpg&amp;quot; height=&amp;quot;100px&amp;quot; class=&amp;quot;floatRight&amp;quot;&amp;gt;&amp;lt;/img&amp;gt;
 &amp;lt;h1&amp;gt;A Parser for M-Expressions&amp;lt;/h1&amp;gt;
 &amp;lt;p&amp;gt;Here is a parser for Lisp M-Expressions as documented
     in the Memo 8, AIM-8.&amp;lt;/p&amp;gt;
 &amp;lt;p&amp;gt;&amp;lt;small&amp;gt;&amp;lt;a href=&amp;quot;mailto:pjb+blog@informatimago.com&amp;quot;&amp;gt;Pascal J. Bourguignon&amp;lt;/a&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
-&amp;lt;p&amp;gt;&amp;lt;small&amp;gt;M-Expressions, The Original LISP&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
+&amp;lt;p&amp;gt;&amp;lt;small&amp;gt;LISP, Common Lisp, M-Expressions&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
+&amp;lt;/div&amp;gt;
+&amp;lt;div class=&amp;quot;document&amp;quot; id=&amp;quot;m-expression&amp;quot;&amp;gt;
+
+
+&amp;lt;h1&amp;gt;A Parser for M-Expressions&amp;lt;/h1&amp;gt;
+
+
+
+&amp;lt;p&amp;gt;Here is a parser for Lisp M-Expressions as documented in the
+    &amp;lt;a href=&amp;quot;../aim-8/index.html&amp;quot;&amp;gt;Memo 8, AIM-8&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;
+    A lot of lisp newbies ask for more conventionnal syntax for lisp.
+    Since day one, lisp was intended to have such a syntax: M-expressions.
+  &amp;lt;/p&amp;gt;
+
+
+
+&amp;lt;p&amp;gt;
+    Let&#039;s newbies play with them, and realize how impractical they are.
+    Note for example, that we cannot use macros anymore because
+    their syntax would need to be known by the M-expression parser,
+    like it&#039;s the case for &amp;lt;tt&amp;gt;lambda[[...];...]&amp;lt;/tt&amp;gt;.
+    Macros were added later in lisp history.
+  &amp;lt;/p&amp;gt;
+
+
+
+&amp;lt;p&amp;gt;
+    Note that S-expressions can still be entered, as literal objects,
+    but using comma instead of space to separate the items in lists.
+  &amp;lt;/p&amp;gt;
+
+
+
+&amp;lt;p&amp;gt;The file &amp;lt;a href=&amp;quot;m-expression.lisp&amp;quot;&amp;gt;m-expression.lisp&amp;lt;/a&amp;gt;
+    contains the M-expression parser and a REPL, in Common-Lisp.&amp;lt;/p&amp;gt;
+
+
+
+
+&amp;lt;h2&amp;gt;Exemple&amp;lt;/h2&amp;gt;
+
+
+
+
+&amp;lt;pre class=&amp;quot;dribble&amp;quot;&amp;gt;
+% &amp;lt;b&amp;gt;/usr/local/bin/clisp -q -norc -ansi &amp;lt;/b&amp;gt;
+
+[1]&amp;amp;gt; &amp;lt;b&amp;gt;(load&amp;quot;m-expression.lisp&amp;quot; :external-format #+clisp charset:utf-8 #+sbcl :utf-8)&amp;lt;/b&amp;gt;
+;; Loading file m-expression.lisp ...
+;; Loaded file m-expression.lisp
+T
+[2]&amp;amp;gt; &amp;lt;b&amp;gt;(m-repl)&amp;lt;/b&amp;gt;
+
+;; We are going to define a function that is exported by COMMON-LISP,
+;; so let&#039;s shadow it first:
+
+COMMON-LISP-USER[1]M-REPL&amp;amp;gt; &amp;lt;b&amp;gt;shadow[SUBST];&amp;lt;/b&amp;gt;
+ --&amp;amp;gt; T
+
+COMMON-LISP-USER[2]M-REPL&amp;amp;gt; &amp;lt;b&amp;gt;label[subst;&amp;#206;&amp;#187;[[x;y;s];[null[s]-&amp;amp;gt;nil;atom[s]&amp;#226;&amp;#159;&amp;#182;
+           [y=s-&amp;amp;gt;x;1-&amp;amp;gt;s];1-&amp;amp;gt;combine[subst[x;y;first[s]];
+                subst[x;y;rest[s]]]]]];&amp;lt;/b&amp;gt;
+ --&amp;amp;gt; SUBST
+
+;; S-expressions embedded in M-expressions must use comma as separator:
+COMMON-LISP-USER[3]M-REPL&amp;amp;gt; &amp;lt;b&amp;gt;subst[WATER;WINE;(MIX WATER AND WINE
+                                  INTO (MIXED WATER AND WINE))];&amp;lt;/b&amp;gt;
+SIMPLE-ERROR:
+Unexpected S-CLOSE, not (:S-SYMBOL WATER)
+ at &amp;quot; AND WINE&amp;quot;
+
+COMMON-LISP-USER[4]M-REPL&amp;amp;gt; SIMPLE-ERROR:
+Please terminate your m-expressions with a semi-colon, not (:S-OPEN)
+
+COMMON-LISP-USER[5]M-REPL&amp;amp;gt;
+SIMPLE-ERROR:
+Please terminate your m-expressions with a semi-colon, not (:S-SYMBOL WATER)
+
+COMMON-LISP-USER[6]M-REPL&amp;amp;gt;
+SIMPLE-ERROR:
+Please terminate your m-expressions with a semi-colon, not (:S-SYMBOL WINE)
+
+COMMON-LISP-USER[7]M-REPL&amp;amp;gt;
+SIMPLE-ERROR:
+Unexpected token in m-term: (:S-CLOSE)
+ at &amp;amp;quot;)];&amp;amp;quot;
+
+COMMON-LISP-USER[8]M-REPL&amp;amp;gt; &amp;lt;b&amp;gt;subst[WATER;WINE;(MIX,WATER,AND,WINE,
+                                 INTO,(MIXED,WATER,AND,WINE))];&amp;lt;/b&amp;gt;
+ --&amp;amp;gt; (MIX WATER AND WATER INTO (MIXED WATER AND WATER))
+
+COMMON-LISP-USER[9]M-REPL&amp;amp;gt; &amp;lt;b&amp;gt;subst[WINE;WATER;(MIX,WATER,AND,WINE,
+                                 INTO,(MIXED,WATER,AND,WINE))];&amp;lt;/b&amp;gt;
+ --&amp;amp;gt; (MIX WINE AND WINE INTO (MIXED WINE AND WINE))
+
+COMMON-LISP-USER[10]M-REPL&amp;amp;gt; &amp;lt;b&amp;gt;first[((A,B),C,D)]=(A,B);&amp;lt;/b&amp;gt;
+
+ --&amp;amp;gt; NIL
+
+COMMON-LISP-USER[11]M-REPL&amp;amp;gt; &amp;lt;b&amp;gt;combine[A;&amp;#226;&amp;#139;&amp;#128;];&amp;lt;/b&amp;gt;
+ --&amp;amp;gt; (A)
+
+COMMON-LISP-USER[12]M-REPL&amp;amp;gt; &amp;lt;b&amp;gt;quit[];&amp;lt;/b&amp;gt;
+NIL
+[3]&amp;amp;gt;
+
+  &amp;lt;/pre&amp;gt;
+
+
+
+&amp;lt;/div&amp;gt;
 &amp;lt;/div&amp;gt;
-en&amp;lt;/div&amp;gt;
-</description></item><item><dc:identifier>http://www.informatimago.com/articles/interleave/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language><nil/></dc:language><dc:format>text/html</dc:format><title>Interleave</title><link>http://www.informatimago.com/articles/interleave/index.html</link><guid isPermaLink="true">http://www.informatimago.com/articles/interleave/index.html</guid><category>lisp</category><pubDate>Mon, 26 Aug 2006 12:00:00 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
+</description></item><item><dc:identifier>http://www.informatimago.com/articles/interleave/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>en</dc:language><dc:format>text/html</dc:format><title>Interleave</title><link>http://www.informatimago.com/articles/interleave/index.html</link><guid isPermaLink="true">http://www.informatimago.com/articles/interleave/index.html</guid><category>lisp</category><pubDate>Mon, 26 Aug 2006 12:00:00 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
 &amp;lt;div class=&amp;quot;header&amp;quot;&amp;gt;
 &amp;lt;img src=&amp;quot;http://www.informatimago.com/blog/interleave.png&amp;quot; height=&amp;quot;100px&amp;quot; class=&amp;quot;floatRight&amp;quot;&amp;gt;&amp;lt;/img&amp;gt;
 &amp;lt;h1&amp;gt;&amp;lt;/h1&amp;gt;
@@ -146,42 +3428,677 @@ en&amp;lt;/div&amp;gt;
 &amp;lt;p&amp;gt;&amp;lt;small&amp;gt;&amp;lt;a href=&amp;quot;mailto:pjb+blog@informatimago.com&amp;quot;&amp;gt;Pascal J. Bourguignon&amp;lt;/a&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
 &amp;lt;p&amp;gt;&amp;lt;small&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
 &amp;lt;/div&amp;gt;
-en&amp;lt;/div&amp;gt;
-</description></item><item><dc:identifier>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/ibcl/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>Common Lisp, Lisp, Lisp Image, Image Based Common Lisp, IBCL</dc:language><dc:format>text/html</dc:format><title>Image Based Development</title><link>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/ibcl/index.html</link><guid isPermaLink="true">http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/ibcl/index.html</guid><category>lisp</category><pubDate>Thu, 04 May 2006 12:00:00 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
+&amp;lt;div class=&amp;quot;document&amp;quot; id=&amp;quot;interleave&amp;quot;&amp;gt;
+&amp;lt;h1&amp;gt;Interleave&amp;lt;/h1&amp;gt;
+
+
+
+&amp;lt;p&amp;gt;On &amp;lt;a href=&amp;quot;news:comp.programming&amp;quot;&amp;gt;comp.programming&amp;lt;/a&amp;gt; &amp;lt;em&amp;gt;mike3&amp;lt;/em&amp;gt;&amp;lt;a href=&amp;quot;http://groups.google.com/group/comp.programming/browse_frm/thread/b335648ee7e3d065/21a1283c430f6ad5?#21a1283c430f6ad5&amp;quot;&amp;gt;
+asked for an algorithm to compute &amp;quot;interleave&amp;quot; and &amp;quot;deinterleave&amp;quot;
+permutations&amp;lt;/a&amp;gt;.
+
+Here is &amp;lt;a href=&amp;quot;interleave.lisp&amp;quot;&amp;gt;an implementation&amp;lt;/a&amp;gt; in &amp;lt;a href=&amp;quot;http://en.wikipedia.org/wiki/Common_Lisp&amp;quot;&amp;gt;Common Lisp&amp;lt;/a&amp;gt; of such an algorithm.
+
+&amp;lt;p&amp;gt;The following diagrams are generated by &amp;lt;a href=&amp;quot;http://www.graphviz.org/&amp;quot;&amp;gt;
+Graphviz&amp;lt;/a&amp;gt; from .dot files generated by &amp;lt;a href=&amp;quot;interleave.lisp&amp;quot;&amp;gt;interleave.lisp&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;
+
+
+&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;permutations.html&amp;quot;&amp;gt;Permutations up to 98&amp;lt;/a&amp;gt;...&amp;lt;/p&amp;gt;
+
+
+&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;2&amp;lt;/strong&amp;gt;
+&amp;lt;br&amp;gt;2 cycles, of lengths: 1, 1.
+&amp;lt;br&amp;gt;((1) (0))
+&amp;lt;br&amp;gt;
+2 = 2
+&amp;lt;br&amp;gt;
+0 =
+&amp;lt;br&amp;gt;
+&amp;lt;img src=&amp;quot;graph-02.png&amp;quot;&amp;gt;&amp;amp;nbsp;
+&amp;lt;img src=&amp;quot;interleave-02.png&amp;quot;&amp;gt;
+&amp;lt;br&amp;gt;
+&amp;lt;img src=&amp;quot;circle-02.png&amp;quot; width=&amp;quot;194&amp;quot;&amp;gt;
+&amp;lt;br&amp;gt;
+&amp;lt;hr&amp;gt;
+&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;4&amp;lt;/strong&amp;gt;
+&amp;lt;br&amp;gt;3 cycles, of lengths: 1, 2, 1.
+&amp;lt;br&amp;gt;((3) (2 1) (0))
+&amp;lt;br&amp;gt;
+4 = 2&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;
+&amp;lt;br&amp;gt;
+2 = 2
+&amp;lt;br&amp;gt;
+&amp;lt;img src=&amp;quot;graph-04.png&amp;quot;&amp;gt;&amp;amp;nbsp;
+&amp;lt;img src=&amp;quot;interleave-04.png&amp;quot;&amp;gt;
+&amp;lt;br&amp;gt;
+&amp;lt;img src=&amp;quot;circle-04.png&amp;quot; width=&amp;quot;207&amp;quot;&amp;gt;
+&amp;lt;br&amp;gt;
+&amp;lt;hr&amp;gt;
+&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;6&amp;lt;/strong&amp;gt;
+&amp;lt;br&amp;gt;3 cycles, of lengths: 1, 4, 1.
+&amp;lt;br&amp;gt;((5) (2 4 3 1) (0))
+&amp;lt;br&amp;gt;
+6 = 3 * 2
+&amp;lt;br&amp;gt;
+4 = 2&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;
+&amp;lt;br&amp;gt;
+&amp;lt;img src=&amp;quot;graph-06.png&amp;quot;&amp;gt;&amp;amp;nbsp;
+&amp;lt;img src=&amp;quot;interleave-06.png&amp;quot;&amp;gt;
+&amp;lt;br&amp;gt;
+&amp;lt;img src=&amp;quot;circle-06.png&amp;quot; width=&amp;quot;288&amp;quot;&amp;gt;
+&amp;lt;br&amp;gt;
+&amp;lt;hr&amp;gt;
+&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;8&amp;lt;/strong&amp;gt;
+&amp;lt;br&amp;gt;4 cycles, of lengths: 1, 3, 3, 1.
+&amp;lt;br&amp;gt;((7) (6 5 3) (2 4 1) (0))
+&amp;lt;br&amp;gt;
+8 = 2&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;
+&amp;lt;br&amp;gt;
+6 = 3 * 2
+&amp;lt;br&amp;gt;
+&amp;lt;img src=&amp;quot;graph-08.png&amp;quot;&amp;gt;&amp;amp;nbsp;
+&amp;lt;img src=&amp;quot;interleave-08.png&amp;quot;&amp;gt;
+&amp;lt;br&amp;gt;
+&amp;lt;img src=&amp;quot;circle-08.png&amp;quot; width=&amp;quot;370&amp;quot;&amp;gt;
+&amp;lt;br&amp;gt;
+&amp;lt;hr&amp;gt;
+&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;10&amp;lt;/strong&amp;gt;
+&amp;lt;br&amp;gt;4 cycles, of lengths: 1, 2, 6, 1.
+&amp;lt;br&amp;gt;((9) (6 3) (2 4 8 7 5 1) (0))
+&amp;lt;br&amp;gt;
+10 = 5 * 2
+&amp;lt;br&amp;gt;
+8 = 2&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;
+&amp;lt;br&amp;gt;
+&amp;lt;img src=&amp;quot;graph-10.png&amp;quot;&amp;gt;&amp;amp;nbsp;
+&amp;lt;img src=&amp;quot;interleave-10.png&amp;quot;&amp;gt;
+&amp;lt;br&amp;gt;
+&amp;lt;img src=&amp;quot;circle-10.png&amp;quot; width=&amp;quot;452&amp;quot;&amp;gt;
+&amp;lt;br&amp;gt;
+&amp;lt;hr&amp;gt;
+&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;12&amp;lt;/strong&amp;gt;
+&amp;lt;br&amp;gt;3 cycles, of lengths: 1, 10, 1.
+&amp;lt;br&amp;gt;((11) (2 4 8 5 10 9 7 3 6 1) (0))
+&amp;lt;br&amp;gt;
+12 = 3 * 2&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;
+&amp;lt;br&amp;gt;
+10 = 5 * 2
+&amp;lt;br&amp;gt;
+&amp;lt;img src=&amp;quot;graph-12.png&amp;quot;&amp;gt;&amp;amp;nbsp;
+&amp;lt;img src=&amp;quot;interleave-12.png&amp;quot;&amp;gt;
+&amp;lt;br&amp;gt;
+&amp;lt;img src=&amp;quot;circle-12.png&amp;quot; width=&amp;quot;564&amp;quot;&amp;gt;
+&amp;lt;br&amp;gt;
+&amp;lt;hr&amp;gt;
+&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;14&amp;lt;/strong&amp;gt;
+&amp;lt;br&amp;gt;3 cycles, of lengths: 1, 12, 1.
+&amp;lt;br&amp;gt;((13) (2 4 8 3 6 12 11 9 5 10 7 1) (0))
+&amp;lt;br&amp;gt;
+14 = 7 * 2
+&amp;lt;br&amp;gt;
+12 = 3 * 2&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;
+&amp;lt;br&amp;gt;
+&amp;lt;img src=&amp;quot;graph-14.png&amp;quot;&amp;gt;&amp;amp;nbsp;
+&amp;lt;img src=&amp;quot;interleave-14.png&amp;quot;&amp;gt;
+&amp;lt;br&amp;gt;
+&amp;lt;img src=&amp;quot;circle-14.png&amp;quot; width=&amp;quot;651&amp;quot;&amp;gt;
+&amp;lt;br&amp;gt;
+&amp;lt;hr&amp;gt;
+
+
+
+&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;permutations.html&amp;quot;&amp;gt;Permutations up to 98&amp;lt;/a&amp;gt;...&amp;lt;/p&amp;gt;
+
+
+&amp;lt;/hr&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/img&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/img&amp;gt;
+&amp;lt;/img&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/p&amp;gt;
+&amp;lt;/hr&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/img&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/img&amp;gt;
+&amp;lt;/img&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/p&amp;gt;
+&amp;lt;/hr&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/img&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/img&amp;gt;
+&amp;lt;/img&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/p&amp;gt;
+&amp;lt;/hr&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/img&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/img&amp;gt;
+&amp;lt;/img&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/p&amp;gt;
+&amp;lt;/hr&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/img&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/img&amp;gt;
+&amp;lt;/img&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/p&amp;gt;
+&amp;lt;/hr&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/img&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/img&amp;gt;
+&amp;lt;/img&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/p&amp;gt;
+&amp;lt;/hr&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/img&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/img&amp;gt;
+&amp;lt;/img&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/br&amp;gt;
+&amp;lt;/p&amp;gt;
+&amp;lt;/p&amp;gt;
+&amp;lt;/div&amp;gt;
+&amp;lt;/div&amp;gt;
+</description></item><item><dc:identifier>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/ibcl/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>en</dc:language><dc:format>text/html</dc:format><title>Image Based Development</title><link>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/ibcl/index.html</link><guid isPermaLink="true">http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/ibcl/index.html</guid><category>lisp</category><pubDate>Thu, 04 May 2006 12:00:00 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
 &amp;lt;div class=&amp;quot;header&amp;quot;&amp;gt;
 &amp;lt;img src=&amp;quot;http://www.informatimago.com/blog/interlisp-xerox.gif&amp;quot; height=&amp;quot;100px&amp;quot; class=&amp;quot;floatRight&amp;quot;&amp;gt;&amp;lt;/img&amp;gt;
 &amp;lt;h1&amp;gt;Common Lisp - Image Based Development&amp;lt;/h1&amp;gt;
 &amp;lt;p&amp;gt;An utility to ease development in a Common Lisp image.&amp;lt;/p&amp;gt;
 &amp;lt;p&amp;gt;&amp;lt;small&amp;gt;&amp;lt;a href=&amp;quot;mailto:pjb+blog@informatimago.com&amp;quot;&amp;gt;Pascal J. Bourguignon&amp;lt;/a&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
-&amp;lt;p&amp;gt;&amp;lt;small&amp;gt;Common Lisp - Image Based Development&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
+&amp;lt;p&amp;gt;&amp;lt;small&amp;gt;Common Lisp, Lisp, Lisp Image, Image Based Common Lisp, IBCL&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
+&amp;lt;/div&amp;gt;
+&amp;lt;div class=&amp;quot;document&amp;quot; id=&amp;quot;ibcl&amp;quot;&amp;gt;
+
+
+&amp;lt;h1&amp;gt;Image Based Development&amp;lt;/h1&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;The package &amp;lt;tt&amp;gt;IBCL&amp;lt;/tt&amp;gt; exports the same symbols as &amp;lt;tt&amp;gt;COMMON-LISP&amp;lt;/tt&amp;gt;, but for
+    some of the functions of macros modified to track of the source
+    of the definitions and to be able to edit them from the image,
+    and to save them in files.&amp;lt;/p&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;The package &amp;lt;tt&amp;gt;IBCL-USER&amp;lt;/tt&amp;gt; is a virgin package using &amp;lt;tt&amp;gt;IBCL&amp;lt;/tt&amp;gt; instead of &amp;lt;tt&amp;gt;CL&amp;lt;/tt&amp;gt;.&amp;lt;/p&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;One can work at the REPL, define variables with
+    &amp;lt;tt&amp;gt;DEFCONSTANT&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;DEFVAR&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;DEFPARAMETER&amp;lt;/tt&amp;gt;, macros with &amp;lt;tt&amp;gt;DEFMACRO&amp;lt;/tt&amp;gt;,
+    and functions with &amp;lt;tt&amp;gt;DEFUN&amp;lt;/tt&amp;gt;, edit macro and function definitions
+    with &amp;lt;tt&amp;gt;ED&amp;lt;/tt&amp;gt;, and save the image with &amp;lt;tt&amp;gt;SAVE-IMAGE&amp;lt;/tt&amp;gt;.&amp;lt;/p&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;The function &amp;lt;tt&amp;gt;LIST-PACKAGES-WITH-SOURCES&amp;lt;/tt&amp;gt; returns a list of packages
+    where some of these variables or functions are defined.
+    The function &amp;lt;tt&amp;gt;SOURCE&amp;lt;/tt&amp;gt; returns the source form of the given
+    variable or function.
+    The function &amp;lt;tt&amp;gt;SAVE-SOURCES&amp;lt;/tt&amp;gt; saves the definitions in a package,
+    or all the definitions to a file or stream.&amp;lt;/p&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;A recent complete implementation of IBCL can be found in the
+    &amp;lt;a href=&amp;quot;https://gitorious.org/com-informatimago/com-informatimago&amp;quot;&amp;gt;
+      Informatimago  Common Lisp Library at gitorious&amp;lt;/a&amp;gt;, specifically:
+    &amp;lt;a href=&amp;quot;https://gitorious.org/com-informatimago/com-informatimago/trees/master/common-lisp/lisp&amp;quot;&amp;gt;
+      com.informatimago.common-lisp.lisp&amp;lt;/a&amp;gt;.
+
+
+&amp;lt;p&amp;gt;You can load it in a Common Lisp implementation with
+    &amp;lt;a href=&amp;quot;http://www.quicklisp.org/&amp;quot;&amp;gt;quicklisp&amp;lt;/a&amp;gt;:&amp;lt;/p&amp;gt;
+
+
+
+
+&amp;lt;pre class=&amp;quot;dribble&amp;quot;&amp;gt;
+cl-user&amp;amp;gt; (ql:quickload :com.informatimago.common-lisp.lisp.ibcl)
+To load &amp;quot;com.informatimago.common-lisp.lisp.ibcl&amp;quot;:
+  Load 1 ASDF system:
+    com.informatimago.common-lisp.lisp.ibcl
+; Loading &amp;quot;com.informatimago.common-lisp.lisp.ibcl&amp;quot;
+[package com.informatimago.common-lisp.lisp.image-based-common-lisp]
+[package com.informatimago.common-lisp.lisp.image-based-common-lisp-user]
+(:com.informatimago.common-lisp.lisp.ibcl)
+cl-user&amp;amp;gt; (in-package :ibcl-user)
+#&amp;amp;lt;Package &amp;quot;COM.INFORMATIMAGO.COMMON-LISP.LISP.IMAGE-BASED-COMMON-LISP-USER&amp;quot;&amp;amp;gt;
+image-based-common-lisp-user&amp;amp;gt; (defun f (x)
+                                (if (zerop x)
+                                  1
+                                  (* x (f (1- x)))))
+
+f
+image-based-common-lisp-user&amp;amp;gt; (source &#039;f :function)
+(defun f (x) (if (zerop x) 1 (* x (f (1- x)))))
+#&amp;amp;lt;Package &amp;quot;COM.INFORMATIMAGO.COMMON-LISP.LISP.IMAGE-BASED-COMMON-LISP-USER&amp;quot;&amp;amp;gt;
+image-based-common-lisp-user&amp;amp;gt; (defvar f 42)
+f
+image-based-common-lisp-user&amp;amp;gt; (source &#039;f :variable)
+(defvar f 42)
+#&amp;amp;lt;Package &amp;quot;COM.INFORMATIMAGO.COMMON-LISP.LISP.IMAGE-BASED-COMMON-LISP-USER&amp;quot;&amp;amp;gt;
+image-based-common-lisp-user&amp;amp;gt; (defun (setf f) (newval) (setf f newval))
+(setf f)
+image-based-common-lisp-user&amp;amp;gt; (source &#039;(setf f) :function)
+(defun (setf f) (newval) (setf f newval))
+#&amp;amp;lt;Package &amp;quot;COM.INFORMATIMAGO.COMMON-LISP.LISP.IMAGE-BASED-COMMON-LISP-USER&amp;quot;&amp;amp;gt;
+image-based-common-lisp-user&amp;amp;gt; (in-package :cl-user)
+#&amp;amp;lt;Package &amp;quot;COM.INFORMATIMAGO.COMMON-LISP.LISP.IMAGE-BASED-COMMON-LISP-USER&amp;quot;&amp;amp;gt;
+image-based-common-lisp-user&amp;amp;gt; (cl:in-package :cl-user)
+#&amp;amp;lt;Package &amp;quot;COMMON-LISP-USER&amp;quot;&amp;amp;gt;
+cl-user&amp;amp;gt;
+  &amp;lt;/pre&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;Old proof-of-concept source:
+
+&amp;lt;ul&amp;gt;
+
+
+
+&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;ibcl.lisp&amp;quot;&amp;gt;ibcl.lisp&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
+
+
+
+&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;ibcl-bootstrap.lisp&amp;quot;&amp;gt;ibcl-bootstrap.lisp&amp;lt;/a&amp;gt;
+        A script to generate an executable image using
+        IMAGE-BASED-COMMON-LISP instead of COMMON-LISP.
+        For &amp;lt;a href=&amp;quot;http://clisp.cons.org/&amp;quot;&amp;gt;clisp&amp;lt;/a&amp;gt;
+        or  &amp;lt;a href=&amp;quot;http://sbcl.sourceforge.net/&amp;quot;&amp;gt;sbcl&amp;lt;/a&amp;gt;.&amp;lt;/li&amp;gt;
+
+
+
+&amp;lt;/ul&amp;gt;
+
+
+  &amp;lt;/p&amp;gt;
+
+
+
+&amp;lt;/p&amp;gt;
 &amp;lt;/div&amp;gt;
-en&amp;lt;/div&amp;gt;
-</description></item><item><dc:identifier>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/brainfuck/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>Brainfuck, Common Lisp, Lisp, virtual machine, compiler, emulator</dc:language><dc:format>text/html</dc:format><title>Brainfuck</title><link>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/brainfuck/index.html</link><guid isPermaLink="true">http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/brainfuck/index.html</guid><category>lisp</category><pubDate>Mon, 11 Sep 2005 12:00:00 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
+&amp;lt;/div&amp;gt;
+</description></item><item><dc:identifier>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/brainfuck/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>en</dc:language><dc:format>text/html</dc:format><title>Brainfuck</title><link>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/brainfuck/index.html</link><guid isPermaLink="true">http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/brainfuck/index.html</guid><category>lisp</category><pubDate>Mon, 11 Sep 2005 12:00:00 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
 &amp;lt;div class=&amp;quot;header&amp;quot;&amp;gt;
 &amp;lt;img src=&amp;quot;http://www.informatimago.com/blog/brainfuck.jpg&amp;quot; height=&amp;quot;100px&amp;quot; class=&amp;quot;floatRight&amp;quot;&amp;gt;&amp;lt;/img&amp;gt;
 &amp;lt;h1&amp;gt;Brainfuck in Lisp -- Lisp in Brainfuck&amp;lt;/h1&amp;gt;
 &amp;lt;p&amp;gt;A Brainfuck implementation.&amp;lt;/p&amp;gt;
 &amp;lt;p&amp;gt;&amp;lt;small&amp;gt;&amp;lt;a href=&amp;quot;mailto:pjb+blog@informatimago.com&amp;quot;&amp;gt;Pascal J. Bourguignon&amp;lt;/a&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
-&amp;lt;p&amp;gt;&amp;lt;small&amp;gt;BASIC in Common Lisp&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
+&amp;lt;p&amp;gt;&amp;lt;small&amp;gt;Brainfuck, Common Lisp, Lisp, virtual machine, compiler, emulator&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
+&amp;lt;/div&amp;gt;
+&amp;lt;div class=&amp;quot;document&amp;quot; id=&amp;quot;brainfuck&amp;quot;&amp;gt;
+
+
+&amp;lt;h1&amp;gt;Brainfuck in Lisp&amp;lt;/h1&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;This file contains:
+
+&amp;lt;ul&amp;gt;
+
+
+
+
+&amp;lt;li&amp;gt;a brainfuck virtual machine in Lisp&amp;lt;/li&amp;gt;
+
+
+
+
+&amp;lt;li&amp;gt;a brainfuck optimizing compiler, translates to lisp and compiles
+        lisp to native code&amp;lt;/li&amp;gt;
+
+
+
+
+&amp;lt;li&amp;gt;a sketch for an implementation of a lisp on brainfuck. Nothing
+        much actually, some macros to generate brainfuck code from lisp,
+        some lisp &amp;quot;vm&amp;quot; primitives.  I kind of abandonned this, given the
+        time complexity of any non-trivial brainfuck program and space
+        limitations of the brainfuck virtual machine (however, this
+        brainfuck to lisp compiler reduces the time complexities by using
+        some random access to the memory, so it might be practical. Not
+        that there is no limitation on the size of the
+        programs...).
+&amp;lt;br&amp;gt;Instead of implementing a lisp system over the
+        brainfuck virtual machine, it might be more practical to implement
+        a lisp compiler generating optimized brainfuck code.&amp;lt;/br&amp;gt;
+&amp;lt;/li&amp;gt;
+
+
+
+
+&amp;lt;/ul&amp;gt;
+
+
+  &amp;lt;/p&amp;gt;
+
+
+
+
+
+&amp;lt;ul&amp;gt;
+
+
+
+&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;bf.lisp&amp;quot;&amp;gt;bf.lisp&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
+
+
+
+&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;99botles.bf&amp;quot;&amp;gt;99botles.bf -- the &amp;quot;99 Bottles&amp;quot; program in brainfuck&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
+
+
+
+&amp;lt;/ul&amp;gt;
+
+
+
 &amp;lt;/div&amp;gt;
-en&amp;lt;/div&amp;gt;
-</description></item><item><dc:identifier>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/aim-8/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>LISP, Common Lisp, AIM-8, John McCarthy</dc:language><dc:format>text/html</dc:format><title>The original LISP</title><link>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/aim-8/index.html</link><guid isPermaLink="true">http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/aim-8/index.html</guid><category>lisp</category><pubDate>Sun, 24 Oct 2004 12:00:00 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
+&amp;lt;/div&amp;gt;
+</description></item><item><dc:identifier>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/aim-8/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>en</dc:language><dc:format>text/html</dc:format><title>The original LISP</title><link>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/aim-8/index.html</link><guid isPermaLink="true">http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/aim-8/index.html</guid><category>lisp</category><pubDate>Sun, 24 Oct 2004 12:00:00 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
 &amp;lt;div class=&amp;quot;header&amp;quot;&amp;gt;
 &amp;lt;img src=&amp;quot;http://www.informatimago.com/blog/aim-8-mccarthy.gif&amp;quot; height=&amp;quot;100px&amp;quot; class=&amp;quot;floatRight&amp;quot;&amp;gt;&amp;lt;/img&amp;gt;
 &amp;lt;h1&amp;gt;The Original LISP&amp;lt;/h1&amp;gt;
 &amp;lt;p&amp;gt;An implementation of the Original LISP in the AIM-8,
     including a transcription of said memo.&amp;lt;/p&amp;gt;
 &amp;lt;p&amp;gt;&amp;lt;small&amp;gt;&amp;lt;a href=&amp;quot;mailto:pjb+blog@informatimago.com&amp;quot;&amp;gt;Pascal J. Bourguignon&amp;lt;/a&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
-&amp;lt;p&amp;gt;&amp;lt;small&amp;gt;AIM-8, The Original LISP&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
+&amp;lt;p&amp;gt;&amp;lt;small&amp;gt;LISP, Common Lisp, AIM-8, John McCarthy&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
+&amp;lt;/div&amp;gt;
+&amp;lt;div class=&amp;quot;document&amp;quot; id=&amp;quot;original-lisp&amp;quot;&amp;gt;
+
+
+&amp;lt;h1&amp;gt;The original LISP&amp;lt;/h1&amp;gt;
+
+
+
+&amp;lt;p&amp;gt;Here is an implementation of the Original LISP as documented in
+  &amp;lt;quote&amp;gt;
+&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;
+                                  March 4, 1959
+
+    Artificial Intelligence Project--RLE and MIT Computation Center
+
+                           Memo 8
+
+    RECURSIVE FUNCTIONS OF SYMBOLIC EXPRESSIONS AND THEIR COMPUTATION
+
+                         BY MACHINE
+
+                       by J. McCarthy
+   &amp;lt;/pre&amp;gt;
+&amp;lt;/quote&amp;gt;
+&amp;lt;ul&amp;gt;
+&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;aim-8.html&amp;quot;&amp;gt;A transcription into machine readable form
+                        (HTML and text)&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
+&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;ftp://publications.ai.mit.edu/ai-publications/pdf/AIM-008.pdf&amp;quot;&amp;gt;
+      AI Memo 8, AIM-008.pdf&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
+&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;http://www.ai.mit.edu/research/publications/browse/0000browse.shtml&amp;quot;&amp;gt;
+      CSAIL Digital Archive - Artificial Intelligence Laboratory Series,
+      Publications 0 through 99&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
+&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;http://www-formal.stanford.edu/jmc/history/lisp/lisp.html&amp;quot;&amp;gt;
+    History of Lisp&amp;lt;/a&amp;gt; by John McCarthy&amp;lt;/li&amp;gt;
+&amp;lt;/ul&amp;gt;
+&amp;lt;/p&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;The only symbols predefined are: DEFINE, LAMBDA, LABEL, COND, COMBINE,
+FIRST, REST, NULL, ATOM, EQ, NIL, T, and QUOTE. &amp;lt;/p&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;The file &amp;lt;a href=&amp;quot;aim-8.lisp&amp;quot;&amp;gt;aim-8.lisp&amp;lt;/a&amp;gt;
+     contains an implementation in Common-Lisp.&amp;lt;/p&amp;gt;
+
+
+
+&amp;lt;p&amp;gt;The file &amp;lt;a href=&amp;quot;aim-8.aim-8&amp;quot;&amp;gt;aim-8.aim-8&amp;lt;/a&amp;gt;
+     contains an implementation in AIM-8 LISP.&amp;lt;/p&amp;gt;
+
+
+
+&amp;lt;p&amp;gt;The file &amp;lt;a href=&amp;quot;examples.aim-8&amp;quot;&amp;gt;examples.aim-8&amp;lt;/a&amp;gt;
+     contains the other examples given in AIM-8: differential
+     and turing machine.&amp;lt;/p&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;(It should be  noted that &amp;quot;compiler&amp;quot; occurs 4  times in this Memo,
+      while &amp;quot;interpreter&amp;quot; doesn&#039;t appears.)&amp;lt;/p&amp;gt;
+
+
+
+
+
+&amp;lt;p&amp;gt;For more information about Lisp history, see the
+     &amp;lt;a href=&amp;quot;http://community.computerhistory.org/scc/projects/LISP/&amp;quot;&amp;gt;
+         Computer History Museum, History of Lisp&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;
+
+
+
+
+&amp;lt;h2&amp;gt;Exemple&amp;lt;/h2&amp;gt;
+
+
+
+&amp;lt;pre class=&amp;quot;dribble&amp;quot;&amp;gt;
+% &amp;lt;b&amp;gt;/usr/local/bin/clisp -norc -ansi &amp;lt;/b&amp;gt;
+  i i i i i i i       ooooo    o        ooooooo   ooooo   ooooo
+  I I I I I I I      8     8   8           8     8     o  8    8
+  I  \ `+&#039; /  I      8         8           8     8        8    8
+   \  `-+-&#039;  /       8         8           8      ooooo   8oooo
+    `-__|__-&#039;        8         8           8           8  8
+        |            8     o   8           8     o     8  8
+  ------+------       ooooo    8oooooo  ooo8ooo   ooooo   8
+
+Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
+Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
+Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
+Copyright (c) Bruno Haible, Sam Steingold 1999-2000
+Copyright (c) Sam Steingold, Bruno Haible 2001-2006
+
+[1]&amp;amp;gt; &amp;lt;b&amp;gt;(load (compile-file &amp;quot;aim-8.lisp&amp;quot;))&amp;lt;/b&amp;gt;
+;; Compiling file /local/users/pjb/src/public/small-cl-pgms/aim-8/aim-8.lisp ...
+;; Wrote file /local/users/pjb/src/public/small-cl-pgms/aim-8/aim-8.fas
+0 errors, 0 warnings
+;; Loading file /local/users/pjb/src/public/small-cl-pgms/aim-8/aim-8.fas ...
+;; Loaded file /local/users/pjb/src/public/small-cl-pgms/aim-8/aim-8.fas
+T
+[2]&amp;amp;gt; &amp;lt;b&amp;gt;(aim-8:repl)&amp;lt;/b&amp;gt;
+You&#039;ve got:
+    LAMBDA LABEL
+    COND AND OR NOT  COMBINE FIRST REST
+    NULL ATOM EQ NIL T QUOTE
+Extensions:
+    DEFINE RELOAD DUMP-ENVIRONMENT LOAD
+    QUIT
+AIM-8&amp;amp;gt; &amp;lt;b&amp;gt;(define maplist
+           (lambda (x f)
+             (cond ((null x) nil)
+                   (t        (combine (f x) (maplist (rest x) f))))))&amp;lt;/b&amp;gt;
+MAPLIST
+AIM-8&amp;amp;gt; &amp;lt;b&amp;gt;(define diff
+           (lambda (y x)
+             (cond
+               ((atom y)
+                (cond ((eq y x) (quote one))
+                      (t (quote zero))))
+               ((eq (first y) (quote plus))
+                (combine (quote plus)
+                         (maplist (rest y) (lambda (a) (diff (first a) x)))))
+               ((eq (first y) (quote times))
+                (combine (quote plus)
+                         (maplist
+                          (rest y)
+                          (lambda (a) (combine
+                                  (quote times)
+                                  (maplist
+                                   (rest y)
+                                   (lambda (w) (cond
+                                            ((not (eq a w)) (first w))
+                                            (t (diff (first w) x))
+                                            )))))))))))&amp;lt;/b&amp;gt;
+DIFF
+AIM-8&amp;amp;gt; &amp;lt;b&amp;gt;(diff (quote (plus (times a x) b)) (quote x))&amp;lt;/b&amp;gt;
+(PLUS (PLUS (TIMES ZERO X) (TIMES A ONE)) ZERO)
+AIM-8&amp;amp;gt; &amp;lt;b&amp;gt;(diff (quote (plus (times a x x) (times b x) c)) (quote x))&amp;lt;/b&amp;gt;
+(PLUS (PLUS (TIMES ZERO X X) (TIMES A ONE X) (TIMES A X ONE))
+ (PLUS (TIMES ZERO X) (TIMES B ONE)) ZERO)
+
+;; Beware, AIM-8 is defined with substitution evaluation.
+;; Therefore, for each occurence of a variable, the whole expression
+;; bound to this variable is evaluated again.  This gives surprizing
+;; results for procedures with side-effects like PRINT and READ.
+;; Moreover, this has the effect of giving exponential complexities very easily.
+
+AIM-8&amp;amp;gt; &amp;lt;b&amp;gt;((lambda (x) (combine x (combine x nil))) (print (quote a)))&amp;lt;/b&amp;gt;
+
+A
+A (A A)
+AIM-8&amp;amp;gt; &amp;lt;b&amp;gt;(quit)&amp;lt;/b&amp;gt;
+GOOD BYE
+NIL
+[3]&amp;amp;gt; &amp;lt;b&amp;gt;(quit)&amp;lt;/b&amp;gt;
+Bye.
+%
+
+  &amp;lt;/pre&amp;gt;
+
+
+
 &amp;lt;/div&amp;gt;
-en&amp;lt;/div&amp;gt;
-</description></item><item><dc:identifier>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/basic/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>BASIC, Common Lisp, Lisp</dc:language><dc:format>text/html</dc:format><title>BASIC</title><link>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/basic/index.html</link><guid isPermaLink="true">http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/basic/index.html</guid><category>lisp</category><pubDate>Mon, 19 May 2003 12:00:00 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
+&amp;lt;/div&amp;gt;
+</description></item><item><dc:identifier>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/basic/index.html</dc:identifier><dc:creator>pjb+blog@informatimago.com (Pascal J. Bourguignon)</dc:creator><dc:language>en</dc:language><dc:format>text/html</dc:format><title>BASIC</title><link>http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/basic/index.html</link><guid isPermaLink="true">http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/basic/index.html</guid><category>lisp</category><pubDate>Mon, 19 May 2003 12:00:00 +0200</pubDate><description>&amp;lt;div class=&amp;quot;blog&amp;quot;&amp;gt;
 &amp;lt;div class=&amp;quot;header&amp;quot;&amp;gt;
 &amp;lt;img src=&amp;quot;http://www.informatimago.com/blog/dartmouth-basic.jpg&amp;quot; height=&amp;quot;100px&amp;quot; class=&amp;quot;floatRight&amp;quot;&amp;gt;&amp;lt;/img&amp;gt;
 &amp;lt;h1&amp;gt;A Quick, Dirty and Ugly BASIC implemented in Common Lisp&amp;lt;/h1&amp;gt;
 &amp;lt;p&amp;gt;A Quick, Dirty and Ugly Basic interpreter&amp;lt;/p&amp;gt;
 &amp;lt;p&amp;gt;&amp;lt;small&amp;gt;&amp;lt;a href=&amp;quot;mailto:pjb+blog@informatimago.com&amp;quot;&amp;gt;Pascal J. Bourguignon&amp;lt;/a&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
-&amp;lt;p&amp;gt;&amp;lt;small&amp;gt;BASIC in Common Lisp&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
+&amp;lt;p&amp;gt;&amp;lt;small&amp;gt;BASIC, Common Lisp, Lisp&amp;lt;/small&amp;gt;&amp;lt;/p&amp;gt;
+&amp;lt;/div&amp;gt;
+&amp;lt;div class=&amp;quot;document&amp;quot; id=&amp;quot;basic&amp;quot;&amp;gt;
+
+
+&amp;lt;h1&amp;gt;BASIC&amp;lt;/h1&amp;gt;
+
+
+
+&amp;lt;h2&amp;gt;A Quick, Dirty and Ugly Basic interpreter&amp;lt;/h2&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;This is a silly BASIC interpreter, implemented in Common Lisp.&amp;lt;/p&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;The lines are tokenized and stored as-is in an array indexed by
+    the line number.  When interpreting the program, the instructions
+    are parsed directly from there ; the expressions are parsed into
+    trees which are then evaluated.&amp;lt;/p&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;The variables are stored into a hash table indexed by their
+    identifier (symbol). Undefined variables are taken as 0 or &amp;quot;&amp;quot;.&amp;lt;/p&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;We distinguish number and string variables depending on the presence
+    of a &#039;$&#039; character in the last position of the variable identifier.&amp;lt;/p&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;Variables are reset by the command RUN. (A program can be
+    restarted without losing the variable using the GOTO or GOSUB
+    statements).  Commands are not distinguished from statements and
+    may occur in a program. In particular, LOAD could be used to
+    load a subprogram overlay, and takes a line number where to jump
+    to. &amp;lt;/p&amp;gt;
+
+
+
+
+&amp;lt;p&amp;gt;Programs are loaded and saved in source form.&amp;lt;/p&amp;gt;
+
+
+
+
+&amp;lt;ul&amp;gt;
+
+
+
+&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;basic.lisp&amp;quot;&amp;gt;basic.lisp&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
+
+
+
+&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;test1.basic&amp;quot;&amp;gt;test1.basic&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
+
+
+
+&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;test2.basic&amp;quot;&amp;gt;test2.basic&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
+
+
+
+&amp;lt;/ul&amp;gt;
+
+
+
+&amp;lt;/div&amp;gt;
 &amp;lt;/div&amp;gt;
-en&amp;lt;/div&amp;gt;
 </description></item></channel></rss>
\ No newline at end of file
ViewGit