<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Reality tunnels</title>
	<atom:link href="http://blog.superadditive.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.superadditive.com</link>
	<description>Pseudo-random thoughts by Juan M. Bello Rivas</description>
	<pubDate>Mon, 05 May 2008 12:04:40 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Changes</title>
		<link>http://blog.superadditive.com/2008/05/05/changes/</link>
		<comments>http://blog.superadditive.com/2008/05/05/changes/#comments</comments>
		<pubDate>Mon, 05 May 2008 12:04:40 +0000</pubDate>
		<dc:creator>jmbr</dc:creator>
		
		<category><![CDATA[uncategorized]]></category>

		<guid isPermaLink="false">http://blog.superadditive.com/?p=85</guid>
		<description><![CDATA[I&#8217;ll be writing future concert reviews and whatnot at http://jmbr.superadditive.com
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ll be writing future concert reviews and whatnot at <a title="My reality tunnel" href="http://jmbr.superadditive.com">http://jmbr.superadditive.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.superadditive.com/2008/05/05/changes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The Gutter Twins, Madrid 2008.04.27</title>
		<link>http://blog.superadditive.com/2008/04/29/the-gutter-twins-madrid-20080427/</link>
		<comments>http://blog.superadditive.com/2008/04/29/the-gutter-twins-madrid-20080427/#comments</comments>
		<pubDate>Tue, 29 Apr 2008 16:08:56 +0000</pubDate>
		<dc:creator>jmbr</dc:creator>
		
		<category><![CDATA[music]]></category>

		<guid isPermaLink="false">http://blog.superadditive.com/?p=82</guid>
		<description><![CDATA[
Whenever you buy a ticket for a show in which Mark Lanegan is involved, you can rest assured that he and his band will play top notch rock and roll, as it was the case.  The act left me in a pleasant mood that was unfortunately cut short by sad news.
]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone" src="http://farm4.static.flickr.com/3052/2449244493_33a41e466c_m_d.jpg" alt="" /><br />
Whenever you buy a ticket for a show in which Mark Lanegan is involved, you can rest assured that he and his band will play top notch rock and roll, as it was the case.  The act left me in a pleasant mood that was unfortunately cut short by <a href="http://lemonodor.com/archives/2008/04/for_great_tock.html">sad news</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.superadditive.com/2008/04/29/the-gutter-twins-madrid-20080427/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Queens of the Stone Age, Barcelona 2008.02.16</title>
		<link>http://blog.superadditive.com/2008/02/18/queens-of-the-stone-age-barcelona-20080216/</link>
		<comments>http://blog.superadditive.com/2008/02/18/queens-of-the-stone-age-barcelona-20080216/#comments</comments>
		<pubDate>Mon, 18 Feb 2008 08:36:38 +0000</pubDate>
		<dc:creator>jmbr</dc:creator>
		
		<category><![CDATA[music]]></category>

		<guid isPermaLink="false">http://blog.superadditive.com/2008/02/18/queens-of-the-stone-age-barcelona-20080216/</guid>
		<description><![CDATA[
Good concert by the greatest rock band of the moment.
]]></description>
			<content:encoded><![CDATA[<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="wmode" value="transparent" /><param name="src" value="http://www.youtube.com/v/lXOK0ymHrN0&amp;rel=1" /><embed type="application/x-shockwave-flash" width="425" height="355" src="http://www.youtube.com/v/lXOK0ymHrN0&amp;rel=1" wmode="transparent"></embed></object></p>
<p>Good concert by the greatest rock band of the moment.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.superadditive.com/2008/02/18/queens-of-the-stone-age-barcelona-20080216/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Planet Sage</title>
		<link>http://blog.superadditive.com/2007/12/13/planet-sage/</link>
		<comments>http://blog.superadditive.com/2007/12/13/planet-sage/#comments</comments>
		<pubDate>Thu, 13 Dec 2007 10:58:06 +0000</pubDate>
		<dc:creator>jmbr</dc:creator>
		
		<category><![CDATA[math]]></category>

		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.superadditive.com/2007/12/13/planet-sage/</guid>
		<description><![CDATA[There&#8217;s a new blog aggregator dedicated to Sage, it is Planet Sage.  Enjoy!
]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a new blog aggregator dedicated to <a href="http://www.sagemath.org">Sage</a>, it is <a href="http://planet.sagemath.org/">Planet Sage</a>.  Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.superadditive.com/2007/12/13/planet-sage/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Trivial doctests in Common Lisp</title>
		<link>http://blog.superadditive.com/2007/12/06/trivial-doctests-in-common-lisp/</link>
		<comments>http://blog.superadditive.com/2007/12/06/trivial-doctests-in-common-lisp/#comments</comments>
		<pubDate>Thu, 06 Dec 2007 11:50:32 +0000</pubDate>
		<dc:creator>jmbr</dc:creator>
		
		<category><![CDATA[lisp]]></category>

		<guid isPermaLink="false">http://blog.superadditive.com/2007/12/06/trivial-doctests-in-common-lisp/</guid>
		<description><![CDATA[The pros and cons of doctests have been discussed elsewhere so I won&#8217;t enter that debate here.
I was told it was trivial to roll your own doctest suite in Common Lisp.  I have done that and it is easy indeed but I have included the code in incf-cl for those who would like to [...]]]></description>
			<content:encoded><![CDATA[<p>The pros and cons of <a href="http://en.wikipedia.org/wiki/Doctest">doctests</a> have been <a href="http://groups.google.com/group/comp.lang.lisp/search?group=comp.lang.lisp&amp;q=doctest&amp;qt_g=Search+this+group">discussed elsewhere</a> so I won&#8217;t enter that debate here.</p>
<p>I was told it was trivial to roll your own doctest suite in Common Lisp.  I have done that and it is easy indeed but I have included the code in <a href="http://superadditive.com/projects/incf-cl">incf-cl</a> for those who would like to use it right away.<br />
<span id="more-77"></span><br />
Here&#8217;s an example:</p>
<pre>  (<span style="color: #afeeee;"><strong>defpackage</strong></span> <span style="color: #87ceeb;"><strong>:test</strong></span>
    (<span style="color: #7fffd4;">:use</span> <span style="color: #7fffd4;">:common-lisp</span> <span style="color: #7fffd4;">:incf-cl</span>)
    (<span style="color: #7fffd4;">:export</span> <span style="color: #7fffd4;">:factorial</span>))

  (<span style="color: #afeeee;"><strong>in-package</strong></span> <span style="color: #7fffd4;">:test</span>)           

  (<span style="color: #afeeee;"><strong>defun</strong></span> <span style="color: #7fffd4;"><strong>factorial</strong></span> (n <span style="color: #87ceeb;"><strong>&amp;optional</strong></span> (acc 1))
    <span style="color: #87cefa;">&#8220;Returns the factorial of N, where N is an integer &gt;= 0.

    Examples:

    TEST&gt; (assemble (factorial n) (&lt;- n (range 1 5)))
    (1 2 6 24 120)

    TEST&gt; (factorial 450/15)
    265252859812191058636308480000000

    TEST&gt; (signals-p arithmetic-error (factorial -1))
    T

    TEST&gt; (signals-p type-error (factorial 30.1))
    T

    TEST&gt; (factorial 0)
    1&#8243;</span>
    (<span style="color: #afeeee;"><strong>declare</strong></span> (type integer n))

    (<span style="color: #afeeee;"><strong>cond</strong></span>
      ((minusp n) (<span style="color: #ff0000;"><strong>error</strong></span> &#8216;arithmetic-error))
      ((/= n (floor n)) (<span style="color: #ff0000;"><strong>error</strong></span> &#8216;type-error)))

    (<span style="color: #afeeee;"><strong>if</strong></span> (= n 0)
        acc
        (factorial (1- n) (* n acc))))</pre>
<pre><span style="color: #afeeee;"><strong>CL-USER&gt; </strong></span><strong>(doctest :test)</strong>
<span style="color: #87cefa;">&#8230;..</span><span style="color: #ff0000;">T</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.superadditive.com/2007/12/06/trivial-doctests-in-common-lisp/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Black Rebel Motorcycle Club, Madrid 2007.12.03</title>
		<link>http://blog.superadditive.com/2007/12/05/black-rebel-motorcycle-club-madrid-20071203/</link>
		<comments>http://blog.superadditive.com/2007/12/05/black-rebel-motorcycle-club-madrid-20071203/#comments</comments>
		<pubDate>Wed, 05 Dec 2007 22:32:31 +0000</pubDate>
		<dc:creator>jmbr</dc:creator>
		
		<category><![CDATA[music]]></category>

		<guid isPermaLink="false">http://blog.superadditive.com/2007/12/05/black-rebel-motorcycle-club-madrid-20071203/</guid>
		<description><![CDATA[It was an awesome and very energetic concert!

]]></description>
			<content:encoded><![CDATA[<p>It was an awesome and very energetic concert!</p>
<p><a href="http://www.flickr.com/photo_zoom.gne?id=2086311098&amp;size=l"><img src="http://blog.superadditive.com/wp-content/uploads/2007/12/2086311098_329ec2b146_m.jpg" alt="brmc-madrid-2007-12-03.jpg" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.superadditive.com/2007/12/05/black-rebel-motorcycle-club-madrid-20071203/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Call graphs using the GNU Project Debugger</title>
		<link>http://blog.superadditive.com/2007/12/01/call-graphs-using-the-gnu-project-debugger/</link>
		<comments>http://blog.superadditive.com/2007/12/01/call-graphs-using-the-gnu-project-debugger/#comments</comments>
		<pubDate>Sat, 01 Dec 2007 10:46:46 +0000</pubDate>
		<dc:creator>jmbr</dc:creator>
		
		<category><![CDATA[programming]]></category>

		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://blog.superadditive.com/2007/12/01/call-graphs-using-the-gnu-project-debugger/</guid>
		<description><![CDATA[Chris Ball asked everyone who likes Unix for a tool which would be to function calls what strace and ltrace are for system and library calls respectively.
I wanted to write this myself for a long time but what prevented me from doing so was the fact that I had come up with a trivial shell/awk [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.printf.net/articles/2007/11/30/tracing-internal-function-calls-in-a-binary">Chris Ball asked everyone who likes Unix</a> for a tool which would be to function calls what strace and ltrace are for system and library calls respectively.</p>
<p>I wanted to write this myself for a long time but what prevented me from doing so was the fact that I had come up with a trivial shell/awk script that achieved almost the same goal.  <span id="more-74"></span>Since that little program was useful for someone other than me, I thought I&#8217;d polish it slightly and post it <a href="http://superadditive.com/software/callgraph.tar.gz">here</a>.</p>
<p>This tool&#8217;s original intent was to print a call graph from a given program.  It works by taking control of <a href="http://www.gnu.org/software/gdb/">GDB</a> and automatically setting breakpoints at each function call.  Of course, the executable must include debugging symbols (that is, it must have been compiled with gcc&#8217;s -g option).  Here&#8217;s some sample output (the format is: caller callee arguments):<br />
<code><br />
xmltree_parse xmltree_itor_next (self=0x80571e8)<br />
xmltree_itor_next xmlnode_stack_push (stack=0x80571f0, n=0x8056780)<br />
xmltree_parse h_requires (n=0x8056808, u=0xbff9d504)<br />
h_requires xmlnode_get_attr (self=0x8056808, name=0x80520ea "plugin")<br />
h_requires probe_get_name (self=0x8056af0)<br />
h_requires htab_lookup (self=0x8058100, key=0x8056868, len=3, create=0, value=0x0)<br />
</code></p>
<p>You can use the included <strong>cg2dot.awk</strong> script to produce files suitable for processing with <a href="http://www.graphviz.org">graphviz</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.superadditive.com/2007/12/01/call-graphs-using-the-gnu-project-debugger/feed/</wfw:commentRss>
		</item>
		<item>
		<title>List comprehensions in Common Lisp</title>
		<link>http://blog.superadditive.com/2007/11/09/list-comprehensions-in-common-lisp/</link>
		<comments>http://blog.superadditive.com/2007/11/09/list-comprehensions-in-common-lisp/#comments</comments>
		<pubDate>Fri, 09 Nov 2007 15:23:40 +0000</pubDate>
		<dc:creator>jmbr</dc:creator>
		
		<category><![CDATA[lisp]]></category>

		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blog.superadditive.com/2007/11/09/list-comprehensions-in-common-lisp/</guid>
		<description><![CDATA[List comprehensions are a programming language construct that closely mimics the way you declare a set in mathematics and sometimes are more succinct and readable than using a composition of mapcar, delete-if or an ad hoc imperative loop.
Having list comprehensions in Lisp was something I was missing from Python and Haskell.  So I tried [...]]]></description>
			<content:encoded><![CDATA[<p>List comprehensions are a programming language construct that closely mimics the way you declare a set in mathematics and sometimes are more succinct and readable than using a composition of <strong>mapcar</strong>, <strong>delete-if</strong> or an ad hoc imperative loop.</p>
<p>Having list comprehensions in Lisp was something I was missing from Python and Haskell.  So I tried to find something similar and discovered that <span id="more-71"></span> <a href="http://subpic.blogspot.com/2007/02/more-then-list-comprehensions-lisp-loop.html">the LOOP facility can be used as a means of achieving this goal</a> but this, although nice, didn&#8217;t feel natural enough.  In the end, I read the paper <a href="http://www.iro.umontreal.ca/~latendre/publications/listCompFinal.pdf">Simple and Efficient Compilation of List Comprehension in Common Lisp</a> by Mario Latendresse which appeared at <a href="http://www.international-lisp-conference.org/2007/speakers#latendresse_mario">ILC 2007</a> and have decided to adopt that implementation for translating list comprehensions into <strong>loop</strong>s.</p>
<p>For example, the set</p>
<p><img style="border: 0;" src="http://superadditive.com/cgi-bin/mimetex.cgi?\reverse%20\large%20\{%20(x,%20y)%20\in%20\{0,%201,%202\}^2%20|%20x%20+%20y%20=%202%20\}" alt="\{ (x, y) \in \{0, 1, 2\}^2 | x +y = 2&lt;br /&gt; \}" /></p>
<p>can be expressed as</p>
<pre><strong>(lc (cons x y) (&lt;- x &#8216;(0 1 2)) (&lt;- y &#8216;(0 1 2)) (= (+ x y) 2)) </strong> ==&gt;
<span style="color: #ff0000;">((0 . 2) (1 . 1) (2 . 0))</span></pre>
<p>Another example:</p>
<pre><strong>(lc (sin x) (&lt;- x (range 0 .1 (/ pi 2))))</strong> ==&gt;
<span style="color: #ff0000;">(0.0 0.09983342 0.19866933 0.29552022 0.38941833 0.47942555 0.5646425 0.6442177
 0.71735615 0.783327 0.8414711 0.8912074 0.93203914 0.96355826 0.9854498
 0.997495)</span></pre>
<p>The macro I&#8217;m using is <strong>lc</strong>:</p>
<pre>(<span style="color: #afeeee;"><strong>defmacro</strong></span> <span style="color: #7fffd4;"><strong>lc</strong></span> (collection-form <span style="color: #87ceeb;"><strong>&amp;rest</strong></span> quantifiers)
  <span style="color: #87cefa;">&#8220;Assembles a multiset containing the results of evaluating
COLLECTION-FORM and subject to QUANTIFIERS.&#8221;</span>
  (<span style="color: #afeeee;"><strong>labels</strong></span> ((translate (collection-form qs)
             (<span style="color: #afeeee;"><strong>if</strong></span> (null qs)
                 `(collect ,collection-form)
                 (translate-generator-or-filter collection-form qs)))
           (translate-generator-or-filter (collection-form qs)
             (<span style="color: #afeeee;"><strong>let</strong></span> ((q (first qs))
                   (qr (rest qs)))
               (<span style="color: #afeeee;"><strong>if</strong></span> (eq (first q) &#8216;&lt;-)
                   (translate-generator collection-form (second q) (third q) qr)
                   (translate-filter collection-form q qr))))
           (translate-generator (collection-form variable collection qs)
             `(nconc (<span style="color: #afeeee;"><strong>loop</strong></span> for ,variable in ,collection
                          ,@(translate collection-form qs))))
           (translate-filter (collection-form filter-form qs)
             `(<span style="color: #afeeee;"><strong>when</strong></span> ,filter-form ,@(translate collection-form qs))))
    (<span style="color: #afeeee;"><strong>when</strong></span> quantifiers
      `(<span style="color: #afeeee;"><strong>loop</strong></span> repeat 1 ,@(translate collection-form quantifiers)))))</pre>
<p>and the helper function <a title="range.lisp" href="http://blog.superadditive.com/wp-content/uploads/2007/11/range.lisp"><strong>range</strong></a> is:</p>
<pre>(<span style="color: #afeeee;"><strong>defun</strong></span> <span style="color: #7fffd4;"><strong>range</strong></span> (a b <span style="color: #87ceeb;"><strong>&amp;optional</strong></span> c)
  <span style="color: #87cefa;">&#8220;Builds a range of numbers as Matlab would do&#8221;</span>
  (<span style="color: #afeeee;"><strong>flet</strong></span> ((|:| (start step stop)
           (<span style="color: #ff0000;"><strong>assert</strong></span> (and (&lt;= start stop) (&gt; step 0)))
           (<span style="color: #afeeee;"><strong>loop</strong></span> for x from start to stop by step collect x)))
    (<span style="color: #afeeee;"><strong>if</strong></span> c
        (|:| a b c)
        (|:| a 1 b))))</pre>
<p>A possible enhancement would be to translate to <strong>series</strong> instead<br />
of <strong>loop</strong> in order to have lazy list comprehensions.</p>
<p>This code (and more) can be found in the <a href="http://superadditive.com/projects/incf-cl/">(incf cl) utilities</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.superadditive.com/2007/11/09/list-comprehensions-in-common-lisp/feed/</wfw:commentRss>
		</item>
		<item>
		<title>cl-buchberger is out!</title>
		<link>http://blog.superadditive.com/2007/10/19/cl-buchberger-is-out/</link>
		<comments>http://blog.superadditive.com/2007/10/19/cl-buchberger-is-out/#comments</comments>
		<pubDate>Fri, 19 Oct 2007 18:36:10 +0000</pubDate>
		<dc:creator>jmbr</dc:creator>
		
		<category><![CDATA[lisp]]></category>

		<category><![CDATA[math]]></category>

		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blog.superadditive.com/2007/10/19/cl-buchberger-is-out/</guid>
		<description><![CDATA[I&#8217;ve just released the first version of cl-buchberger, a Common Lisp
implementation of Buchberger&#8217;s algorithm for the computation of
Gröbner bases.
There are many improvements waiting in the pipeline but the basic
functionality is there.

You can read more about cl-buchberger here.
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just released the first version of cl-buchberger, a Common Lisp<br />
implementation of Buchberger&#8217;s algorithm for the computation of<br />
Gröbner bases.</p>
<p>There are many improvements waiting in the pipeline but the basic<br />
functionality is there.</p>
<p><img src="http://blog.superadditive.com/wp-content/uploads/2007/10/lisplogo_alien_128.png" alt="Lisp logo" style="border: 0" /></p>
<p>You can <a href="http://common-lisp.net/project/cl-buchberger/">read more about cl-buchberger here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.superadditive.com/2007/10/19/cl-buchberger-is-out/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Soulsavers, Madrid 2007.10.12</title>
		<link>http://blog.superadditive.com/2007/10/13/soulsavers-madrid-20071012/</link>
		<comments>http://blog.superadditive.com/2007/10/13/soulsavers-madrid-20071012/#comments</comments>
		<pubDate>Sat, 13 Oct 2007 01:37:47 +0000</pubDate>
		<dc:creator>jmbr</dc:creator>
		
		<category><![CDATA[music]]></category>

		<guid isPermaLink="false">http://blog.superadditive.com/2007/10/13/soulsavers-madrid-20071012/</guid>
		<description><![CDATA[The band was just superb.  One of the most remarkable moments was when they played the grooviest cover of Some Velvet Morning that I have ever heard.

]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.thesoulsavers.com" title="Soulsavers">band</a> was just <strong>superb</strong>.  One of the most remarkable moments was when they played the grooviest cover of <a href="http://en.wikipedia.org/wiki/Some_Velvet_Morning" title="Lee Hazelwood &#038; Nancy Sinatra - Some Velvet Morning">Some Velvet Morning</a> that I have ever heard.</p>
<p><a href="http://flickr.com/photos/elchicodelaleche/1543549203/in/set-72157602372442233/" title="Soulsavers featuring Mark Lanegan"><img src="http://blog.superadditive.com/wp-content/uploads/2007/10/1543549203_9d0f26661c_m.jpg" alt="Soulsavers feat. Mark Lanegan" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.superadditive.com/2007/10/13/soulsavers-madrid-20071012/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
