<?xml version="1.0"?>
<rss version="2.0">
<channel>
	<title>Planet Lisp</title>
	<link>http://planet.lisp.org/</link>
	<description>Planet Lisp</description>
	<language>en</language>


<item>
	<title>Zach Beane: Boston Lisp Meeting on May 23</title>
	<guid isPermaLink="true">http://xach.livejournal.com/318093.html</guid>
	<link>http://xach.livejournal.com/318093.html</link>
	
	<description>&lt;p&gt;Boston Lisp meetings are a lot of fun. Here's Alex Plotnick's
  announcement for the next meeting:

&lt;blockquote&gt;
&lt;p&gt;I'm pleased to announce that François-René Rideau will speak at the
next Boston Lisp meeting on his recent work on ASDF 3. The meeting will
take place on Thursday, 23 May at 6:30 PM, in the Star Conference room
at MIT's Stata Center (MIT 32-D463; &amp;lt;&lt;a href="http://whereis.mit.edu/?go=32" rel="nofollow"&gt;http://whereis.mit.edu/?go=32&lt;/a&gt;&amp;gt;).

&lt;p&gt;I'm sorry about the short notice on this one; communications problems
of all kinds have been gumming up the works. Please feel free to spread
the word about the meeting via whatever mechanisms are available to you.

&lt;p&gt;Talk details (courtesy of Faré) follow. I hope to see you all there!

&lt;p&gt;Title: "ASDF 3, or lessons in building portable Common Lisp programs"

&lt;p&gt;Summary:&lt;br /&gt;
"ASDF (Another System Definition Facility) has been the de facto
standard Common Lisp build system for over ten years. I recently
rewrote it completely, several times, all the time (mostly) preserving
backwards compatibility. The latest incarnation, ASDF 3, in addition
to fixing deep design bugs older than ASDF itself, also includes
extensive portability library, UIOP, not to be confused with an
existing parallelizing extension, POIU. I will show how to use ASDF,
explain the recent improvements, and discuss the challenges of writing
portable Common Lisp programs and what that means for the past and
future of Lisp."

&lt;p&gt;About the speaker:&lt;br /&gt;
"François-René Rideau is a Lisp plumber. On good days, he designs
great piping for persistent data, to be used in airline reservation
system of ITA (now part of Google). On bad days, he dons his rubber
gloves and scrubs the pipes. He also has a blog, Cybernethics, where
he writes on liberty, music, programming, and dynamic systems in
general."
&lt;/blockquote&gt;

&lt;p&gt;I can't make it, but if you're in the Boston area, you should go!</description>
	
	<pubDate>Wed, 22 May 2013 12:26:16 GMT</pubDate>
</item>

<item>
	<title>Lispjobs: Junior Software Developer, CREATE-NET, Trento, Italy</title>
	<guid isPermaLink="true">http://lispjobs.wordpress.com/2013/05/20/junior-software-developer-create-net-trento-italy/</guid>
	<link>http://lispjobs.wordpress.com/2013/05/20/junior-software-developer-create-net-trento-italy/</link>
	
	<description>&lt;p&gt;IT JUNIOR SOFTWARE DEVELOPER (Event Management Systems and Portals) &lt;/p&gt;
&lt;p&gt;CREATE-NET is seeking a well motivated Junior Software Developer to be part of our Innovation team, that will contribute to the analysis, development and testing of a comprehensive portfolio of specialized software products for supporting the workflow of events and conference organization and management, including the creation of web portals and web applications.&lt;/p&gt;
&lt;p&gt;The candidate will be directly responsible of the analysis, development and testing of a set of software components that offer events management services, and he will contribute to and will coordinate his activities with other IT developers and graphic designers, in the specification, design, implementation, testing of web portals and web applications.&lt;br /&gt;
Specific Job responsibilities will include:&lt;/p&gt;
&lt;p&gt;&amp;middot;	Contribution to the maintenance of our camera ready submission system, payment system, public journal and proceedings archive conference web site CMS and general administration tool.&lt;br /&gt;
&amp;middot;	Interacting with the project responsibles and the user community to determine requirements, communicating with the support team to handle any problems or new features required.&lt;br /&gt;
&amp;middot;	Contribution to technical support to systems in operations.&lt;/p&gt;
&lt;p&gt;This position requires hands-on experience in the design, implementation and maintenance of software systems in a Drupal/PHP, Common Lisp and Haskell environment.&lt;/p&gt;
&lt;p&gt;Applicants should have a Master&amp;#8217;s degree (or equivalent) in computing or other related disciplines, and a proven experience in software development. &lt;/p&gt;
&lt;p&gt;Knowledge or interest in the following areas would be given preference:&lt;br /&gt;
functional programming, Haskell, Common Lisp, Scala, OCaml.&lt;/p&gt;
&lt;p&gt;Technical skills for the proposed position:&lt;/p&gt;
&lt;p&gt;&amp;middot;	Web technologies; HTML5, CSS, AJAX, web services, etc.&lt;br /&gt;
&amp;middot;	Working experience and knowledge of functional programming, familiarity with associated development environments (e.g. Common Lisp&amp;#8217;s SLIME).&lt;br /&gt;
&amp;middot;	Confident understanding and experience with Git (mandatory)&lt;br /&gt;
&amp;middot;	JavaScript (mandatory)&lt;br /&gt;
&amp;middot;	Proven Common Lisp experience (mandatory)&lt;br /&gt;
&amp;middot;	Proven Haskell experience (mandatory)&lt;br /&gt;
&amp;middot;	PHP (preferable)&lt;br /&gt;
&amp;middot;	Experience with relational DBMSs (PostgreSQL in particular)&lt;br /&gt;
&amp;middot;	Linux environments (Redhat and Ubuntu preferable)&lt;br /&gt;
&amp;middot;	skills on mobile apps development (ios, android) will be considered as a plus;&lt;br /&gt;
&amp;middot;	Experience and knowledge of agile methodologies, software design methods are also considered a plus.&lt;/p&gt;
&lt;p&gt;The following organizational skills are requested for this position:&lt;/p&gt;
&lt;p&gt;&amp;middot;	Autonomous thinking and problem solving skills;&lt;br /&gt;
&amp;middot;	Prioritization, time management skills and capability to adapt to dynamic environments;&lt;br /&gt;
&amp;middot;	Ability to work hands-on and with little supervision;&lt;br /&gt;
&amp;middot;	Attitude to collaborative working.&lt;/p&gt;
&lt;p&gt;Working place:&lt;br /&gt;
Trento, top ranked Italian city for quality of life and known for hosting a large number of cutting-edge worldwide recognized research institutions.&lt;/p&gt;
&lt;p&gt;Languages:&lt;br /&gt;
Excellent command of the English language (written and spoken)  is essential.&lt;br /&gt;
knowledge of the Italian language both spoken and written is not required, but can be helpful.&lt;/p&gt;
&lt;p&gt;Working schedule: Full-Time&lt;/p&gt;
&lt;p&gt;How to apply: Please send your resume/CV in English to careers@create-net.org, specifying in the email subject: "IT JUNIOR SOFTWARE DEVELOPER (Event Management Systems and Portals) &amp;#8211; CN". Only applications submitted in English will be taken into consideration. &lt;/p&gt;
&lt;p&gt;Please include any Github/Bitbucket or otherwise links to open source contributions you have made with the above technologies.&lt;/p&gt;
&lt;p&gt;Important: due to Italian Privacy Protection Law n.196/03 any resume not mentioning explicitly the following wording: "I authorize the use of my personal data in accordance with Italian Privacy Protection Law (30/06/2003, n.196/03)" will be automatically deleted from our database and consequently not taken into consideration.&lt;/p&gt;
&lt;br /&gt;  &lt;a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lispjobs.wordpress.com/726/"&gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lispjobs.wordpress.com/726/" /&gt;&lt;/a&gt; &lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lispjobs.wordpress.com&amp;blog=504450&amp;post=726&amp;subd=lispjobs&amp;ref=&amp;feed=1" width="1" height="1" /&gt;</description>
	
	<pubDate>Mon, 20 May 2013 14:56:58 GMT</pubDate>
</item>

<item>
	<title>Zach Beane: ECLM 2013 - two days left to register</title>
	<guid isPermaLink="true">http://xach.livejournal.com/317463.html</guid>
	<link>http://xach.livejournal.com/317463.html</link>
	
	<description>&lt;p&gt;Important news:

&lt;blockquote&gt;
&lt;p&gt;Subject: &lt;b&gt;ECLM 2013 - two days left to register&lt;/b&gt;&lt;br /&gt;
Date: Mon, 13 May 2013 19:17:26 +0200&lt;br /&gt;
From: Edi Weitz

&lt;p&gt;Ladies and Gentlemen,

&lt;p&gt;This is our last call - there are two days left to register for this year's
ECLM in case you haven't done so already:

&lt;p&gt;&amp;nbsp; &amp;nbsp;&lt;a href="http://weitz.de/eclm2013/" rel="nofollow"&gt;http://weitz.de/eclm2013/&lt;/a&gt;

&lt;p&gt;We have more than 50 registrations so far, but we wouldn't mind seeing
another dozen or two...

&lt;p&gt;Best regards,&lt;br /&gt;
Arthur &amp; Edi.
&lt;/blockquote&gt;

&lt;p&gt;I greatly enjoyed my last visit to ECLM and I can't recommend it highly enough if you want to meet people with interesting Common Lisp projects and ideas.</description>
	
	<pubDate>Mon, 13 May 2013 17:33:31 GMT</pubDate>
</item>

<item>
	<title>Dimitri Fontaine: from Parsing to Compiling</title>
	<guid isPermaLink="true">http://tapoueh.org/blog/2013/05/13-from-parser-to-compiler.html</guid>
	<link>http://tapoueh.org/blog/2013/05/13-from-parser-to-compiler.html</link>
	
	<description>&lt;p&gt;Last week came with two bank holidays in a row, and I took the opportunity
to design a &lt;em&gt;command language&lt;/em&gt; for &lt;a href="http://tapoueh.org/../../pgsql/pgloader.html"&gt;pgloader&lt;/a&gt;. While doing that, I unexpectedly
stumbled accross a very nice &lt;em&gt;AHAH!&lt;/em&gt; moment, and I now want to share it with
you, dear reader.&lt;/p&gt;

&lt;center&gt;
&lt;p&gt;&lt;img src="http://tapoueh.org/../../images/lightbulb.gif" alt="" /&gt;&lt;/p&gt;
&lt;/center&gt;

&lt;center&gt;
&lt;p&gt;&lt;em&gt;AHAH, you'll see!&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;

&lt;p&gt;The general approach I'm following code wise with that &lt;em&gt;command language&lt;/em&gt; is
to first get a code API to expose the capabilities of the system, then
somehow plug the &lt;em&gt;command language&lt;/em&gt; into that API thanks to a &lt;em&gt;parser&lt;/em&gt;. It turns
out that doing so in &lt;em&gt;Common Lisp&lt;/em&gt; is really easy, and that you can get a
&lt;em&gt;compiler&lt;/em&gt; for free too, while at it. Let's see about that.&lt;/p&gt;

&lt;h3&gt;A very simple toy example&lt;/h3&gt;

&lt;p class="first"&gt;In this newsgroup article &lt;a href="https://groups.google.com/forum/?fromgroups=#!topic/comp.lang.lisp/JJxTBqf7scU"&gt;What is symbolic compoutation?&lt;/a&gt;, &lt;a href="http://informatimago.com/"&gt;Pascal Bourguignon&lt;/a&gt;
did propose a very simple piece of code:&lt;/p&gt;

&lt;pre class="src"&gt;
(&lt;span&gt;defparameter&lt;/span&gt; &lt;span&gt;*additive-color-graph*&lt;/span&gt;
  '((red   (red white)   (green yellow) (blue magenta))
    (green (red yellow)  (green white)  (blue cyan))
    (blue  (red magenta) (green cyan)   (blue white))))

(&lt;span&gt;defun&lt;/span&gt; &lt;span&gt;symbolic-color-add&lt;/span&gt; (a b)
  (cadr (assoc a (cdr (assoc b *additive-color-graph*)))))
&lt;/pre&gt;

&lt;p&gt;This is an example of &lt;em&gt;symbolic computation&lt;/em&gt;, and we're going to build a
little &lt;em&gt;language&lt;/em&gt; to express the data and the code. Not that we would need to
build one, mind you, more in order to have a really simple example leading
us to the &lt;em&gt;ahah&lt;/em&gt; moment you're now waiting for.&lt;/p&gt;

&lt;p&gt;Before we dive into the main topic, you have to realize that the previous
code example actually works: it's defining some data, using an implicit data
structure composed by nesting lists together, and defines a function that
knows how to sort out the data in that anonymous data structure so as to
compound 2 colors together.&lt;/p&gt;

&lt;pre class="src"&gt;
TOY-PARSER&amp;gt; (symbolic-color-add 'red 'green)
YELLOW
&lt;/pre&gt;


&lt;h3&gt;A command language and parser&lt;/h3&gt;

&lt;p class="first"&gt;I decided to go with the following &lt;em&gt;language&lt;/em&gt;:&lt;/p&gt;

&lt;pre class="src"&gt;
color red   +red white    +green yellow  +blue magenta
color green +red yellow   +green white   +blue cyan
color blue  +red magenta  +green cyan    +blue white

mix red and green
&lt;/pre&gt;

&lt;p&gt;And here's how some of the parser looks like, using the &lt;a href="http://nikodemus.github.io/esrap/"&gt;esrap&lt;/a&gt; &lt;em&gt;packrat&lt;/em&gt; lib:&lt;/p&gt;

&lt;pre class="src"&gt;
(defrule color-name (and whitespaces (+ (alpha-char-p character)))
  (&lt;span&gt;:destructure&lt;/span&gt; (ws name)
    (&lt;span&gt;declare&lt;/span&gt; (ignore ws))               &lt;span&gt;; &lt;/span&gt;&lt;span&gt;ignore whitespaces
&lt;/span&gt;    &lt;span&gt;;; &lt;/span&gt;&lt;span&gt;CL symbols default to upper case.
&lt;/span&gt;    (intern (string-upcase (coerce name 'string)) &lt;span&gt;:toy-parser&lt;/span&gt;)))

&lt;span&gt;;;; &lt;/span&gt;&lt;span&gt;parse string "+ red white"
&lt;/span&gt;(defrule color-mix (and whitespaces &lt;span&gt;"+"&lt;/span&gt; color-name color-name)
  (&lt;span&gt;:destructure&lt;/span&gt; (ws plus color-added color-obtained)
    (&lt;span&gt;declare&lt;/span&gt; (ignore ws plus))          &lt;span&gt;; &lt;/span&gt;&lt;span&gt;ignore whitespaces and keywords
&lt;/span&gt;    (list color-added color-obtained)))

&lt;span&gt;;;; &lt;/span&gt;&lt;span&gt;mix red and green
&lt;/span&gt;(defrule mix-two-colors (and kw-mix color-name kw-and color-name)
  (&lt;span&gt;:destructure&lt;/span&gt; (mix c1 and c2)
    (&lt;span&gt;declare&lt;/span&gt; (ignore mix and))          &lt;span&gt;; &lt;/span&gt;&lt;span&gt;ignore keywords
&lt;/span&gt;    (list c1 c2)))
&lt;/pre&gt;

&lt;p&gt;Those &lt;em&gt;rules&lt;/em&gt; are not the whole parser, go have a look at the project on
github if you want to see the whole code, it's called &lt;a href="https://github.com/dimitri/toy-parser"&gt;toy-parser&lt;/a&gt; over there.
The main idea here is to show that when we parse a line from our little
language, we produce the simplest possible structured data: in lisp that's
&lt;em&gt;symbols&lt;/em&gt; and &lt;em&gt;lists&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;The reason why it makes sense doing that is the next rule:&lt;/p&gt;

&lt;center&gt;
&lt;p&gt;&lt;img src="http://tapoueh.org/../../images/the-one-ring.jpg" alt="" /&gt;&lt;/p&gt;
&lt;/center&gt;

&lt;center&gt;
&lt;p&gt;&lt;em&gt;The one grammar rule to bind them all&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;

&lt;pre class="src"&gt;
(defrule program (and colors mix-two-colors)
  (&lt;span&gt;:destructure&lt;/span&gt; (graph (c1 c2))
    `(&lt;span&gt;lambda&lt;/span&gt; ()
       (&lt;span&gt;let&lt;/span&gt; ((*additive-color-graph* ',graph))
         (symbolic-color-add ',c1 ',c2)))))
&lt;/pre&gt;

&lt;p&gt;This rule is the complex one to bind them all. It's using a &lt;em&gt;quasiquote&lt;/em&gt;, a
basic lisp syntax element allowing the programmer to very easily produce
data that looks exactly like code. Let's see how it goes with a very simple
example:&lt;/p&gt;

&lt;pre class="src"&gt;
TOY-PARSER&amp;gt; (pprint (parse 'program
                           &lt;span&gt;"color red +green yellow mix green and red"&lt;/span&gt;))

(LAMBDA NIL
  (LET ((*ADDITIVE-COLOR-GRAPH* '((RED (GREEN YELLOW)))))
    (SYMBOLIC-COLOR-ADD 'RED 'GREEN)))

&lt;/pre&gt;

&lt;p&gt;The parser is producing structure (nested) data that really looks like lisp
code, right? So maybe we can just run that code...&lt;/p&gt;


&lt;h3&gt;What about a compiler now?&lt;/h3&gt;

&lt;center&gt;
&lt;p&gt;&lt;img src="http://tapoueh.org/../../images/aha.jpg" alt="" /&gt;&lt;/p&gt;
&lt;/center&gt;

&lt;center&gt;
&lt;p&gt;&lt;em&gt;Here is my AHAH moment!&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;

&lt;p&gt;Let's see about actually running the code:&lt;/p&gt;

&lt;pre class="src"&gt;
TOY-PARSER&amp;gt; (&lt;span&gt;let*&lt;/span&gt; ((code &lt;span&gt;"color red +green yellow mix green and red"&lt;/span&gt;)
                   (program (parse 'program code)))
              (compile nil program))
#&amp;lt;Anonymous Function #x3020027CF0EF&amp;gt;
NIL
NIL
TOY-PARSER&amp;gt; (&lt;span&gt;let*&lt;/span&gt; ((code &lt;span&gt;"color red +green yellow mix green and red"&lt;/span&gt;)
                   (program (parse 'program code)))
              (funcall (compile nil program)))
YELLOW
&lt;/pre&gt;

&lt;p&gt;So we have a string reprensing code in our very little language, and a
parser that knows how to produce a nested list of atoms that looks like lisp
code. And as we have lisp, we can actually compile that code at run-time
with the same compiler that we used to produce our parser, and we can then
&lt;code&gt;funcall&lt;/code&gt; that function we just built.&lt;/p&gt;

&lt;p&gt;Oh and the function is actually compiled down to native code, of course:&lt;/p&gt;

&lt;pre class="src"&gt;
TOY-PARSER&amp;gt; (&lt;span&gt;let*&lt;/span&gt; ((code &lt;span&gt;"color red +green yellow mix red and green"&lt;/span&gt;)
                   (program (parse 'program code))
                   (func    (compile nil program)))
              (time (&lt;span&gt;loop&lt;/span&gt; repeat 1000 do (funcall func))))

(&lt;span&gt;LOOP&lt;/span&gt; REPEAT 1000 DO (FUNCALL FUNC))
took 108 microseconds (0.000108 seconds) to run.
During that period, and with 4 available CPU cores,
     105 microseconds (0.000105 seconds) were spent in user mode
      13 microseconds (0.000013 seconds) were spent in system mode
NIL
&lt;/pre&gt;

&lt;p&gt;Yeah, it took the whole of &lt;code&gt;108 microseconds&lt;/code&gt; to actually run the code
generated by our own &lt;em&gt;parser&lt;/em&gt; &lt;strong&gt;a thousand times&lt;/strong&gt;, on my laptop. I can believe
it's been compiled to native code, that seems like the right ballpark.&lt;/p&gt;


&lt;h3&gt;Conclusion&lt;/h3&gt;

&lt;p class="first"&gt;The &lt;a href="https://github.com/dimitri/toy-parser"&gt;toy-parser&lt;/a&gt; code is there on &lt;em&gt;GitHub&lt;/em&gt; and you can actually load it using
&lt;a href="http://www.quicklisp.org/"&gt;Quicklisp&lt;/a&gt;: clone the repository in &lt;code&gt;~/quicklisp/local-projects/&lt;/code&gt; then
&lt;code&gt;(ql:quickload &amp;quot;toy-parser&amp;quot;)&lt;/code&gt;, and play with it in &lt;code&gt;(in-package :toy-parser)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The only thing I still want to say here is this: can your programming
language of choice make it that easy?&lt;/p&gt;</description>
	
	<pubDate>Mon, 13 May 2013 09:08:00 GMT</pubDate>
</item>

<item>
	<title>Brit Butler: Coleslaw 0.9.2 and other lispiness</title>
	<guid isPermaLink="true">http://blog.redlinernotes.com/posts/Coleslaw-092-and-other-lispiness.html</guid>
	<link>http://blog.redlinernotes.com/posts/Coleslaw-092-and-other-lispiness.html</link>
	
	<description>&lt;h2&gt;Coleslaw 0.9.2&lt;/h2&gt;

&lt;p&gt;It still amuses me that my most successful project to date is a blog engine. Not that I'm complaining about having contributors. When I &lt;a href="http://blog.redlinernotes.com/posts/Lessons-from-Coleslaw.html"&gt;last mentioned it&lt;/a&gt;, version 0.8 had just been released. Since then there have been 2 new contributors and a bunch of new features. I think the code has mostly improved in cleanliness.&lt;/p&gt;

&lt;p&gt;The biggest changes are new &lt;a href="https://github.com/redline6561/coleslaw/tree/master/docs"&gt;shiny docs&lt;/a&gt;, a new tags implementation, cleanups to theming, and plugins for Google Analytics, Github Pages, and Sitemap Generation. For the full details, see the &lt;a href="https://github.com/redline6561/coleslaw/tree/master/NEWS.md"&gt;changelog&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;My plans for 1.0 are primarily to take advantage of the extensible content types added in 0.8 and add some sort of tumblr-like auto-embedding support. But I probably won't get around to working on that for a spell. Why?&lt;/p&gt;

&lt;h2&gt;Other Lispiness&lt;/h2&gt;

&lt;p&gt;Because my &lt;a href="http://github.com/redline6561/famiclom"&gt;lisp emulation experiment/art project&lt;/a&gt; is ongoing. &lt;a href="http://www.lisphacker.com/"&gt;Nyef&lt;/a&gt; was kind enough to share some code he'd hacked up for NES emulation years ago and it helped give me the motivation to rewrite famiclom's PPU (Graphics Card). The former code was largely cribbed from Patrick Walton's &lt;a href="https://www.github.com/pcwalton/sprocketnes"&gt;sprocketnes&lt;/a&gt; and I didn't understand it very well. I've hit the &lt;a href="http://wiki.nesdev.com/w/index.php/Nesdev_Wiki"&gt;nesdev wiki&lt;/a&gt; again and am getting more comfortable with the PPU's actual workings. The code is on github in the &lt;code&gt;new-ppu&lt;/code&gt; branch and I'm hoping to spend more time on it this coming week.&lt;/p&gt;

&lt;p&gt;I also spent the last week porting cl-6502 to clojurescript for giggles. Heresy, I know. ;) &lt;br /&gt;
&lt;a href="https://github.com/redline6561/cljs-6502"&gt;cljs-6502&lt;/a&gt; is in a basic working state but there are bugs aplenty and I haven't implemented the assembler or disassembler. The must frustrating part was dealing with A) differences in macro hygiene and B) poor macro debugging facilities.&lt;/p&gt;

&lt;p&gt;The browser is a fun target though. I'll have to try &lt;a href="http://common-lisp.net/project/parenscript/"&gt;parenscript&lt;/a&gt; &lt;em&gt;or&lt;/em&gt; ... &lt;a href="https://github.com/davanzp/jscl"&gt;&lt;em&gt;jscl&lt;/em&gt;&lt;/a&gt;! JSCL is a full CL-&amp;gt;JS compiler in early development, which I contributed a tiny patch to for &lt;code&gt;fboundp&lt;/code&gt;. It's a great project and if you have any interest in helping implement a lisp, I'd encourage you to get involved. The maintainers are very approachable and there's plenty of fun hacking to be had.&lt;/p&gt;

&lt;p&gt;All for now. It's time to play around trying static analysis of Nintendo ROMs with Lisp. I'm bound to learn something...hopefully.&lt;/p&gt;</description>
	
	<pubDate>Sat, 11 May 2013 11:41:00 GMT</pubDate>
</item>

<item>
	<title>Patrick Stein: Track-Best Library Released</title>
	<guid isPermaLink="true">http://nklein.com/2013/05/track-best-library-released/</guid>
	<link>http://nklein.com/2013/05/track-best-library-released/</link>
	
	<description>&lt;p&gt;In doing a problem set from the Internet a few weeks ago, I found myself writing awkward constructions with &lt;code class="codecolorer lisp default"&gt;&lt;span class="lisp"&gt;REDUCE&lt;/span&gt;&lt;/code&gt; and &lt;code class="codecolorer lisp default"&gt;&lt;span class="lisp"&gt;LOOP&lt;/span&gt;&lt;/code&gt; to try to find the best one (or two or three) things in a big bag of things based on various criteria: similarity to English, hamming distance from their neighbor, etc.&lt;/p&gt;
&lt;p&gt;I wrote a macro that encapsulated the pattern.  I&amp;#8217;ve reworked that macro into a library for public use.&lt;/p&gt;
&lt;h3&gt;Acquiring&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Home page: &lt;a href="http://nklein.com/software/track-best-library/"&gt;http://nklein.com/software/track-best-library/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Main git repository: &lt;a href="http://git.nklein.com/lisp/libs/track-best.git"&gt;http://git.nklein.com/lisp/libs/track-best.git&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Browsable repository: &lt;a href="https://github.com/nklein/track-best"&gt;https://github.com/nklein/track-best&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Using&lt;/h3&gt;
&lt;p&gt;There are a variety of examples in the &lt;a href="https://github.com/nklein/track-best/blob/master/README.md"&gt;README&lt;/a&gt; and the &lt;a href="https://github.com/nklein/track-best/tree/master/tests"&gt;tests directory&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Here is one example to pique your interest.  Suppose you have some data about the elevations of various cities in various states and you (being a Moxy Fruvous fan) want to know &lt;a href="http://www.lyricsmania.com/the_lowest_highest_point_improv_lyrics_moxy_fruvous.html"&gt;&lt;q&gt;What Is the Lowest Highest Point?&lt;/q&gt;&lt;/a&gt;  Here&amp;#8217;s how you might tackle that with the &lt;code class="codecolorer lisp default"&gt;&lt;span class="lisp"&gt;TRACK-BEST&lt;/span&gt;&lt;/code&gt; library:&lt;/p&gt;
&lt;div class="codecolorer-container lisp blackboard"&gt;&lt;pre class="lisp codecolorer"&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;let&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;data '&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;Alabama&amp;quot;&lt;/span&gt;  &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;Birmingham&amp;quot;&lt;/span&gt; &lt;span&gt;664&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
                          &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;Mobile&amp;quot;&lt;/span&gt; &lt;span&gt;218&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
                          &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;Montegomery&amp;quot;&lt;/span&gt; &lt;span&gt;221&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
              &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;Alaska&amp;quot;&lt;/span&gt;   &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;Anchorage&amp;quot;&lt;/span&gt; &lt;span&gt;144&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
                          &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;Fairbanks&amp;quot;&lt;/span&gt; &lt;span&gt;531&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
              &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;Arizona&amp;quot;&lt;/span&gt;  &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;Grand Canyon&amp;quot;&lt;/span&gt; &lt;span&gt;6606&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
                          &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;Phoenix&amp;quot;&lt;/span&gt; &lt;span&gt;1132&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
                          &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;Tuscon&amp;quot;&lt;/span&gt;  &lt;span&gt;2641&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
  &lt;span&gt;&amp;#40;&lt;/span&gt;with-track-best &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;order-by-fn&lt;/span&gt; #'&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
    &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;dolist&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;state-info data&lt;span&gt;&amp;#41;&lt;/span&gt;
      &lt;span&gt;&amp;#40;&lt;/span&gt;multiple-value-bind &lt;span&gt;&amp;#40;&lt;/span&gt;city altitude&lt;span&gt;&amp;#41;&lt;/span&gt;
          &lt;span&gt;&amp;#40;&lt;/span&gt;with-track-best &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
            &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;dolist&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;city-info &lt;span&gt;&amp;#40;&lt;/span&gt;rest state-info&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
              &lt;span&gt;&amp;#40;&lt;/span&gt;track &lt;span&gt;&amp;#40;&lt;/span&gt;first city-info&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;second city-info&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
        &lt;span&gt;&amp;#40;&lt;/span&gt;track &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;list&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;first state-info&lt;span&gt;&amp;#41;&lt;/span&gt; city&lt;span&gt;&amp;#41;&lt;/span&gt; altitude&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;With this limited dataset, the end result would be &lt;code class="codecolorer lisp default"&gt;&lt;span class="lisp"&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;VALUES '&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;quot;Alaska&amp;quot;&lt;/span&gt; &lt;span&gt;&amp;quot;Fairbanks&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;531&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;.  The inner &lt;code class="codecolorer lisp default"&gt;&lt;span class="lisp"&gt;WITH-TRACK-BEST&lt;/span&gt;&lt;/code&gt; finds the highest city in each state.  The outer &lt;code class="codecolorer lisp default"&gt;&lt;span class="lisp"&gt;WITH-TRACK-BEST&lt;/span&gt;&lt;/code&gt; finds the lowest of these.&lt;/p&gt;</description>
	
	<pubDate>Thu, 09 May 2013 23:27:00 GMT</pubDate>
</item>

<item>
	<title>Zach Beane: Lisp gatherings</title>
	<guid isPermaLink="true">http://xach.livejournal.com/317242.html</guid>
	<link>http://xach.livejournal.com/317242.html</link>
	
	<description>&lt;p&gt;I'm very excited to be attending
  both &lt;a href="http://weitz.de/eclm2013/" rel="nofollow"&gt;ECLM&lt;/a&gt;
  and &lt;a href="http://www-sop.inria.fr/members/Manuel.Serrano/conferences/els13.html" rel="nofollow"&gt;ELS&lt;/a&gt;
  in Madrid this year. This is the last week to register for ECLM, so
  if you want to go, you should register ASAP.</description>
	
	<pubDate>Wed, 08 May 2013 19:13:26 GMT</pubDate>
</item>

<item>
	<title>Liam Healy: cl-plplot for simple x-y plots from Lisp</title>
	<guid isPermaLink="true">http://lhealy.livejournal.com/15821.html</guid>
	<link>http://lhealy.livejournal.com/15821.html</link>
	
	<description>I had need recently to create quick x-y plots on the screen. I have been generating TikZ and &lt;a href="http://pgfplots.sourceforge.net/" rel="nofollow"&gt;PGFplots&lt;/a&gt; from Lisp for journal and conference papers and presentations. They look very nice but are not quick, either in writing or displaying. There are a number of CL packages listed for plotting, and I gave &lt;a href="http://common-lisp.net/project/cl-plplot/" rel="nofollow"&gt;cl-plplot&lt;/a&gt; a try. It is in quicklisp. Though there is no active work on it, I was able to generate plots that I wanted quickly.&lt;br /&gt;&lt;br /&gt;Here is an example, plotting the square function. First load needed libraries&lt;br /&gt;&lt;pre&gt;
sudo aptitude install libplplot-dev plplot11-driver-cairo plplot11-driver-xwin
&lt;/pre&gt;&lt;br /&gt;(in Ubuntu 12.04LTS), then in Lisp&lt;br /&gt;&lt;pre&gt;
(ql:quickload :cl-plplot)
(defun x-y-plot ()
       (let* ((x (iter (for x from 0.0 to 10.0 by 0.25) (collect x result-type vector)))
              (y (map 'vector (alexandria:rcurry 'expt 2) x))
              (p (cl-plplot:new-x-y-plot x y))
              (w (cl-plplot:basic-window :x-label "x" :y-label "x squared" :title "The square function")))
         (cl-plplot:add-plot-to-window w p)
         (cl-plplot:render w "xwin")))
(x-y-plot)
&lt;/pre&gt;&lt;br /&gt;Click on window and Enter to close; clicking on the close box for the window causes Lisp to crash, at least from Slime.</description>
	
	<pubDate>Mon, 06 May 2013 02:14:27 GMT</pubDate>
</item>

<item>
	<title>Patrick Stein: Building the language up to you</title>
	<guid isPermaLink="true">http://nklein.com/2013/05/building-the-language-up-to-you/</guid>
	<link>http://nklein.com/2013/05/building-the-language-up-to-you/</link>
	
	<description>&lt;p&gt;One of the things that&amp;#8217;s often said about Lisp is that it allows you to &lt;a href="http://dunsmor.com/lisp/onlisp/onlisp_5.html"&gt;build up the language&lt;/a&gt; to you.  Here are two examples that really drive home that point, for me.&lt;/p&gt;
&lt;h2&gt;The Problem Domain&lt;/h2&gt;
&lt;p&gt;I read &lt;a href="http://pavpanchekha.com/blog/treap.html"&gt;an article about Treaps&lt;/a&gt; on reddit yesterday.  The article used pretty direct pylisp to present Treaps.&lt;/p&gt;
&lt;p&gt;I thought it would be fun to go through the exercise in Common Lisp instead.  Pylisp made a number of things awkward that would melt away in Common Lisp.&lt;/p&gt;
&lt;p&gt;I began by defining a node structure to encapsulate the information at a given node:&lt;/p&gt;
&lt;div class="codecolorer-container lisp blackboard"&gt;&lt;pre class="lisp codecolorer"&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;defstruct node
  &lt;span&gt;&amp;#40;&lt;/span&gt;priority &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;random&lt;/span&gt; 1&lt;span&gt;.&lt;/span&gt;0d0&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;:&lt;/span&gt;&lt;span&gt;type&lt;/span&gt; real &lt;span&gt;:&lt;/span&gt;&lt;span&gt;read-only&lt;/span&gt; t&lt;span&gt;&amp;#41;&lt;/span&gt;
  &lt;span&gt;&amp;#40;&lt;/span&gt;key &lt;span&gt;0&lt;/span&gt; &lt;span&gt;:&lt;/span&gt;&lt;span&gt;read-only&lt;/span&gt; t&lt;span&gt;&amp;#41;&lt;/span&gt;
  &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;value&lt;/span&gt; &lt;span&gt;0&lt;/span&gt; &lt;span&gt;:&lt;/span&gt;&lt;span&gt;read-only&lt;/span&gt; t&lt;span&gt;&amp;#41;&lt;/span&gt;
  &lt;span&gt;&amp;#40;&lt;/span&gt;left &lt;span&gt;nil&lt;/span&gt; &lt;span&gt;:&lt;/span&gt;&lt;span&gt;type&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;or&lt;/span&gt; &lt;span&gt;null&lt;/span&gt; node&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;:&lt;/span&gt;&lt;span&gt;read-only&lt;/span&gt; t&lt;span&gt;&amp;#41;&lt;/span&gt;
  &lt;span&gt;&amp;#40;&lt;/span&gt;right &lt;span&gt;nil&lt;/span&gt; &lt;span&gt;:&lt;/span&gt;&lt;span&gt;type&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;or&lt;/span&gt; &lt;span&gt;null&lt;/span&gt; node&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;:&lt;/span&gt;&lt;span&gt;read-only&lt;/span&gt; t&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then, I defined a top-level structure to hold the root node, track the function used to sort the tree, and track the function used to create a key from a value.  I used the convention that two keys are equivalent if neither is less than the other.&lt;/p&gt;
&lt;div class="codecolorer-container lisp blackboard"&gt;&lt;pre class="lisp codecolorer"&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;defstruct treap
  &lt;span&gt;&amp;#40;&lt;/span&gt;root &lt;span&gt;nil&lt;/span&gt; &lt;span&gt;:&lt;/span&gt;&lt;span&gt;type&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;or&lt;/span&gt; &lt;span&gt;null&lt;/span&gt; node&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;:&lt;/span&gt;&lt;span&gt;read-only&lt;/span&gt; t&lt;span&gt;&amp;#41;&lt;/span&gt;
  &lt;span&gt;&amp;#40;&lt;/span&gt;less-than #'&lt;span&gt;&amp;lt;&lt;/span&gt; &lt;span&gt;:&lt;/span&gt;&lt;span&gt;read-only&lt;/span&gt; t&lt;span&gt;&amp;#41;&lt;/span&gt;
  &lt;span&gt;&amp;#40;&lt;/span&gt;key #'&lt;span&gt;identity&lt;/span&gt; &lt;span&gt;:&lt;/span&gt;&lt;span&gt;read-only&lt;/span&gt; t&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;The First Build Up&lt;/h2&gt;
&lt;p&gt;The article was using a functional style.  As you may have guessed by the liberal use of &lt;code class="codecolorer lisp default"&gt;&lt;span class="lisp"&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;read-only&lt;/span&gt; t&lt;/span&gt;&lt;/code&gt; in those &lt;code class="codecolorer lisp default"&gt;&lt;span class="lisp"&gt;DEFSTRUCT&lt;/span&gt;&lt;/code&gt; clauses, I also used a functional style.&lt;/p&gt;
&lt;p&gt;When working with functional data structures, one often needs to copy a whole structure  with only slight modifications.  Here, Lisp&amp;#8217;s keyword arguments made everything simple and clean.  I made this functions:&lt;/p&gt;
&lt;div class="codecolorer-container lisp blackboard"&gt;&lt;pre class="lisp codecolorer"&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;defun&lt;/span&gt; copy-node &lt;span&gt;&amp;#40;&lt;/span&gt;node &lt;span&gt;&amp;amp;&lt;/span&gt;key &lt;span&gt;&amp;#40;&lt;/span&gt;priority &lt;span&gt;&amp;#40;&lt;/span&gt;node-priority node&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
                            &lt;span&gt;&amp;#40;&lt;/span&gt;key &lt;span&gt;&amp;#40;&lt;/span&gt;node-key node&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
                            &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;value&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;node-&lt;span&gt;value&lt;/span&gt; node&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
                            &lt;span&gt;&amp;#40;&lt;/span&gt;left &lt;span&gt;&amp;#40;&lt;/span&gt;node-left node&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
                            &lt;span&gt;&amp;#40;&lt;/span&gt;right &lt;span&gt;&amp;#40;&lt;/span&gt;node-right node&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
  &lt;span&gt;&amp;#40;&lt;/span&gt;make-node &lt;span&gt;:&lt;/span&gt;&lt;span&gt;priority&lt;/span&gt; priority
             &lt;span&gt;:&lt;/span&gt;&lt;span&gt;key&lt;/span&gt; key
             &lt;span&gt;:&lt;/span&gt;&lt;span&gt;value&lt;/span&gt; &lt;span&gt;value&lt;/span&gt;
             &lt;span&gt;:&lt;/span&gt;&lt;span&gt;left&lt;/span&gt; left
             &lt;span&gt;:&lt;/span&gt;&lt;span&gt;right&lt;/span&gt; right&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now, for any node, I could copy it and only have to specify the fields that I wanted to change.  Here is a left-rotation using this:&lt;/p&gt;
&lt;div class="codecolorer-container lisp blackboard"&gt;&lt;pre class="lisp codecolorer"&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;defun&lt;/span&gt; left-rotate &lt;span&gt;&amp;#40;&lt;/span&gt;node&lt;span&gt;&amp;#41;&lt;/span&gt;
  &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;let&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;left &lt;span&gt;&amp;#40;&lt;/span&gt;node-left node&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
    &lt;span&gt;&amp;#40;&lt;/span&gt;copy-node left
               &lt;span&gt;:&lt;/span&gt;&lt;span&gt;right&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;copy-node node
                                 &lt;span&gt;:&lt;/span&gt;&lt;span&gt;left&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;node-right left&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;What other languages let you do anything like that so simply?  You could pull it off in Perl if you were willing to have your node be a hash (which, admittedly, you probably are if you&amp;#8217;re writing Perl).  What other language lets you do anything like that?  Even other languages with named arguments don&amp;#8217;t let you have the defaults based on other arguments.&lt;/p&gt;
&lt;h2&gt;The Second Build Up&lt;/h2&gt;
&lt;p&gt;As with any binary tree, you find yourself having to deal with four specific cases over and over again with Treaps.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You ran out of tree&lt;/li&gt;
&lt;li&gt;Your key is less than the current node&amp;#8217;s key&lt;/li&gt;
&lt;li&gt;Your key is greater than the current node&amp;#8217;s key&lt;/li&gt;
&lt;li&gt;Your key is equivalent to the current node&amp;#8217;s key&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I wrote myself a &lt;code class="codecolorer lisp default"&gt;&lt;span class="lisp"&gt;TREAP-CASES&lt;/span&gt;&lt;/code&gt; macro that streamlines all of these checks.  It also validates to make sure you don&amp;#8217;t have duplicate cases or cases other than these four.  It makes sure that no matter which order you write the cases (or even if you leave some out), they end up organized in the order listed above.  The four cases are mutually exclusive so the order doesn&amp;#8217;t matter except that you want to make sure you haven&amp;#8217;t run out of tree before doing comparisons and that once you&amp;#8217;re beyond the less-than and greater-than cases you already know you&amp;#8217;re in the equivalence case.&lt;/p&gt;
&lt;p&gt;With this macro, my &lt;code class="codecolorer lisp default"&gt;&lt;span class="lisp"&gt;TREAP-FIND&lt;/span&gt;&lt;/code&gt; function looks like this:&lt;/p&gt;
&lt;div class="codecolorer-container lisp blackboard"&gt;&lt;pre class="lisp codecolorer"&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;defun&lt;/span&gt; treap-find &lt;span&gt;&amp;#40;&lt;/span&gt;key treap&lt;span&gt;&amp;#41;&lt;/span&gt;
  &lt;span&gt;&amp;#40;&lt;/span&gt;check-type treap treap&lt;span&gt;&amp;#41;&lt;/span&gt;
  &lt;span&gt;&amp;#40;&lt;/span&gt;labels &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;treap-node-find &lt;span&gt;&amp;#40;&lt;/span&gt;root&lt;span&gt;&amp;#41;&lt;/span&gt;
             &lt;span&gt;&amp;#40;&lt;/span&gt;treap-cases &lt;span&gt;&amp;#40;&lt;/span&gt;key root treap&lt;span&gt;&amp;#41;&lt;/span&gt;
               &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;null&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;values &lt;span&gt;nil&lt;/span&gt; &lt;span&gt;nil&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
               &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;lt;&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;treap-node-find &lt;span&gt;&amp;#40;&lt;/span&gt;node-left root&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
               &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;gt;&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;treap-node-find &lt;span&gt;&amp;#40;&lt;/span&gt;node-right root&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
               &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;=&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;values &lt;span&gt;&amp;#40;&lt;/span&gt;node-&lt;span&gt;value&lt;/span&gt; root&lt;span&gt;&amp;#41;&lt;/span&gt; t&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
    &lt;span&gt;&amp;#40;&lt;/span&gt;treap-node-find &lt;span&gt;&amp;#40;&lt;/span&gt;treap-root treap&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The little DSL makes writing and reading the code so much easier.  All of the mess of comparing the key to the node&amp;#8217;s key is hidden away.&lt;/p&gt;
&lt;p&gt;With years of practice and days of debugging, you might be able to pull off some quasi-readable control construct like this using C++ templates.  With enough therapy, you could convince yourself you can get a close-enough effect with C-preprocessor macros.  In Lisp, it&amp;#8217;s the work of minutes (without lying to yourself).&lt;/p&gt;
&lt;p&gt;Here is the &lt;code class="codecolorer lisp default"&gt;&lt;span class="lisp"&gt;TREAP-CASES&lt;/span&gt;&lt;/code&gt; macro for reference/completeness.&lt;/p&gt;
&lt;div class="codecolorer-container lisp blackboard"&gt;&lt;pre class="lisp codecolorer"&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;defmacro&lt;/span&gt; treap-cases &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;key root treap&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;&amp;amp;&lt;/span&gt;rest clauses&lt;span&gt;&amp;#41;&lt;/span&gt;
  &lt;span&gt;&amp;#40;&lt;/span&gt;validate-treap-case-clauses clauses&lt;span&gt;&amp;#41;&lt;/span&gt;
  &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;let&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;k &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;gensym&lt;/span&gt; &lt;span&gt;&amp;quot;KEY-&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
        &lt;span&gt;&amp;#40;&lt;/span&gt;tr &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;gensym&lt;/span&gt; &lt;span&gt;&amp;quot;TREAP-&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
        &lt;span&gt;&amp;#40;&lt;/span&gt;r &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;gensym&lt;/span&gt; &lt;span&gt;&amp;quot;ROOT-&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
        &lt;span&gt;&amp;#40;&lt;/span&gt;t&lt;span&gt;&amp;lt;&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;gensym&lt;/span&gt; &lt;span&gt;&amp;quot;&amp;lt;-&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
    `&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;let&lt;/span&gt;* &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;k &lt;span&gt;,&lt;/span&gt;key&lt;span&gt;&amp;#41;&lt;/span&gt;
            &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;tr &lt;span&gt;,&lt;/span&gt;treap&lt;span&gt;&amp;#41;&lt;/span&gt;
            &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;r &lt;span&gt;,&lt;/span&gt;root&lt;span&gt;&amp;#41;&lt;/span&gt;
            &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;t&lt;span&gt;&amp;lt;&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;treap-less-than &lt;span&gt;,&lt;/span&gt;tr&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
       &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;cond&lt;/span&gt;
        &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;null&lt;/span&gt; &lt;span&gt;,&lt;/span&gt;r&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;,&lt;/span&gt;@&lt;span&gt;&amp;#40;&lt;/span&gt;rest &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;assoc&lt;/span&gt; '&lt;span&gt;null&lt;/span&gt; clauses&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
        &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;funcall&lt;/span&gt; &lt;span&gt;,&lt;/span&gt;t&lt;span&gt;&amp;lt;&lt;/span&gt; &lt;span&gt;,&lt;/span&gt;k &lt;span&gt;&amp;#40;&lt;/span&gt;node-key &lt;span&gt;,&lt;/span&gt;r&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;,&lt;/span&gt;@&lt;span&gt;&amp;#40;&lt;/span&gt;rest &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;assoc&lt;/span&gt; '&lt;span&gt;&amp;lt;&lt;/span&gt; clauses&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
        &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;funcall&lt;/span&gt; &lt;span&gt;,&lt;/span&gt;t&lt;span&gt;&amp;lt;&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;node-key &lt;span&gt;,&lt;/span&gt;r&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;,&lt;/span&gt;k&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;,&lt;/span&gt;@&lt;span&gt;&amp;#40;&lt;/span&gt;rest &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;assoc&lt;/span&gt; '&lt;span&gt;&amp;gt;&lt;/span&gt; clauses&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
        &lt;span&gt;&amp;#40;&lt;/span&gt;t &lt;span&gt;,&lt;/span&gt;@&lt;span&gt;&amp;#40;&lt;/span&gt;rest &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;assoc&lt;/span&gt; '&lt;span&gt;=&lt;/span&gt; clauses&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;I suppose I should also include &lt;code class="codecolorer lisp default"&gt;&lt;span class="lisp"&gt;#'VALIDATE-TREAP-CASE-CLAUSES&lt;/span&gt;&lt;/code&gt;, too, but it&amp;#8217;s what you&amp;#8217;d expect:&lt;/p&gt;
&lt;div class="codecolorer-container lisp blackboard"&gt;&lt;pre class="lisp codecolorer"&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;defun&lt;/span&gt; validate-treap-case-clauses &lt;span&gt;&amp;#40;&lt;/span&gt;clauses&lt;span&gt;&amp;#41;&lt;/span&gt;
  &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;let&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;all-choices '&lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;null&lt;/span&gt; &lt;span&gt;&amp;lt;&lt;/span&gt; &lt;span&gt;&amp;gt;&lt;/span&gt; &lt;span&gt;=&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
    &lt;span&gt;&amp;#40;&lt;/span&gt;flet &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#40;&lt;/span&gt;assert-all-choices-valid &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
             &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;dolist&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;c clauses&lt;span&gt;&amp;#41;&lt;/span&gt;
               &lt;span&gt;&amp;#40;&lt;/span&gt;unless &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;member&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;first c&lt;span&gt;&amp;#41;&lt;/span&gt; all-choices&lt;span&gt;&amp;#41;&lt;/span&gt;
                 &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;error&lt;/span&gt; &lt;span&gt;&amp;quot;Unrecognized clause type: ~S&amp;quot;&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;first c&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
           &lt;span&gt;&amp;#40;&lt;/span&gt;assert-no-duplicates &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
             &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;dolist&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;c all-choices&lt;span&gt;&amp;#41;&lt;/span&gt;
               &lt;span&gt;&amp;#40;&lt;/span&gt;unless &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;&amp;lt;=&lt;/span&gt; &lt;span&gt;&amp;#40;&lt;/span&gt;count c clauses &lt;span&gt;:&lt;/span&gt;&lt;span&gt;key&lt;/span&gt; #'first&lt;span&gt;&amp;#41;&lt;/span&gt; &lt;span&gt;1&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
                 &lt;span&gt;&amp;#40;&lt;/span&gt;&lt;span&gt;error&lt;/span&gt; &lt;span&gt;&amp;quot;Duplicate ~S clause not allowed.&amp;quot;&lt;/span&gt; c&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;
      &lt;span&gt;&amp;#40;&lt;/span&gt;assert-all-choices-valid&lt;span&gt;&amp;#41;&lt;/span&gt;
      &lt;span&gt;&amp;#40;&lt;/span&gt;assert-no-duplicates&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;span&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;</description>
	
	<pubDate>Sun, 05 May 2013 06:05:55 GMT</pubDate>
</item>

<item>
	<title>Nick Levine: Ravenbrook has recovered and open-sourced MLWorks</title>
	<guid isPermaLink="true">http://enlivend.livejournal.com/44638.html</guid>
	<link>http://enlivend.livejournal.com/44638.html</link>
	
	<description>&lt;a href="http://www.ravenbrook.com/project/mlworks/" target="_blank" rel="nofollow"&gt;MLWorks&lt;/a&gt; is an "industrial strength" Standard ML compiler and integrated development environment, developed by &lt;a href="https://en.wikipedia.org/wiki/Harlequin_%28software_company%29" target="_blank" rel="nofollow"&gt;Harlequin&lt;/a&gt; in the 1990s.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ravenbrook.com" target="_blank" rel="nofollow"&gt;Ravenbrook Limited&lt;/a&gt; (whose directors were members of the original MLWorks team) acquired the rights to MLWorks on 2013-04-26 and have open sourced the project. Source code is under the BSD license on &lt;a href="https://github.com/Ravenbrook/mlworks" target="_blank" rel="nofollow"&gt;GitHub&lt;/a&gt;.</description>
	
	<pubDate>Fri, 03 May 2013 17:27:18 GMT</pubDate>
</item>


</channel>
</rss>
