<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Irreal</title>
	<atom:link href="http://irreal.org/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://irreal.org/blog</link>
	<description>The minds had long ago come up with a proper name for it; they called it the Irreal, but they thought of it as Infinite Fun. That was what they really knew it as. The Land of Infinite Fun. --Iain M. Banks, Excession</description>
	<lastBuildDate>Thu, 10 May 2012 23:35:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Using Quickproject</title>
		<link>http://irreal.org/blog/?p=817</link>
		<comments>http://irreal.org/blog/?p=817#comments</comments>
		<pubDate>Thu, 10 May 2012 23:35:12 +0000</pubDate>
		<dc:creator>jcs</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Lisp]]></category>

		<guid isPermaLink="false">http://irreal.org/blog/?p=817</guid>
		<description><![CDATA[Earlier this week I wrote about Using Quicklisp and mentioned another Xach project, Quickproject (the link takes you to Github, but the best way to get it is with Quicklisp). What quickproject does is to initialize a project.asd, package.lisp, project.lisp, &#8230; <a href="http://irreal.org/blog/?p=817">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Earlier this week I wrote about <a href="http://irreal.org/blog/?p=812">Using Quicklisp</a> and mentioned another Xach project, <a href="https://github.com/xach/quickproject">Quickproject</a> (the link takes you to Github, but the best way to get it is with Quicklisp). What quickproject does is to initialize a <code>project.asd</code>, <code>package.lisp</code>, <code>project.lisp</code>, and <code>README.txt</code> files for a project. The idea, as explained in Beane&#8217;s post on <a href="http://xach.livejournal.com/278047.html">building small Lisp projects</a>, is to bootstrap a project by setting up initial versions of the files you&#8217;ll need for an ASDF loadable project. </p>
<p> I expected that it would be really useful to working on medium sized projects such as libraries. I&#8217;m sure it will be but today I wanted to experiment with a small, single .lisp file project. I decided to try out Quickproject to see how it would work for a really small project. It was a revelation as to how much easier it made things. I started with </p>
<pre class="src src-lisp">(quickproject:make-project <span style="color: #8b2252;">"~/lisp/levenshtein/"</span>)
</pre>
<p> then opened the <code>~/lisp/levenshtein/levenshtein.lisp</code> file and started hacking. When I got finished I was able to load it with Quicklisp even though I had not configured ASDF to search <code>~/lisp/</code> for projects. I&#8217;m really impressed with how easy and useful it is. If you regularly write in Common Lisp you <i>really</i> need to get Quicklisp and Quickproject. They&#8217;ll make your life a whole lot more pleasant. </p>
]]></content:encoded>
			<wfw:commentRss>http://irreal.org/blog/?feed=rss2&#038;p=817</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>John Gruber On The Latest DVD Silliness</title>
		<link>http://irreal.org/blog/?p=816</link>
		<comments>http://irreal.org/blog/?p=816#comments</comments>
		<pubDate>Wed, 09 May 2012 21:53:32 +0000</pubDate>
		<dc:creator>jcs</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[DRM]]></category>

		<guid isPermaLink="false">http://irreal.org/blog/?p=816</guid>
		<description><![CDATA[ars technica is reporting that DVDs and Blu-rays will now carry two unskippable government warnings. These warnings&#8212;the usual nonsense about going to hell and jail if you copy the DVD/Blue-ray&#8212;will be shown back-to-back for 10 seconds each and will be &#8230; <a href="http://irreal.org/blog/?p=816">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://arstechnica.com/">ars technica</a> is reporting that <a href="http://arstechnica.com/tech-policy/2012/05/dvds-and-blu-rays-will-now-carry-two-unskippable-government-warnings/">DVDs and Blu-rays will now carry two unskippable government warnings</a>. These warnings&mdash;the usual nonsense about going to hell and jail if you copy the DVD/Blue-ray&mdash;will be shown back-to-back for 10 seconds each and will be unskippable. Gruber <a href="http://daringfireball.net/linked/2012/05/09/unskippable">deadpans</a> </p>
<blockquote>
<p>So to encourage people not to engage in piracy, they’re going to force<br />
everyone to watch yet another annoying, time-wasting,<br />
gratification-delaying warning screen that can only be avoided by<br />
engaging in piracy.
</p>
</blockquote>
<p> Really, these notices are completely useless. If you&#8217;re going to pirate, these won&#8217;t give you a second&#8217;s pause. If, like most people, you don&#8217;t pirate movies it&#8217;s just an annoying inconvenience that make you feel sympathy for the pirates and loathing for the studios. </p>
]]></content:encoded>
			<wfw:commentRss>http://irreal.org/blog/?feed=rss2&#038;p=816</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cl-test-grid</title>
		<link>http://irreal.org/blog/?p=815</link>
		<comments>http://irreal.org/blog/?p=815#comments</comments>
		<pubDate>Tue, 08 May 2012 21:57:44 +0000</pubDate>
		<dc:creator>jcs</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Lisp]]></category>

		<guid isPermaLink="false">http://irreal.org/blog/?p=815</guid>
		<description><![CDATA[Vladimir Sedach has a post up that describes the cl-test-grid project. The idea is that Quicklisp users download the cl-test-grid, tell it what CL implementations are available, and run the test. It runs tests against many of the libraries in &#8230; <a href="http://irreal.org/blog/?p=815">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Vladimir Sedach has a <a href="http://carcaddar.blogspot.com/2012/05/finding-bugs-in-quicklisp-libraries.html">post</a> up that describes the <code>cl-test-grid</code> project. The idea is that Quicklisp users download the <code>cl-test-grid</code>, tell it what CL implementations are available, and run the test. It runs tests against many of the libraries in the latest Quicklisp release and sends the results to a public report site and a bug tracker site. </p>
<p> This is a way of helping library writers get their libraries tested in as many environments as possible. It seems like a good idea so if you are willing to donate a few cycles it&#8217;s a worthwhile exercise. See Sedach&#8217;s post for details. </p>
]]></content:encoded>
			<wfw:commentRss>http://irreal.org/blog/?feed=rss2&#038;p=815</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scheme and Common Lisp</title>
		<link>http://irreal.org/blog/?p=813</link>
		<comments>http://irreal.org/blog/?p=813#comments</comments>
		<pubDate>Mon, 07 May 2012 21:56:57 +0000</pubDate>
		<dc:creator>jcs</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Lisp]]></category>
		<category><![CDATA[Scheme]]></category>

		<guid isPermaLink="false">http://irreal.org/blog/?p=813</guid>
		<description><![CDATA[I&#8217;ve been using Scheme and Common Lisp almost exclusively for over 10 years. During that time, I tended to favor Scheme because I liked its clean design and simplicity, the named let, continuations, and the simplicity that being a Lisp-1 &#8230; <a href="http://irreal.org/blog/?p=813">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using Scheme and Common Lisp almost exclusively for over 10 years. During that time, I tended to favor Scheme because I liked its clean design and simplicity, the named let, continuations, and the simplicity that being a Lisp-1 brought. As I posted recently, <a href="http://irreal.org/blog/?p=757">Guile Scheme is broken on OS X Lion</a>. It&#8217;s still broken and as a result I have been using Common Lisp exclusively. </p>
<p> That has forced me to understand Common Lisp better and to become a more proficient Lisp programmer. At this point, I&#8217;m ready to say goodbye to Scheme. Common Lisp doesn&#8217;t have as simple a design but it <i>is</i> much more powerful. It&#8217;s easy to implement the named let functionality with a macro (see <a href="http://letoverlambda.com/index.cl/guest/chap3.html#sec_3">LoL</a> for an implementation) and as Doug Hoyte argues in <i>Let Over Lambda</i>, Lisp-2 is arguably better than Lisp-1. I&#8217;m not yet convinced of that last statement but using CL exclusively for the last month has made the difference fade into the background. That leaves only continuations. They&#8217;re certainly powerful but CL provides a way of doing everything I used them for. </p>
<p> One huge advantage of Common Lisp is that it&#8217;s standardized in a way that Scheme isn&#8217;t. I recently changed from Clozure CL to SBCL and I haven&#8217;t had to make any code changes. It&#8217;s <i>very</i> hard to do the same thing is Scheme. When I changed from Dr. Scheme (now Dr. Racket) to Guile I had to rewrite a lot of code. That carries over to libraries. It was pretty hard to find libraries that worked with any Scheme and although there are certainly CL libraries that use non standard features of a certain implementation and are not as a result portable, most libraries work just fine with any Lisp. Notable exceptions are things, like networking, that are not part of the standard. But even there, Zack Beane shows a very nice way of handling the differences with his Quicklisp implementation. </p>
<p> Finally, there&#8217;s a subtle difference in the feel of the two languages. CL seems to give me more power to solve problems. Thus, although I was a little annoyed that Guile won&#8217;t build under Lion (I know, it&#8217;s free and the code is there to fix), in retrospect, I think it was actually a good thing. It has made me reconnect strongly with my first Lisp and that&#8217;s working out very well for me. </p>
]]></content:encoded>
			<wfw:commentRss>http://irreal.org/blog/?feed=rss2&#038;p=813</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Using Quicklisp</title>
		<link>http://irreal.org/blog/?p=812</link>
		<comments>http://irreal.org/blog/?p=812#comments</comments>
		<pubDate>Sun, 06 May 2012 21:12:02 +0000</pubDate>
		<dc:creator>jcs</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://irreal.org/blog/?p=812</guid>
		<description><![CDATA[Back in March I wrote that I had loaded and starting using Zach Beane&#8217;s Quicklisp. Since then I have used it with several small projects and I really like it. It does two things for me: Makes it super easy &#8230; <a href="http://irreal.org/blog/?p=812">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Back in March I wrote that I had <a href="http://irreal.org/blog/?p=722">loaded and starting using Zach Beane&#8217;s Quicklisp</a>. Since then I have used it with several small projects and I <i>really</i> like it. It does two things for me: </p>
<ul>
<li>Makes it super easy to download libraries (see <a href="http://irreal.org/blog/">this</a> post, for   example) and keep them up to date. </li>
<li>Manage my own projects. </li>
</ul>
<p>That second item is, in many ways, even nicer than the ease with which you can retrieve libraries. Quicklisp can also load your local projects, so it&#8217;s easy to just do a </p>
<pre class="src src-lisp">(ql:quickload <span style="color: #8b2252;">"some-local-project"</span>)
</pre>
<p> to load your project into Lisp so that you can continue working on it. If your project is a library, Quicklisp will automatically load it for other projects that depend on it (via the .asd file). </p>
<p> Today, I was trawling around on Beane&#8217;s site, <a href="http://www.xach.com/">Xach.com</a>, and came across an excellent article he wrote about <a href="http://xach.livejournal.com/278047.html">Making a small Lisp project with quickproject and Quicklisp</a>. If you&#8217;re a Lisper and haven&#8217;t read this, you should head on over right now to see how a master does things. </p>
<p> One of the interesting things I learned from the article was quickproject. If you&#8217;ve ever put together a system with ASDF, you know that the process can be a little fiddly. You need to build the <code>package.lisp</code> file, the <code>project.asd</code> file, and your actual code files. Quickproject does much of the work for you. It will build default <code>package.lisp</code> and <code>project.asd</code> files based on the information you give it. It will even make an empty <code>project.lisp</code> file so that you open it in your editor and get right to work. </p>
<p> Naturally, quickproject is available with Quicklisp so I loaded onto my system. I haven&#8217;t had a chance to use it yet but I plan to start with my next project. </p>
]]></content:encoded>
			<wfw:commentRss>http://irreal.org/blog/?feed=rss2&#038;p=812</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Message From The EFF</title>
		<link>http://irreal.org/blog/?p=811</link>
		<comments>http://irreal.org/blog/?p=811#comments</comments>
		<pubDate>Sun, 06 May 2012 00:56:27 +0000</pubDate>
		<dc:creator>jcs</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://irreal.org/blog/?p=811</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><iframe width="560" height="315" src="http://www.youtube.com/embed/nLnIaNFGViw" frameborder="0" allowfullscreen></iframe> </p>
]]></content:encoded>
			<wfw:commentRss>http://irreal.org/blog/?feed=rss2&#038;p=811</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solution to the Two Challenges</title>
		<link>http://irreal.org/blog/?p=810</link>
		<comments>http://irreal.org/blog/?p=810#comments</comments>
		<pubDate>Fri, 04 May 2012 20:44:36 +0000</pubDate>
		<dc:creator>jcs</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Emacs]]></category>
		<category><![CDATA[Emacs-lisp]]></category>

		<guid isPermaLink="false">http://irreal.org/blog/?p=810</guid>
		<description><![CDATA[The other day, I presented two Elisp coding challenges. I specified Elisp because Irreal readers tend to like Emacs related posts. The down side of that is that several of you worried about bignums and other Emacs limitations. That wasn&#8217;t &#8230; <a href="http://irreal.org/blog/?p=810">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The other day, I presented <a href="http://irreal.org/blog/?p=808">two Elisp coding challenges</a>. I specified Elisp because Irreal readers tend to like Emacs related posts. The down side of that is that several of you worried about bignums and other Emacs limitations. That wasn&#8217;t my intent&mdash;I just thought the problems were interesting and might even come in handy someday in an interview. </p>
<p> In any event, here are my solutions. All the commenters who gave an answer for problem 1 (Given a list of integers from 1 to <i>n</i> but with one of the integers missing, write an efficient algorithm to find the missing integer.) gave the same <i>O</i>(<i>n</i>)/<i>O</i>(1) algorithm for time/space, namely just sum the integers up and subtract the sum from (n<sup>2</sup> + n) / 2 to find the missing number. </p>
<p> The solution to the second problem (Given a list of integers from 1 to <i>n</i> but with one of the integers missing and another repeated, find an efficient algorithm to find the missing and repeated numbers.) is similar except the we sum the numbers and their squares. If we let <i>delta<sub>1</sub></i> be the difference between the sum of the integers and the sum of the integers from 1 to <i>n</i>, and <i>delta<sub>2</sub></i> be the difference between the sum of the squares of the integers and the sum of the squares of the integers from 1 to <i>n</i>, we have: </p>
<ul>
<li><i>repeated</i> &#8211; <i>missing</i> = <i>delta<sub>1</sub></i> and </li>
<li><i>repeated<sup>2</sup></i> &#8211; <i>missing<sup>2</sup></i> = <i>delta<sub>2</sub></i>. </li>
</ul>
<p>From there, some very easy algebra (the quadratic terms drop out) we get </p>
<ul>
<li><i>repeated</i> = (<i>delta<sub>2</sub></i> + <i>delta<sub>1</sub><sup>2</sup></i>) / 2 <i>delta<sub>1</sub></i> </li>
<li><i>missing</i> = (<i>delta<sub>2</sub></i> &#8211; <i>delta<sub>1</sub><sup>2</sup></i>) / 2 <i>delta<sub>1</sub></i> </li>
</ul>
<p>Now it&#8217;s easy to write an algorithm that&#8217;s linear in time and constant in space (modulo some increase in size for bignums if we&#8217;re using a language that supports them). </p>
<pre class="src src-emacs-lisp">(<span style="color: #7f007f;">require</span> '<span style="color: #008b8b;">cl</span>)
(<span style="color: #7f007f;">defun</span> <span style="color: #0000ff;">solve</span> (n repeat missing)
  (<span style="color: #7f007f;">let</span> ((numbers (cons repeat
                       (delete missing (<span style="color: #7f007f;">loop</span> for i from 1 to n collect i))))
        (sum-1-to-n (/ (* n (1+ n)) 2))
        (sumsq-1-to-n (/ (* n (1+ n) (+ n n 1)) 6))
        (units 0)
        (squares 0))
    (<span style="color: #7f007f;">dolist</span> (i numbers)
      (incf units i)
      (incf squares (* i i)))
    (<span style="color: #7f007f;">let</span> ((delta1 (- units sum-1-to-n))
          (delta2 (- squares sumsq-1-to-n)))
      (message <span style="color: #8b2252;">"repeated number is %d, missing number is %d"</span>
               (/ (+ delta2 (* delta1 delta1)) (* 2 delta1))
               (/ (- delta2 (* delta1 delta1)) (* 2 delta1))))))
</pre>
<p> I didn&#8217;t bother to randomize the list because I don&#8217;t make any use of the fact that it&#8217;s (almost) in numerical order. Some readers calculated the length of the list but I assumed that <i>n</i> was given as part of the problem. If not, it&#8217;s simple to count them up as we sum the numbers and their squares and then calculate <code>sum-1-to-n</code> and <code>sumsq-1-to-n</code> afterwards. </p>
<p> When we run <code>solve</code>, we get the expected answer </p>
<pre class="src src-emacs-lisp">ELISP&gt; (solve 100 35 78)
<span style="color: #8b2252;">"repeated number is 35, missing number is 78"</span>
ELISP&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://irreal.org/blog/?feed=rss2&#038;p=810</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Playing with Common Lisp&#8217;s Compiler Macros</title>
		<link>http://irreal.org/blog/?p=809</link>
		<comments>http://irreal.org/blog/?p=809#comments</comments>
		<pubDate>Thu, 03 May 2012 20:56:42 +0000</pubDate>
		<dc:creator>jcs</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Lisp]]></category>

		<guid isPermaLink="false">http://irreal.org/blog/?p=809</guid>
		<description><![CDATA[Back in April, Robert Smith of Symbo1ics Ideas wrote an excellent post on solving the m-of-n Boolean Circuit problem. The problem is nominally about building a boolean circuit having n inputs that returns TRUE if at least m of the &#8230; <a href="http://irreal.org/blog/?p=809">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Back in April, Robert Smith of <a href="http://symbo1ics.com/blog/">Symbo1ics Ideas</a> wrote an excellent post on solving the <a href="http://symbo1ics.com/blog/?p=1352">m-of-n Boolean Circuit</a> problem. The problem is nominally about building a boolean circuit having <i>n</i> inputs that returns <code>TRUE</code> if at least <i>m</i> of the inputs are <code>TRUE</code>. Most of us aren&#8217;t electrical engineers, of course, so Smith quickly recasts the problem as building a <i>function</i> that does the same thing. </p>
<p> That&#8217;s a pretty easy problem with some obvious solutions but Smith asks how we might go about finding an optimal solution. Optimal in the sense that each input is examined at most once and that a solution is returned as soon as the answer can be definitely determined. That leaves out solutions that just spin through the inputs counting those with a value of <code>TRUE</code>. Smith finds a general formula for the solution and uses that to write a function to make the check. </p>
<p> Then things get interesting. Next, instead of writing a function to make the check he writes a function to generate Lisp code to make the check. With just a little cleverness&mdash;you&#8217;ll think, “Oh, I would have thought of that”&mdash;he has the function generating optimal code. The next step is to take that code and turn it into a compiler macro. Now when the function is called to check if <i>m</i> of the <i>n</i> inputs are <code>TRUE</code> the function will generate direct code if it can and call the iterative function if it can&#8217;t. </p>
<p> This is the best description of compiler macros that I&#8217;ve come across. I was going to blog about them myself but I couldn&#8217;t do better without just copying his post so you should definitely go take a look if you&#8217;re a Lisper. </p>
]]></content:encoded>
			<wfw:commentRss>http://irreal.org/blog/?feed=rss2&#038;p=809</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Two Elisp Challenges</title>
		<link>http://irreal.org/blog/?p=808</link>
		<comments>http://irreal.org/blog/?p=808#comments</comments>
		<pubDate>Wed, 02 May 2012 19:10:29 +0000</pubDate>
		<dc:creator>jcs</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Emacs]]></category>
		<category><![CDATA[Emacs-lisp]]></category>

		<guid isPermaLink="false">http://irreal.org/blog/?p=808</guid>
		<description><![CDATA[I ran across a couple of nice interview questions and an interesting story over at Tanya Khovanova&#8217;s Math Blog. The two questions are: Given a list of integers from 1 to n but with one of the integers missing, write &#8230; <a href="http://irreal.org/blog/?p=808">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I ran across a couple of nice interview questions and an interesting story over at <a href="http://blog.tanyakhovanova.com/?p=402">Tanya Khovanova&#8217;s Math Blog</a>. The two questions are: </p>
<ol>
<li>Given a list of integers from 1 to n but with one of the integers    missing, write an efficient algorithm for finding the missing    integer. </li>
<li>Given a list of integers from 1 to n but with one of the integers    missing and another integer repeated, write an efficient algorithm    for finding the missing and repeated integers. </li>
</ol>
<p>In both problems the numbers in the list are in no particular order. </p>
<p> So the challenge is to write the two algorithms in Emacs Lisp. The interviewer expected a <i>O</i>(<i>n log n</i>) algorithm for time for the second problem. Can you do better? </p>
<p> Don&#8217;t go over to Khnovanova&#8217;s blog until you have solved the problems because there are spoilers in the comments. After you solve the problem, though, be sure to read her story about “hiring the smartest people in the world.” </p>
]]></content:encoded>
			<wfw:commentRss>http://irreal.org/blog/?feed=rss2&#038;p=808</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>DOCUMENTATION-TEMPLATE</title>
		<link>http://irreal.org/blog/?p=807</link>
		<comments>http://irreal.org/blog/?p=807#comments</comments>
		<pubDate>Tue, 01 May 2012 21:18:38 +0000</pubDate>
		<dc:creator>jcs</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Lisp]]></category>

		<guid isPermaLink="false">http://irreal.org/blog/?p=807</guid>
		<description><![CDATA[I&#8217;m just starting a Lisp project that, among other things, involves fiddling with dates. Working with dates isn&#8217;t particularly hard but it&#8217;s also not very rewarding. Oddly, Common Lisp doesn&#8217;t have any functions to format and manipulate dates. I certainly &#8230; <a href="http://irreal.org/blog/?p=807">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m just starting a Lisp project that, among other things, involves fiddling with dates. Working with dates isn&#8217;t particularly hard but it&#8217;s also not very rewarding. Oddly, Common Lisp doesn&#8217;t have any functions to format and manipulate dates. I certainly didn&#8217;t want to write a bunch of uninteresting code so I fired up Quicklisp to see what was available. Happily, I found the Simple-Date-Time library that did all the things I wanted it to. </p>
<p> The only problem was that there are a lot of functions but no documentation other than the doc strings in the functions. I thought about writing a quick script to extract them for use as documentation when I thought that this was surely something that someone else had already done. So I fired up Quicklisp again and found Edi Weitz&#8217;s DOCUMENTATION-TEMPLATE library. I had Quicklisp retrieve it for me, loaded it at the REPL, typed </p>
<pre class="src src-lisp">(create-template 'simple-date-time <span style="color: #7a378b;">:target</span> #P<span style="color: #8b2252;">"~/Desktop/dt.html"</span>)
</pre>
<p> and ended up with nicely formatted html documentation that I added to the documentation stack in my browser. </p>
<p> Sadly, it only works with LispWorks, SBCL, and AllegroCL but if you have one of those systems and need some documentation for a library, this is a quick and easy way to generate it. If you want to see what the finished product looks like, here is the documentation for <a href="http://weitz.de/documentation-template/">DOCUMENTATION-TEMPLATE</a> generated with DOCUMENTATION-TEMPLATE. </p>
]]></content:encoded>
			<wfw:commentRss>http://irreal.org/blog/?feed=rss2&#038;p=807</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

