<?xml version='1.0' encoding='utf-8' ?>
<!--  If you are running a bot please visit this policy page outlining rules you must respect. http://www.livejournal.com/bots/  -->
<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:media='http://search.yahoo.com/mrss/' xmlns:atom10='http://www.w3.org/2005/Atom'>
<channel>
  <title>Kevin Reid&apos;s blog</title>
  <link>http://kpreid.livejournal.com/</link>
  <description>Kevin Reid&apos;s blog - LiveJournal.com</description>
  <managingEditor>kpreid@mac.com</managingEditor>
  <lastBuildDate>Mon, 21 Dec 2009 01:58:18 GMT</lastBuildDate>
  <generator>LiveJournal / LiveJournal.com</generator>
  <lj:journal>kpreid</lj:journal>
  <lj:journalid>3537103</lj:journalid>
  <lj:journaltype>personal</lj:journaltype>
  <atom10:link rel='hub' href='http://pubsubhubbub.appspot.com/' />
  <image>
    <url>http://l-userpic.livejournal.com/93371764/3537103</url>
    <title>Kevin Reid&apos;s blog</title>
    <link>http://kpreid.livejournal.com/</link>
    <width>100</width>
    <height>100</height>
  </image>

<item>
  <guid isPermaLink='true'>http://kpreid.livejournal.com/20149.html</guid>
  <pubDate>Mon, 21 Dec 2009 01:58:18 GMT</pubDate>
  <title>Improving my web presence, out of necessity. Also, Apache configuration and LJ OpenID</title>
  <author>kpreid@mac.com</author>  <link>http://kpreid.livejournal.com/20149.html</link>
  <description>&lt;p&gt;A machine I used to use to host some web services, bots, and repositories became no longer accessible from the Internet, as a result of which I&apos;ve had to move what I was serving from it; some to &lt;a href=&quot;http://switchb.org/&quot;&gt;switchb.org&lt;/a&gt;, some to personal machines.&lt;/p&gt;

&lt;p&gt;I took the opportunity to clean things up a bit, as a result of which I now have better backups, more polished services, and know a little bit more about configuring Apache — though not as much as I perhaps should.&lt;/p&gt;

&lt;ul&gt;

&lt;li&gt;&lt;p&gt;My &lt;a href=&quot;http://subversion.tigris.org/&quot;&gt;Subversion&lt;/a&gt; repositories are now served over HTTP, and therefore browsable; and they are now backed up daily (using svnsync triggered by a cron job) to my laptop, and thence to all &lt;em&gt;its&lt;/em&gt; backups.&lt;/p&gt;

&lt;p&gt;(I wasted several minutes on remembering that cron will ignore the last line of a crontab file if it doesn&apos;t end with a newline; after listening to me grumbling about this, someone made a suggestion to end the file with a &lt;em&gt;comment&lt;/em&gt;, so that the last line is harmless whether ignored or not, and also reminds one of the issue.)&lt;/p&gt;

&lt;p&gt;If you have a working copy of one of my repositories (E-on-CL, E-on-JavaScript, MudWalker, Den, etc.), here&apos;s &lt;a href=&quot;http://www.eros-os.org/pipermail/e-lang/2009-December/013358.html&quot;&gt;a guide to the changed URLs&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;&lt;p&gt;My other &lt;a href=&quot;http://allmydata.org/&quot;&gt;Tahoe-LAFS&lt;/a&gt; &lt;a href=&quot;http://allmydata.org/trac/tahoe/wiki/VolunteerGrid&quot; title=&quot;&quot;&gt;volunteer grid&lt;/a&gt; storage node is now residing on a machine on my home LAN.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Finally, some simple data-querying web services I wrote for &lt;a href=&quot;http://waterpoint.moo.mud.org/&quot;&gt;Waterpoint&lt;/a&gt;&apos;s word games have now been moved to switchb.org; I also took the time to prettify their URLs (no cgi-bin or .cgi) and write documentation.&lt;/p&gt;
&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;I haven&apos;t yet gotten to working on the bots, &lt;a href=&quot;http://darcs.net/&quot;&gt;darcs&lt;/a&gt; repositories, or miscellaneous other stuff I had there.&lt;/p&gt;

&lt;p&gt;(Pondering moving my blog over to switchb.org as well so as to not have ads, especially now that I found I can still have LJ-friends by way of OpenID. (Hm, but reading friends-locked posts over RSS might not work since there&apos;s no username+password for LJ to accept. Anyone have experience with that situation?))&lt;/p&gt;

&lt;p&gt;Apache configuration questions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;If I have multiple variants of a document (e.g. foo.html foo.pdf foo.txt) handled by MultiViews, so the canonical URL of the document is extensionless (“foo”), how do I properly control the default variant to serve in the event that the client does not express a preference via the Accept header? (Without doing so, I found that it would serve the .txt version, whereas I would prefer the HTML.) All that I found that worked was to create a &lt;a href=&quot;http://httpd.apache.org/docs/2.2/mod/mod_negotiation.html#typemaps&quot; title=&quot;Type maps - mod_negotiation - Apache HTTP Server&quot;&gt;type map file&lt;/a&gt; named “foo” with quality values, and force it to be interpreted as a type map using &amp;lt;FilesMatch&amp;gt;. This seems kludgy to me.&lt;/li&gt;

&lt;li&gt;What is the right way to serve CGIs, not in a designated cgi-bin directory, and without any .cgi extension in the URL? I initially tried to apply mod_rewrite, but I couldn&apos;t get it to work such that /foo internally contacted foo.cgi whereas /foo.cgi redirected to /foo. I resorted to another &amp;lt;FilesMatch&amp;gt; explicitly listing the name of each CGI and doing &lt;code&gt;SetHandler cgi-script&lt;/code&gt;.&lt;/li&gt;

&lt;li&gt;What is the right way to handle “testing” vs. “deployment” configurations, where the relevant Directory, Location, etc may be different depending on which server or subdirectory the site is set up on? I &lt;a href=&quot;http://httpd.apache.org/docs/2.2/configuring.html#syntax&quot; title=&quot;Syntax of the Configuration Files - Apache HTTP Server&quot;&gt;see that&lt;/a&gt; one may use environment variables — should I just set up variables containing the path prefixes for the particular host before including the generic configuration file?&lt;/li&gt;

&lt;/ol&gt;</description>
  <comments>http://kpreid.livejournal.com/20149.html</comments>
  <category>programming</category>
  <category>tahoe</category>
  <category>apache</category>
  <category>web site</category>
  <category>e-on-cl</category>
  <category>e</category>
  <category>questions</category>
  <category>svn</category>
  <category>life</category>
  <category>openid</category>
  <lj:security>public</lj:security>
  <lj:reply-count>2</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://kpreid.livejournal.com/19829.html</guid>
  <pubDate>Tue, 15 Dec 2009 02:56:15 GMT</pubDate>
  <title>And now for something utterly internet-pop-culturish</title>
  <author>kpreid@mac.com</author>  <link>http://kpreid.livejournal.com/19829.html</link>
  <description>&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://switchb.org/kpreid/2009/i-tape&quot; style=&quot;width: 90%; max-width: 600px; height: auto; border: none; box-shadow: 0px 1px 3px #888; -webkit-box-shadow: 0px 1px 3px #888; -moz-box-shadow: 0px 1px 3px #888;&quot;&gt;&lt;/p&gt;

&lt;p style=&quot;text-align: center; font-size: 80%; width: 80%; margin: 1em auto;&quot;&gt;Photo taken by me in a Staples store. Text added with Zach Beane&apos;s &lt;a href=&quot;http://wigflip.com/roflbot/&quot;&gt;roflbot&lt;/a&gt;.&lt;/p&gt;</description>
  <comments>http://kpreid.livejournal.com/19829.html</comments>
  <category>short</category>
  <category>thoughts</category>
  <category>irrelevant</category>
  <category>lisp</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://kpreid.livejournal.com/19669.html</guid>
  <pubDate>Mon, 14 Dec 2009 16:12:03 GMT</pubDate>
  <title>Unifying status messages?</title>
  <author>kpreid@mac.com</author>  <link>http://kpreid.livejournal.com/19669.html</link>
  <description>&lt;p&gt;Has anyone invented a common protocol for, in a desktop environment, updating status (available/away/do-not-disturb and “what I&apos;m doing” and so on) in social applications? I have 5 different such applications (iChat, Colloquy, Skype, MudWalker, Steam), and I usually don&apos;t bother to update all of them since it&apos;s too much trouble to do regularly. Is there some protocol that, say, the Linux-on-the-desktop folks have invented for having just one widget to inform everything?&lt;/p&gt;

&lt;p&gt;[edit] Clarification: I mention Linux-on-the-desktop just because I don&apos;t know much aboutit and there seems to be some innovation from that direction in this kind of area. The desktop in question is Mac OS X; I&apos;m expecting to have to write the software myself; I just want to not reinvent the wheel with regard to &lt;em&gt;protocol&lt;/em&gt;.&lt;/p&gt;</description>
  <comments>http://kpreid.livejournal.com/19669.html</comments>
  <category>questions</category>
  <category>desktop</category>
  <category>programming</category>
  <category>mac os x</category>
  <lj:security>public</lj:security>
  <lj:reply-count>6</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://kpreid.livejournal.com/19243.html</guid>
  <pubDate>Wed, 25 Nov 2009 22:06:21 GMT</pubDate>
  <title>ASDF PSA: defpackage in .asd is not obligatory</title>
  <author>kpreid@mac.com</author>  <link>http://kpreid.livejournal.com/19243.html</link>
  <description>&lt;p&gt;There seems to be a recurring misconception about writing &lt;code&gt;.asd&lt;/code&gt; files. It is &lt;strong&gt;not necessary&lt;/strong&gt; to start your asd with &lt;code&gt;(defpackage :foo.system ...) (in-package :foo.system)&lt;/code&gt; to “avoid polluting the package asdf loads your system in”.&lt;/p&gt;

&lt;p&gt;Every time an .asd file is loaded, ASDF &lt;em&gt;creates a fresh package&lt;/em&gt; to load it in. The relevant code from ASDF is:&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;(defun make-temporary-package ()
  (flet ((try (counter)
           (ignore-errors
                   (make-package (format nil &amp;quot;ASDF~D&amp;quot; counter)
                                 :use &amp;#x27;(:cl :asdf)))))
    (do* ((counter 0 (+ counter 1))
          (package (try counter) (try counter)))
         (package package))))

(defun find-system (...)
  ...
      (let ((package (make-temporary-package)))
        (unwind-protect
             (let ((*package* package))
               ...
               (load on-disk))
          (delete-package package)))
  ...)&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;So, whenever you load an asd file, the package is fresh and &lt;code&gt;:use&lt;/code&gt;s CL and ASDF.&lt;/p&gt;

&lt;p&gt;There &lt;em&gt;are&lt;/em&gt; reasons to define a package for your asdf system definition.&lt;/p&gt;
&lt;ul&gt;
  
  &lt;li&gt;If you are creating any &lt;em&gt;classes&lt;/em&gt;, such as custom ASDF component types, then, since classes are not garbage collected (MOP specifies that the list of a class&apos;s subclasses can be retrieved, and no implementation I know of uses weak references for the purpose), naming them with symbols in a consistent package (rather than the asdf temporary package) ensures that reloading the system definition does not create useless additional copies of the classes.&lt;/li&gt;
  
  &lt;li&gt;If you are defining functions or other named entities in your system definition (which should of course only be done if they are also necessary to load the system) and want to be able to refer to them, such as for debugging, with nice interned symbol names.&lt;/li&gt;
  &lt;li&gt;If you want to be able to &lt;code&gt;(load &quot;foo.asd&quot;)&lt;/code&gt; rather than going through asdf:find-system.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The disadvantages I can think of for defining a package for your system definitions are that the package list becomes more cluttered (only noticeably if for some strange reason you&apos;re loading many system definitions and not loading the defined systems), you&apos;re using more of the global package namespace (probably not a significant concern if you use a naming scheme like &lt;code&gt;foo&lt;/code&gt; and &lt;code&gt;foo.system&lt;/code&gt;), and your code is marginally more complex.&lt;/p&gt;

&lt;p&gt;So there are good reasons for (and maybe some against) &lt;code&gt;defpackage&lt;/code&gt; in your asd, but package hygiene is &lt;em&gt;not&lt;/em&gt; one of them.&lt;/p&gt;

&lt;p&gt;&lt;small&gt;[Edited 2009-11-26 to be less worded against defpackage after consideration and feedback.]&lt;/small&gt;&lt;/p&gt;</description>
  <comments>http://kpreid.livejournal.com/19243.html</comments>
  <category>programming</category>
  <category>lisp</category>
  <lj:security>public</lj:security>
  <lj:reply-count>4</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://kpreid.livejournal.com/19104.html</guid>
  <pubDate>Tue, 24 Nov 2009 23:55:01 GMT</pubDate>
  <title>91% off sale at SparkFun Electronics</title>
  <author>kpreid@mac.com</author>  <link>http://kpreid.livejournal.com/19104.html</link>
  <description>&lt;p&gt;You probably already know about this if you&apos;re interested, but &lt;a href=&quot;http://www.sparkfun.com/&quot;&gt;SparkFun Electronics&lt;/a&gt; will be having, on January 7, a “&lt;a href=&quot;http://www.sparkfun.com/commerce/news.php?id=305&quot;&gt;Free Day&lt;/a&gt;” on which you can order up to $100 and pay only shipping (plus any amount over $100). Shipping, to my location by the cheap options, was shown as ~$10 (thus “91% off”, not considering tax).&lt;/p&gt;

&lt;p&gt;(I have no affiliation with, and have not ordered anything from, SparkFun Electronics; this is just some info that showed up in my feed reader. As far as I’ve heard they’re good folks.)&lt;/p&gt;

&lt;p&gt;SparkFun’s product line is somewhat oriented towards the hip electronics hobbyist, the sort of stuff that &lt;i&gt;&lt;a href=&quot;http://blog.makezine.com/archive/electronics/&quot;&gt;Make&lt;/a&gt;&lt;/i&gt; talks about: Arduino, text and graphic LCDs, blinky light kits, wireless stuff (serial links, GPS, Bluetooth), robots, sensors, breakout boards/modules for surface mount components. Many of these items are high priced, but they have notable cheap stuff too; when I heard about this sale yesterday my first-cut list of 11 interesting items only totaled $62.&lt;/p&gt;</description>
  <comments>http://kpreid.livejournal.com/19104.html</comments>
  <category>electronics</category>
  <category>news</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://kpreid.livejournal.com/18923.html</guid>
  <pubDate>Wed, 28 Oct 2009 01:53:09 GMT</pubDate>
  <title>Avoiding repeating myself (on the command line)</title>
  <author>kpreid@mac.com</author>  <link>http://kpreid.livejournal.com/18923.html</link>
  <description>&lt;p&gt;I was working on some automated document generation, building the process, revising the input document, and checking the results, and got tired enough of typing &quot;make output/foo.txt &amp;&amp; open output/foo.txt&quot; and then going back and editing that line when I wanted to check the PDF version etc. that I wrote a tool which I hope will have more general application as well. I called it “maken”:&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;#!/bin/sh
# Make files and view the results.
make &quot;$@&quot; &amp;&amp; open &quot;$@&quot;&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Or it could be generalized into being a combinator, running any two commands, rather than just &lt;code&gt;make&lt;/code&gt; and &lt;code&gt;open&lt;/code&gt;, specified as the first two arguments:&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;#!/bin/sh
ca=&quot;$1&quot;
shift
cb=&quot;$1&quot;
shift
&quot;$ca&quot; &quot;$@&quot; &amp;&amp; &quot;$cb&quot; &quot;$@&quot;&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;(Which, for the Haskell folks, should be called &lt;code&gt;&amp;&amp;&amp;&lt;/code&gt;, except that that would be annoying to enter in the shell.)&lt;/p&gt;</description>
  <comments>http://kpreid.livejournal.com/18923.html</comments>
  <category>programming</category>
  <category>programs</category>
  <category>haskell</category>
  <category>shell</category>
  <lj:security>public</lj:security>
  <lj:reply-count>2</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://kpreid.livejournal.com/18499.html</guid>
  <pubDate>Sat, 24 Oct 2009 01:58:52 GMT</pubDate>
  <title>Google Wave: Tell me what it&apos;s good for</title>
  <author>kpreid@mac.com</author>  <link>http://kpreid.livejournal.com/18499.html</link>
  <description>&lt;p&gt;I&apos;m on &lt;a href=&quot;http://wave.google.com/&quot;&gt;Google Wave&lt;/a&gt; (by way of my participation in GSoC 2009). Tell me what&apos;s worth my time to do with it.&lt;/p&gt;

&lt;p&gt;My ID is apparently &lt;kbd&gt;kpreid.switchb.org@googlewave.com&lt;/kbd&gt;. (&lt;code&gt;kpreid&lt;/code&gt; was taken, hmph.)&lt;/p&gt;</description>
  <comments>http://kpreid.livejournal.com/18499.html</comments>
  <category>questions</category>
  <category>gsoc</category>
  <category>gsoc2009</category>
  <lj:security>public</lj:security>
  <lj:reply-count>7</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://kpreid.livejournal.com/18189.html</guid>
  <pubDate>Sat, 17 Oct 2009 14:22:22 GMT</pubDate>
  <title>Irony, exhibit 1</title>
  <author>kpreid@mac.com</author>  <link>http://kpreid.livejournal.com/18189.html</link>
  <description>&lt;p&gt;I blame a certain English teacher last year for introducing “FAIL” into my vocabulary.&lt;/p&gt;</description>
  <comments>http://kpreid.livejournal.com/18189.html</comments>
  <category>college</category>
  <category>short</category>
  <lj:security>public</lj:security>
  <lj:reply-count>1</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://kpreid.livejournal.com/18109.html</guid>
  <pubDate>Tue, 22 Sep 2009 03:20:08 GMT</pubDate>
  <author>kpreid@mac.com</author>  <link>http://kpreid.livejournal.com/18109.html</link>
  <description>&lt;p&gt;Every time you write “&lt;code&gt; | &lt;/code&gt;” in shell, that&apos;s concurrent programming.&lt;/p&gt;</description>
  <comments>http://kpreid.livejournal.com/18109.html</comments>
  <category>short</category>
  <category>thoughts</category>
  <category>programming</category>
  <category>shell</category>
  <lj:security>public</lj:security>
  <lj:reply-count>2</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://kpreid.livejournal.com/17741.html</guid>
  <pubDate>Tue, 22 Sep 2009 01:45:09 GMT</pubDate>
  <title>This is not a LaTeX quine</title>
  <author>kpreid@mac.com</author>  <link>http://kpreid.livejournal.com/17741.html</link>
  <description>&lt;pre&gt;\documentclass{article}
\usepackage{verbatim}
\begin{document}
  \verbatiminput{\jobname.tex}
\end{document}&lt;/pre&gt;</description>
  <comments>http://kpreid.livejournal.com/17741.html</comments>
  <category>short</category>
  <category>programming</category>
  <category>programs</category>
  <category>latex</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://kpreid.livejournal.com/17564.html</guid>
  <pubDate>Fri, 18 Sep 2009 03:54:36 GMT</pubDate>
  <title>What do you call a method, er, header in Java?</title>
  <author>kpreid@mac.com</author>  <link>http://kpreid.livejournal.com/17564.html</link>
  <description>&lt;p&gt;What do practicing Java programmers call the part of a method definition that isn&apos;t the { body }?&lt;/p&gt;

&lt;pre&gt;__________/ this bit here \___________
public static void main(String[] args) {
  // not this part
}&lt;/pre&gt;

&lt;p&gt;A quick search turned up the &lt;a href=&quot;http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#40420&quot;&gt;Java Language Specification, Second Edition&lt;/a&gt; calling it a MethodHeader in the grammar, but it doesn&apos;t use that term in the text and I want to know what term(s) are used in practice, not solely by language lawyers.&lt;/p&gt;

&lt;p&gt;(“Signature” is not correct, as that includes only the method name and parameter types, not modifiers and result type.)&lt;/p&gt;</description>
  <comments>http://kpreid.livejournal.com/17564.html</comments>
  <category>questions</category>
  <category>programming</category>
  <category>java</category>
  <lj:security>public</lj:security>
  <lj:reply-count>7</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://kpreid.livejournal.com/17317.html</guid>
  <pubDate>Fri, 18 Sep 2009 03:29:24 GMT</pubDate>
  <title>It&apos;s that time of day again...</title>
  <author>kpreid@mac.com</author>  <link>http://kpreid.livejournal.com/17317.html</link>
  <description>&lt;p&gt;Both of the non-internet-based computer-related classes I&apos;m taking this semester are (only offered as) once-per-week night classes, &lt;em&gt;nominally&lt;/em&gt; ending at 9:30. So I&apos;m talking with someone after class — — gee, it&apos;s bedtime already.&lt;/p&gt;</description>
  <comments>http://kpreid.livejournal.com/17317.html</comments>
  <category>college</category>
  <category>short</category>
  <category>programming</category>
  <category>life</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://kpreid.livejournal.com/16930.html</guid>
  <pubDate>Fri, 11 Sep 2009 01:09:27 GMT</pubDate>
  <title>GSoC conclusion.</title>
  <author>kpreid@mac.com</author>  <link>http://kpreid.livejournal.com/16930.html</link>
  <description>&lt;p&gt;Late update on &lt;a href=&quot;http://code.google.com/p/caja-captp/&quot;&gt;Caja-CapTP&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;Google Summer of Code is over. I passed based on revised goals, but I&apos;m not happy with the state of the code and I did not complete any significant part of the original plan.&lt;/p&gt;

&lt;p&gt;Regarding the items mentioned in &lt;a href=&quot;http://kpreid.livejournal.com/16079.html&quot;&gt;my last update&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote cite=&quot;http://kpreid.livejournal.com/16079.html&quot;&gt;&lt;ul&gt;
&lt;li&gt;Write more documentation/comments.
&lt;li&gt;Commit as much of the work-in-progress as I can.
&lt;ul&gt;&lt;li&gt;...including the incomplete CapTPConnection, even though its tests don&apos;t pass yet, so that the partial work can be counted.&lt;/ul&gt;
&lt;/ul&gt;&lt;/blockquote&gt;

&lt;p&gt;I committed CapTPConnection, and found and fixed enough infrastructure (whenResolved, CommTable, SwissTable, deSubgraphKit, etc.) bugs that it starts up and can do a basic operation or two. It&apos;s not useful for anything, but it&apos;s a lot closer to running than it was at the time of my last update.&lt;/p&gt;

&lt;p&gt;Also, I removed dependencies on &apos;window&apos; so in principle it will operate on a non-browser (server) JavaScript implementation. This has not been exercised because there is no browserless driver for the test scripts yet.&lt;/p&gt;

&lt;p&gt;I stated that I would continue working on Caja-CapTP past the GSoC work period; however, with the time occupied by schoolwork, I have not had time or brain space to do so &lt;em&gt;yet&lt;/em&gt;. I am not going to abandon the project.&lt;/p&gt;</description>
  <comments>http://kpreid.livejournal.com/16930.html</comments>
  <category>programming</category>
  <category>javascript</category>
  <category>caps</category>
  <category>e</category>
  <category>college</category>
  <category>captp</category>
  <category>life</category>
  <category>gsoc</category>
  <category>gsoc2009</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://kpreid.livejournal.com/16804.html</guid>
  <pubDate>Fri, 11 Sep 2009 00:54:48 GMT</pubDate>
  <title>an approximation, the usefulness of which depends on the application</title>
  <author>kpreid@mac.com</author>  <link>http://kpreid.livejournal.com/16804.html</link>
  <description>&lt;p&gt;Java programming class (yes, I know Java already) today, introducing loops. Task: write a factorial program. I wrote mine to use &lt;code&gt;int&lt;/code&gt; arithmetic if possible, floating-point if not. Test the edge cases, of course. It says:&lt;/p&gt;

&lt;blockquote&gt;500! ≈ Infinity&lt;/blockquote&gt;

&lt;p&gt;I&apos;m glad I used the “approximately equals” sign.&lt;/p&gt;</description>
  <comments>http://kpreid.livejournal.com/16804.html</comments>
  <category>unicode</category>
  <category>short</category>
  <category>programming</category>
  <category>irrelevant</category>
  <category>math</category>
  <category>java</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://kpreid.livejournal.com/16420.html</guid>
  <pubDate>Tue, 08 Sep 2009 14:32:22 GMT</pubDate>
  <title>Tell me what college to transfer to. (Or, Decloaking, part 2)</title>
  <author>kpreid@mac.com</author>  <link>http://kpreid.livejournal.com/16420.html</link>
  <description>&lt;p&gt;As &lt;a href=&quot;http://kpreid.livejournal.com/12194.html&quot;&gt;I wrote before&lt;/a&gt;, I am currently attending &lt;a href=&quot;http://www.mvcc.edu/&quot;&gt;MVCC&lt;/a&gt;, a two-year college, and need to choose a college to transfer to (for a bachelor’s in computer science).&lt;/p&gt;

&lt;p&gt;So, &lt;strong&gt;tell me what college(s) I ought to consider.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;(I have of course also heard the advice that &lt;a href=&quot;http://scienceblogs.com/principles/2009/08/how_to_choose_a_college.php&quot;&gt;it doesn’t matter that much&lt;/a&gt;, but I&apos;ve got to choose from &lt;em&gt;some&lt;/em&gt; short-list...)&lt;/p&gt;

&lt;p&gt;I am willing to consider any location in the contiguous US, but have been looking mostly at New York choices as a way to make the research list manageably short.&lt;/p&gt;

&lt;p&gt;I am &lt;em&gt;not&lt;/em&gt; looking for vocational training; I can learn this year’s or last year’s hot technologies just fine by myself, thank you. I’m looking for general education (“well-rounding”, shall we say), useful theory, and practice in &lt;em&gt;thinking&lt;/em&gt;. I wish to avoid a high-pressure or competitive academic environment. Also, at MVCC, I have greatly appreciated the instructors’ approachability, availability, and even willingness to acknowledge mistakes.&lt;/p&gt;

&lt;p&gt;Outside of education, I am particularly interested in there being social opportunities for the socially awkward; chances to talk to like-minded people (i.e. total geeks), and opportunities to talk to unlike-minded people (for the practice!).&lt;/p&gt;

&lt;p&gt;Please give me your recommendations. Just a name, your personal experience, comments on others’ recommendations, whatever info you’d like to share.&lt;/p&gt;

&lt;br&gt;
&lt;p&gt;(On the other hand entirely, I’d also consider going directly from MVCC to a full-time job given the right opportunity. This will be the topic of an upcoming post.)&lt;/p&gt;</description>
  <comments>http://kpreid.livejournal.com/16420.html</comments>
  <category>questions</category>
  <category>college</category>
  <category>life</category>
  <lj:security>public</lj:security>
  <lj:reply-count>5</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://kpreid.livejournal.com/16348.html</guid>
  <pubDate>Tue, 01 Sep 2009 19:53:55 GMT</pubDate>
  <title>Input wanted: posting short stuff</title>
  <author>kpreid@mac.com</author>  <link>http://kpreid.livejournal.com/16348.html</link>
  <description>&lt;p&gt;I&apos;ve been having a lot of thoughts lately I&apos;d like to publish, but seem a little bit too short for A Blog Post. Some options&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Considered signing up for Twitter. Pro: short stuff is expected there; participating in the hot new thing; people interested in short-form will be on twitter and using the follow feature. Con: Reliability problems; &lt;abbr title=&quot;yet another&quot;&gt;YA&lt;/abbr&gt; thing to manage credentials and backup for; no hyperlinks; my favorite username is &lt;a href=&quot;https://twitter.com/kpreid&quot; rel=&quot;nofollow&quot;&gt;taken&lt;/a&gt;.
&lt;li&gt;I could post stuff here. Particularly, LJ supports titleless posts.
&lt;li&gt;I could use some other site, or build my own publishing system. [er, why?]
&lt;/ol&gt;

&lt;p&gt;On reflection, I&apos;m thinking to just post the stuff here and not have yet-another-distinct-place/site.&lt;/p&gt;

&lt;p&gt;Readers, what would you prefer?&lt;/p&gt;

&lt;p&gt;&lt;br&gt;&lt;small&gt;(This post is tagged “lisp” solely so that Planet Lisp will pick it up.)&lt;/small&gt;&lt;/p&gt;</description>
  <comments>http://kpreid.livejournal.com/16348.html</comments>
  <category>questions</category>
  <category>thoughts</category>
  <category>meta</category>
  <category>lisp</category>
  <category>web site</category>
  <lj:security>public</lj:security>
  <lj:reply-count>14</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://kpreid.livejournal.com/16079.html</guid>
  <pubDate>Wed, 12 Aug 2009 15:58:02 GMT</pubDate>
  <title>GSoC update: Stuff done, more to do.</title>
  <author>kpreid@mac.com</author>  <link>http://kpreid.livejournal.com/16079.html</link>
  <description>&lt;p&gt;Stuff done:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Implemented &lt;a href=&quot;http://www.eros-os.org/pipermail/e-lang/2009-June/013157.html&quot;&gt;generic literals&lt;/a&gt;. 
&lt;li&gt;Implemented cyclic references in Data-E.
&lt;li&gt;Various cleanup, debugging support, and committing of stuff previously written.
&lt;li&gt;Wrote a wiki page &lt;a href=&quot;http://code.google.com/p/caja-captp/wiki/Architecture&quot;&gt;documenting Caja-CapTP&apos;s major components and files.&lt;/a&gt;
&lt;/ul&gt;

&lt;p&gt;Stuff to do:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Write more documentation/comments.
&lt;li&gt;Commit as much of the work-in-progress as I can.
&lt;ul&gt;&lt;li&gt;...including the incomplete CapTPConnection, even though its tests don&apos;t pass yet, so that the partial work can be counted.&lt;/ul&gt;
&lt;/ul&gt;</description>
  <comments>http://kpreid.livejournal.com/16079.html</comments>
  <category>captp</category>
  <category>e</category>
  <category>programming</category>
  <category>javascript</category>
  <category>gsoc</category>
  <category>gsoc2009</category>
  <category>caps</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://kpreid.livejournal.com/15815.html</guid>
  <pubDate>Wed, 12 Aug 2009 15:48:29 GMT</pubDate>
  <title>Brain-dump for the beginning JavaScript programmer</title>
  <author>kpreid@mac.com</author>  <link>http://kpreid.livejournal.com/15815.html</link>
  <description>&lt;p&gt;A while ago I got the idea to write a “my experiences with JavaScript” post; unfortunately, I’ve forgotten what I was going to put in it. However, yesterday someone said approximately “I need to learn JavaScript in 3 hours, what should I know?”, and I thought of quite a few not-immediately-obvious things to point out.&lt;/p&gt;

&lt;a name=&quot;cutid1&quot;&gt;&lt;/a&gt;
&lt;h3&gt;General&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Beware the bad tutorials.
&lt;li&gt;As far as I know, Mozilla’s &lt;a href=&quot;https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference&quot;&gt;Core JavaScript 1.5 Reference&lt;/a&gt; and &lt;a href=&quot;https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide&quot;&gt;Core JavaScript 1.5 Guide&lt;/a&gt; are not bad. (I start with the former for library/standard objects info, and the latter for language syntax.)
&lt;li&gt;Anything &lt;a href=&quot;http://www.crockford.com/&quot; title=&quot;He invented JSON.&quot;&gt;Crockford&lt;/a&gt; &lt;a href=&quot;http://www.youtube.com/watch?v=hQVTIJBZook&quot;&gt;says&lt;/a&gt; goes.
&lt;li&gt;It’s probably a good idea to use &lt;a href=&quot;http://www.jslint.com/&quot;&gt;JSLint&lt;/a&gt; but I haven’t myself.
&lt;li&gt;If you use Firefox with &lt;a href=&quot;http://getfirebug.com/&quot;&gt;Firebug&lt;/a&gt;, or Safari, write your code to use &lt;a href=&quot;http://getfirebug.com/console.html&quot;&gt;the console object&lt;/a&gt;, &lt;strong&gt;if present&lt;/strong&gt;; it is a very nice tool for your inevitable print-debugging, and Firebug’s version even lets you click on objects shown to inspect them.
&lt;/ul&gt;

&lt;h3&gt;Miscellaneous practice&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Don’t &lt;em&gt;ever&lt;/em&gt; write a busy-wait/polling/delay loop. It won’t work and it&apos;ll waste your users&apos; time. JavaScript in the browser is an event-driven system; use &lt;code&gt;setTimeout&lt;/code&gt; (callback once) and/or &lt;code&gt;setInterval&lt;/code&gt; (callback repeated with specified period) as appropriate. You can write a background loop with setTimeout: &lt;code&gt;function loop() { if (&lt;var&gt;termination condition&lt;/var&gt;) { return; } else { &lt;var&gt;...do something...&lt;/var&gt;; setTimeout(loop, 0); } }; loop();&lt;/code&gt;
&lt;li&gt;Don’t &lt;code&gt;throw &quot;foo&quot;;&lt;/code&gt; but &lt;code&gt;throw new Error(&quot;foo&quot;);&lt;/code&gt; because that gives Firefox, at least, an opportunity to insert call stack information.
&lt;li&gt;JavaScript has two &quot;nothing&quot; values: &lt;code&gt;undefined&lt;/code&gt;, of type &quot;undefined&quot;, and &lt;code&gt;null&lt;/code&gt;, of type &quot;object&quot;. &lt;code&gt;undefined&lt;/code&gt; is returned by failed property lookups and the default return value of functions. &lt;code&gt;null&lt;/code&gt; doesn’t show up much unless you use it, and is useful in your code for distinguishing deliberate absence from an accidental missing value (bug).
&lt;/ul&gt;

&lt;h3&gt;Scope&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Local variables are declared with &quot;&lt;code&gt;var&lt;/code&gt;&quot;, &lt;em&gt;but&lt;/em&gt; they are scoped to the nearest enclosing &lt;em&gt;function&lt;/em&gt;, not the nearest &lt;code&gt;{&lt;/code&gt; block &lt;code&gt;}&lt;/code&gt;!
&lt;li&gt;Functions can be closures. Use this when it’s useful.
&lt;li&gt;Don’t write &lt;code&gt;setTimeout(&apos;foo()&apos;, delay)&lt;/code&gt; (because string-eval is a bad habit), write &lt;code&gt;setTimeout(foo, delay)&lt;/code&gt; or &lt;code&gt;setTimeout(function () { foo() /* for more complicated things */ }, delay)&lt;/code&gt;.
&lt;/ul&gt;

&lt;h3&gt;&lt;code&gt;this&lt;/code&gt;&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Don’t call a user-defined constructor (say, Foo), as &lt;code&gt;Foo()&lt;/code&gt;, only &lt;code&gt;new Foo()&lt;/code&gt;, or it will overwrite global variables instead of creating an object. (&lt;code&gt;new&lt;/code&gt; binds &lt;code&gt;this&lt;/code&gt; to a new object inside the function; a regular call leaves it as the global object.)
&lt;li&gt;&lt;code&gt;foo.bar()&lt;/code&gt; is the same as &lt;code&gt;(foo.bar)()&lt;/code&gt;, and &lt;strong&gt;is not&lt;/strong&gt; the same as &lt;code&gt;var x = foo.bar; x()&lt;/code&gt;. The former binds &lt;code&gt;this&lt;/code&gt; inside the function to the &lt;code&gt;foo&lt;/code&gt; object; the latter &lt;strong&gt;does not&lt;/strong&gt;.
&lt;/ul&gt;

&lt;h3&gt;Properties and variables&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;for (x in y) ...&lt;/code&gt; does not do what you might first expect; it iterates over all properties of the object, &lt;em&gt;even inherited ones&lt;/em&gt;.
&lt;li&gt;If you see &lt;code&gt;$(&apos;foo&apos;)&lt;/code&gt;: That is not some magic new operator. &lt;code&gt;$&lt;/code&gt; &lt;em&gt;is an identifier character.&lt;/em&gt; That expression &lt;em&gt;is a function call&lt;/em&gt;. From what I hear, both &lt;a href=&quot;http://www.prototypejs.org/&quot;&gt;Prototype&lt;/a&gt; and &lt;a href=&quot;http://jquery.com/&quot;&gt;jQuery&lt;/a&gt; define functions named &lt;code&gt;$&lt;/code&gt;.
&lt;li&gt;&lt;code&gt;foo.bar&lt;/code&gt; is exactly equivalent to &lt;code&gt;foo[&quot;bar&quot;]&lt;/code&gt;.
&lt;li&gt;&lt;code&gt;foo.bar&lt;/code&gt; returns &lt;code&gt;undefined&lt;/code&gt; if &lt;code&gt;bar&lt;/code&gt; is not a property of &lt;code&gt;foo&lt;/code&gt;; &lt;code&gt;bar&lt;/code&gt; &lt;em&gt;throws an error&lt;/em&gt; if &lt;code&gt;bar&lt;/code&gt; is not a property of whatever the environment is. So if you’re doing browser feature detection, you write code like &lt;code&gt;if (window.console)&lt;/code&gt;, not &lt;code&gt;if (console)&lt;/code&gt;, even though &lt;code&gt;window&lt;/code&gt; is the global object and its properties are variables.
&lt;/ul&gt;

&lt;h3&gt;Numbers&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;All numbers are double-floats, &lt;strong&gt;not integers&lt;/strong&gt;. They can exactly represent integers up to &lt;a href=&quot;http://groups.google.com/group/google-caja-discuss/browse_thread/thread/b88716e1bd39d10f/79f535f80f87661d?lnk=gst&amp;amp;q=enforceNat#79f535f80f87661d&quot;&gt;about 2&lt;sup&gt;53&lt;/sup&gt;&lt;/a&gt;, but you should still &lt;a href=&quot;http://docs.sun.com/source/806-3568/ncg_goldberg.html&quot; title=&quot;What Every Computer Scientist Should Know About Floating-Point Arithmetic&quot;&gt;keep the nature of floating-point arithmetic in mind&lt;/a&gt;.
&lt;li&gt;The &lt;code&gt;==&lt;/code&gt; operator does a scary number of implicit conversions; use &lt;code&gt;===&lt;/code&gt; unless you know &lt;code&gt;==&lt;/code&gt; does what you want.
&lt;ul&gt;&lt;li&gt;Even &lt;code&gt;===&lt;/code&gt; compares floats according to IEEE floating point numeric comparison; this means that &lt;code&gt;NaN !== NaN&lt;/code&gt;.&lt;/ul&gt;
&lt;/ul&gt;
</description>
  <comments>http://kpreid.livejournal.com/15815.html</comments>
  <category>programming</category>
  <category>javascript</category>
  <category>gsoc</category>
  <category>gsoc2009</category>
  <lj:security>public</lj:security>
  <lj:reply-count>3</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://kpreid.livejournal.com/15607.html</guid>
  <pubDate>Sat, 08 Aug 2009 19:56:04 GMT</pubDate>
  <title>GSoC update: Yes, you may change it.</title>
  <author>kpreid@mac.com</author>  <link>http://kpreid.livejournal.com/15607.html</link>
  <description>&lt;p&gt;Had a bit of a breakthrough in debugging facilities: realizing that there&apos;s no reason I shouldn&apos;t modify my local copy of the &lt;a href=&quot;http://code.google.com/p/google-caja/wiki/CajaLexicon&quot;&gt;Cajita&lt;/a&gt; runtime to provide more debug information (and it doesn&apos;t matter if it subtly breaks security, even, as long as &lt;a href=&quot;http://code.google.com/p/caja-captp/&quot;&gt;Caja-CapTP&lt;/a&gt; is still compatible with the proper version).&lt;/p&gt;

&lt;p&gt;Only a week or so left. I&apos;ve discussed the matter with MarkM, and he pointed out (again) that I should work toward having useful-to-other-people components even if I haven&apos;t finished the one I intended to do.&lt;/p&gt;

&lt;p&gt;Toward this end, I am going to work on Data-E (which is already part of the Caja-CapTP project) as a standalone serialization utility (for network and disk) as I understand it will be useful for &lt;a href=&quot;http://groups.google.com/group/google-caja-discuss/browse_thread/thread/e77039c248ee561/85db73be431b725c&quot;&gt;Shakhar&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Todo items:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Implement generic literals (&lt;a href=&quot;http://www.eros-os.org/pipermail/e-lang/2009-June/013157.html&quot;&gt;description&lt;/a&gt;) to make it more JavaScript-natural.
&lt;li&gt;Implement cyclic object graph handling using Ref promise implementation already done.
&lt;li&gt;Commit all in-progress work as reasonable changesets (even the tests that don&apos;t yet pass).
&lt;li&gt;Document what works, design decisions, etc.
&lt;li&gt;Continue to work on CapTP itself as time permits.
&lt;/ul&gt;

&lt;p&gt;I intend to continue working on the Caja-CapTP project beyond GSoC; both simply because it is a project of mine, and to mitigate my failure to complete the planned work on schedule. However, for the next few months it will have to compete with my college work rather than my procrastination.&lt;/p&gt;</description>
  <comments>http://kpreid.livejournal.com/15607.html</comments>
  <category>captp</category>
  <category>e</category>
  <category>programming</category>
  <category>javascript</category>
  <category>gsoc</category>
  <category>gsoc2009</category>
  <category>caps</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://kpreid.livejournal.com/15296.html</guid>
  <pubDate>Sun, 02 Aug 2009 18:10:35 GMT</pubDate>
  <title>Want to write some miscellanous Common Lisp code?</title>
  <author>kpreid@mac.com</author>  <link>http://kpreid.livejournal.com/15296.html</link>
  <description>&lt;p&gt;&lt;a href=&quot;http://rosettacode.org/wiki/&quot;&gt;Rosetta Code&lt;/a&gt; is a wiki where a variety of programming problems and language features are demonstrated in many languages, allowing language learning and comparison of features and paradigms.&lt;/p&gt;

&lt;p&gt;If you&apos;d like to contribute Common Lisp code to the project, I&apos;ve just completed a &lt;a href=&quot;http://rosettacode.org/wiki/User:Kevin_Reid/Common_Lisp_tasks&quot;&gt;classification of tasks&lt;/a&gt; in CL (like &lt;a href=&quot;http://rosettacode.org/wiki/User:Kevin_Reid/E_tasks&quot;&gt;my prior one for E&lt;/a&gt;), so that it&apos;s easy to find the kind of problem one wants to work on at the moment.&lt;/p&gt;

&lt;p&gt;One thing I find interesting about working on Rosetta Code is that many tasks bring with them some particular perspective — someone&apos;s notion of how programming necessarily works — and it can be a challenge to figure out the analogous way, or best way, to do it in &lt;em&gt;your&lt;/em&gt; language is, and then explain it.&lt;/p&gt;</description>
  <comments>http://kpreid.livejournal.com/15296.html</comments>
  <category>programming</category>
  <category>rosettacode</category>
  <category>lisp</category>
  <lj:security>public</lj:security>
  <lj:reply-count>6</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://kpreid.livejournal.com/14890.html</guid>
  <pubDate>Mon, 13 Jul 2009 13:33:56 GMT</pubDate>
  <title>GSoC update: Hurry up and procrastinate.</title>
  <author>kpreid@mac.com</author>  <link>http://kpreid.livejournal.com/14890.html</link>
  <description>&lt;p&gt;I&apos;m having severe getting-around-to-actually-doing-the-work problems; I am far behind schedule. I think the problem is framing this as “work” rather than just another of the projects that I&apos;ve found interesting and tinkered with. (I also blame &lt;a href=&quot;http://store.steampowered.com/app/440/&quot;&gt;Team Fortress 2&lt;/a&gt; and &lt;a href=&quot;http://rosettacode.org/&quot;&gt;Rosetta Code&lt;/a&gt; for providing attractive distractions...)&lt;/p&gt;

&lt;p&gt;I&apos;ve ported the “&lt;a href=&quot;http://wiki.erights.org/wiki/Ref&quot;&gt;Ref&lt;/a&gt;” facility from E; this is necessary as CapTP is built on Ref semantics (promises, proxies, broken refs). I hope to very soon get the actual CapTP connection module up, then (as I wrote before) “define, document and implement a CapTP-over-HTTP protocol”.&lt;/p&gt;

&lt;p&gt;(I previously mentioned implementing the Surgeon (serialization tool) but I then remembered that that&apos;s actually irrelevant to CapTP.)&lt;/p&gt;

&lt;p&gt;Also: working without Internet access removes a whole lot of potential distractions — and one’s access to online documentation. Luckily I had some source code around which provided examples.&lt;/p&gt;</description>
  <comments>http://kpreid.livejournal.com/14890.html</comments>
  <category>captp</category>
  <category>e</category>
  <category>programming</category>
  <category>javascript</category>
  <category>gsoc</category>
  <category>gsoc2009</category>
  <category>caps</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://kpreid.livejournal.com/14713.html</guid>
  <pubDate>Mon, 13 Jul 2009 13:09:44 GMT</pubDate>
  <title>Common Lisp hackery: writing fasls from non-file input</title>
  <author>kpreid@mac.com</author>  <link>http://kpreid.livejournal.com/14713.html</link>
  <description>

&lt;p&gt;Common Lisp provides &lt;a href=&quot;http://www.lispworks.com/documentation/HyperSpec/Body/f_cmp_fi.htm&quot; title=&quot;CLHS: Function COMPILE-FILE&quot;&gt;compile-file&lt;/a&gt; whose purposes is to convert a CL source file into an (implementation-defined) format which usually has precompiled code and is designed for faster loading into a lisp system.&lt;/p&gt;

&lt;p&gt;compile-file takes the pathname of a textual lisp source file. But what if you want to compile some Lisp code that&apos;s not in a file already, perhaps because you translated/compiled it from some not-amenable-to-the-Lisp-reader input syntax, or because it contains un&lt;a href=&quot;http://www.lispworks.com/documentation/HyperSpec/Body/f_rd_rd.htm&quot; title=&quot;CLHS: Function READ, READ-PRESERVING-WHITESPACE&quot;&gt;READ&lt;/a&gt;able literals? You can use a &quot;universal Lisp file&quot;, which I know two ways to create (use whichever you find cleaner):&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;(cl:in-package :mypackage)
#.mypackage::*program*&lt;/pre&gt;&lt;/blockquote&gt;

or

&lt;blockquote&gt;&lt;pre&gt;(cl:in-package :mypackage)
(macrolet ((it () *program*))
  (it))&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Suppose this is in &quot;universal.lisp&quot;. Then to use it:&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;(defvar *program*)

(defun compile-to-file (form output-file)
  (let ((*program* form))
    (compile-file #p&quot;universal.lisp&quot;
                  :output-file output-file)))&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;This is just a minimal example; you&apos;ll also want to appropriately handle the return value from compile-file, provide an appropriate pathname to the universal file, etc. For example, here&apos;s an excerpt of the relevant code from &lt;a href=&quot;http://wiki.erights.org/wiki/E-on-CL&quot; title=&quot;E on Common Lisp&quot;&gt;E-on-CL&lt;/a&gt;, where I have used this technique to compile non-CL sources (emakers) into fasls:&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;
(defparameter +the-asdf-system+ (asdf:find-system :e-on-cl))
(defvar *efasl-program*)
(defvar *efasl-result*)
...
(defun compile-e-to-file (expr output-file fqn-prefix opt-scope)
  ...
  (let* (...
         (*efasl-program*
           `(setf *efasl-result*
                  (lambda (...) ...))))
    (multiple-value-bind (truename warnings-p failure-p)
        (compile-file (merge-pathnames
                        #p&quot;lisp/universal.lisp&quot;
                        (asdf:component-pathname +the-asdf-system+))
                      :output-file output-file
                      :verbose nil
                      :print nil)
      (declare (ignore truename warnings-p))
      (assert (not failure-p) () &quot;Compilation for ~A failed.&quot; output-file))))

(defun load-compiled-e (file env)
  (let ((*efasl-result* nil)
        ...)
    (load file :verbose nil :print nil)
    (funcall *efasl-result* env)))
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Note that the pathname is computed relative to the &lt;a href=&quot;http://www.cliki.net/asdf&quot; title=&quot;CLiki : asdf&quot;&gt;ASDF&lt;/a&gt; system containing the universal file; also note the use of a variable *efasl-result* to simulate a &quot;return value&quot; from the compiled file, and the use of a lambda to provide a nonempty lexical environment, both of which are features not directly provided by the CL compiled file facility.&lt;/p&gt;</description>
  <comments>http://kpreid.livejournal.com/14713.html</comments>
  <category>e</category>
  <category>programming</category>
  <category>lisp</category>
  <category>e-on-cl</category>
  <lj:security>public</lj:security>
  <lj:reply-count>3</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://kpreid.livejournal.com/14573.html</guid>
  <pubDate>Sun, 14 Jun 2009 04:37:10 GMT</pubDate>
  <title>Web site moved; feedback wanted</title>
  <author>kpreid@mac.com</author>  <link>http://kpreid.livejournal.com/14573.html</link>
  <description>&lt;p&gt;I have moved my web site to a new location: &lt;a href=&quot;http://switchb.org/kpreid/&quot;&gt;http://switchb.org/kpreid/&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I have done this because Apple has announced they are shutting down homepage.mac.com. While they offer a replacement, I do not want to have to change my URLs ever again, so I bought a domain name.&lt;/p&gt;

&lt;p&gt;As well as moving the files I have updated my picture, changed some of the URL layout, updated some miscellaneous information, added an “About me” section for the front page, and fixed broken external links. Please let me know if I missed anything...&lt;/p&gt;

&lt;p&gt;or even just critique it without respect to what&apos;s new.&lt;/p&gt;</description>
  <comments>http://kpreid.livejournal.com/14573.html</comments>
  <category>life</category>
  <category>web site</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://kpreid.livejournal.com/14259.html</guid>
  <pubDate>Tue, 02 Jun 2009 18:52:11 GMT</pubDate>
  <title>GSoC update: Going both ways.</title>
  <author>kpreid@mac.com</author>  <link>http://kpreid.livejournal.com/14259.html</link>
  <description>&lt;p&gt;I&apos;m not making progress as fast as I would like; mostly due to assorted distractions rather than Doing The Work.&lt;/p&gt;

&lt;p&gt;That said, I&apos;ve gotten both ends of serialization implemented, at least for non-circular cases: the deJSONTreeKit and deSubgraphKit have both builder and recognizer implementations. (For a terminology introduction, see &lt;a href=&quot;http://www.erights.org/data/serial/jhu-paper/deconstructing.html&quot;&gt;the serialization paper&lt;/a&gt;.)&lt;/p&gt;

&lt;p&gt;Next up is the surgeon (high-level serialization interface), and designing uncallers suitable for JavaScript. I definitely need to increase my rate of progress to get this done on schedule.&lt;/p&gt;</description>
  <comments>http://kpreid.livejournal.com/14259.html</comments>
  <category>captp</category>
  <category>e</category>
  <category>programming</category>
  <category>javascript</category>
  <category>gsoc</category>
  <category>gsoc2009</category>
  <category>caps</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://kpreid.livejournal.com/13956.html</guid>
  <pubDate>Sat, 30 May 2009 03:58:06 GMT</pubDate>
  <title>GSoC update: It runs!</title>
  <author>kpreid@mac.com</author>  <link>http://kpreid.livejournal.com/13956.html</link>
  <description>&lt;p&gt;I completed enough of &lt;a href=&quot;http://kpreid.livejournal.com/13814.html&quot;&gt;the E-on-JavaScript improvements&lt;/a&gt;, and wrote the beginnings of one Data-E kit in Cajita, together with the Updoc tests for it, and a Makefile to &lt;a href=&quot;http://code.google.com/p/google-caja/wiki/CajaCajole&quot;&gt;cajole&lt;/a&gt; the JavaScript and &quot;animate&quot; the Updoc - convert it into a HTML page that actually runs the tests.&lt;/p&gt;

&lt;p&gt;I also improved various readme files and pages, hopefully such that someone else can get it all installed on their own system starting from &lt;a href=&quot;http://code.google.com/p/caja-captp/&quot;&gt;my project page&lt;/a&gt; without too much prior knowledge.&lt;/p&gt;

&lt;p&gt;Near-term plan: Put aside the EoJS, and get the Data-E kits working; then the surgeon; then the CapTPConnection; then define, document and implement a CapTP-over-HTTP protocol.&lt;/p&gt;</description>
  <comments>http://kpreid.livejournal.com/13956.html</comments>
  <category>captp</category>
  <category>e</category>
  <category>programming</category>
  <category>javascript</category>
  <category>gsoc</category>
  <category>gsoc2009</category>
  <category>caps</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
</channel>
</rss>
