<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Aaron Feng</title>
    <link>http://aaronfeng.com/</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Adventures in software development</description>
    <item>
      <title>Learning from io</title>
      <description>&lt;p&gt;&lt;a href="http://www.iolanguage.com/"&gt;io&lt;/a&gt; is a small, prototype based, dynamic programming language that is inspired by Smalltalk, Self, NewtonScript, Act1, LISP, and Lua.  Need I say more?  It has a very useful feature that any programmer can appreciate: the "?"&lt;/p&gt;

&lt;p&gt;It's very common to want to check the existence of an object before accessing it.&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;if offer != nil
  offer.price
end&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;offer &amp;amp;&amp;amp; offer.price&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;It gets even more tedious when you also need to traverse a couple objects deep. &lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;offer &amp;amp;&amp;amp; offer.price &amp;amp;&amp;amp; offer.price.formatted_amount&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Littering the "check" around the code can quickly cloud up the intention of the code.  In io, you can do the following:&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;offer ?price
offer ?price ?formatted_amount&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;No more checking!  However, I want to do that in ruby.  An obvious solution is to open up the nil class and re-implement the method_missing to return nil.  This is a very bad idea, since it applies to ALL objects in the system.  It can hide serious errors within the application and make debugging very difficult.  A better solution is to the following:&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;class Object
  def _?()
    self
  end
end

class NilClass
  def _?()
    SafeNil.new
  end
end

class SafeNil
  def method_missing(*args, &amp;amp;b)
    nil.send(*args, &amp;amp;b) rescue nil
  end
end&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The above code is taken from this &lt;a href="http://hobocentral.net/blog/2007/08/25/quiz/"&gt;post&lt;/a&gt; The post didn't mention io, but I assumed it is inspired by it.  In ruby you can't just use the "?" for your method name, therefore, _ is prepended before "?".Now you can do following without checking the parent object:&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;offer._?.price._?.formatted_amount&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;if offer or price is nil, nil is returned.&lt;/p&gt;</description>
      <pubDate>Wed, 24 Sep 2008 23:09:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:c3dae810-320e-4500-9f40-e72d50041b26</guid>
      <author>Aaron Feng</author>
      <link>http://aaronfeng.com/articles/2008/09/24/learning-from-io</link>
      <category>ruby</category>
      <category>programming</category>
    </item>
    <item>
      <title>Software Development Meme</title>
      <description>&lt;p&gt;Apparently I was tagged by &lt;a href="http://iqueryable.com/2008/07/25/SoftwareDevelopmentMeme.aspx"&gt;Steve Eichert&lt;/a&gt; one month ago and I just noticed now.
Not only I have been hibernating from writing blog posts, but I also have not had time to
read them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How old were you when you first started programming?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Freshman in college.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How did you get started in programming?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I was always into computers growing up, so it was a natural choice.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What was your first language?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Pascal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What was the first real program you wrote?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I worked on a Star Trek adventure game in my senior year in college.  I don't remember too much about it except that there wasn't much guide lines around it.  The goal was making something interesting and to have fun doing it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What languages have you used since you started programming?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;C/C++, C#, Java, Javascript, Lisp, Ruby&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What was your first professional programming gig?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If professional means that I got paid for it... and if shell scripting is considered to be programming...  Once upon a time, I worked as an &lt;a href="http://www-03.ibm.com/systems/p/os/aix/index.html"&gt;AIX&lt;/a&gt; Unix Admin and wrote shell scripts to automate mundane, but critical, daily tasks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you knew then what you know now, would you have started programming?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Fo-sho.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If there is one thing you learned along the way that you would tell new developers, what would it be?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Focus on the basics.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What's the most fun you've ever had ... programming?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is really hard for me because I enjoy programming in general.  Of course, at times it can get tedious, but overall I find it fun to be able to create things.  If I had to pick one I would say the side project I'm working on  right now.  I don't want to get into the details  right now, but it's a rails app that consumes amazon's web service.   &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Who’s next?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blog.viridian-project.de/"&gt;Leslie Polzer&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 31 Aug 2008 22:24:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:fdb852d6-fe56-49d6-89ba-dce37ac2346b</guid>
      <author>Aaron Feng</author>
      <link>http://aaronfeng.com/articles/2008/08/31/software-development-meme</link>
      <category>programming</category>
    </item>
    <item>
      <title>Data recovery part 1: Freeze the dead hard drive</title>
      <description>&lt;p&gt;&lt;img src="http://www.aaronfeng.com/files/frozen_hard_drive.jpg" alt="frozen&lt;em&gt;hard&lt;/em&gt;drive"/&gt;&lt;/p&gt;

&lt;p&gt;I am sad to say that the hard drive in my Macbook died a few days ago.  When I boot up the laptop all I see is a blinking folder with a question mark on it which means that it can't find necessary files to startup up the OS.  I tried to run the Disk Utility from the OSX install CD, but the hard drive isn't even mounted.  To make matters worse, the last backup I had was from 2 months ago.  &lt;/p&gt;

&lt;p&gt;Right before the hard drive crash I was just starting to gain some momentum on my side project.  Now everything is gone, including my motivation.&lt;/p&gt;

&lt;p&gt;I poked around &lt;a href="http://discussions.apple.com/index.jspa"&gt;Apple Discussions&lt;/a&gt; and found out a lot of people are having similar hard drive problems.  Some people were able to retrieve their data by sending the hard drive out to a data recovery service.  I called one and I realized I'm in the wrong business!  The price ranges from $1500 to $2000 if the data can be recovered.&lt;/p&gt;

&lt;p&gt;In disbelief, I went to the all knowing god, Google, for answers.  I came across a couple sites that have claimed success on temporarily "fixing" a dead hard drive by putting the entire drive in the freezer for a few hours.  Supposedly this will allow the hard drive to function for 10 to 30 minutes depending on the condition of the drive.  Sounds pretty bogus to me, but desperate time calls for desperate measures.  I have nothing to loose, so I decided to give it a go.&lt;/p&gt;

&lt;p&gt;I sealed the hard drive in a couple zip lock bags and left it in the freezer for 3 hours then I stuck it back into my laptop.  I boot up the Macbook with the frozen drive, hoping it would buy me enough time to backup a few items.  Just a few seconds into the boot process, I see the blinking folder with the question mark again.  I repeated the process a couple of times without any success. &lt;/p&gt;

&lt;p&gt;Freezing the hard drive is only my first attempt on recovering the data.  I purchased an identical hard drive from ebay and am hoping to repair it by swapping out parts.  More to come in the next post.  Before I go, I just want to say If you haven't been backing up your data recently, DO IT NOW!&lt;/p&gt;</description>
      <pubDate>Thu, 31 Jul 2008 08:30:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:bd7fa0ee-e759-4d9e-889a-c09965e4815e</guid>
      <author>Aaron Feng</author>
      <link>http://aaronfeng.com/articles/2008/07/31/data-recovery-part-1-freeze-the-dead-hard-drive</link>
      <category>mac</category>
    </item>
    <item>
      <title>Closure Fun</title>
      <description>&lt;p&gt;PHP has a string tokenizing function called &lt;a href="http://us2.php.net/strtok"&gt;strtok&lt;/a&gt; that has an interesting interface compared to many languages.  What makes strtok function interesting is that creating the tokenizer and generating tokens utilize the same function.   For example:&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;$tok = strtok(&amp;quot;closure fun&amp;quot;, &amp;quot;  &amp;quot;);

while ($tok !== false) {
    echo &amp;quot;$tok\n&amp;quot;;
    $tok = strtok(&amp;quot;  &amp;quot;);
}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The code above tokenizes the input string by a space, and outputs each token on a newline.  What makes this function interesting is the ability to maintain state!  I don't know what happens under the hood, but it appears to "remember" the input string after the tokenizer has been created.  This behavior can be easily mimicked by using a &lt;a href="http://en.wikipedia.org/wiki/Closure_(computer_science)"&gt;closure variable&lt;/a&gt;.  Below is an implementation in lisp:&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;(let ((rest nil))
  (defun strtok (string &amp;amp;optional (token nil token-supplied-p))
    (check-type string string)
    (when token-supplied-p (check-type token string))

    (when (and string token) (setf rest string))
    (let ((items nil)
          (output nil))
      (loop until (or (null rest)) do
           (setf items (cl-ppcre:split 
                        (funcall (lambda () (if token token string)))
                        rest 
                        :limit 2)) 
           (setf output (first items))
           (setf rest (second items))

           (when (not (string= output &amp;quot;&amp;quot;)) 
             (return-from strtok output))))))&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The "rest" variable outside of the function declaration is the closure variable.  The "rest" is in fact invisible to the outside world, and it allows the function to maintain state!&lt;/p&gt;</description>
      <pubDate>Mon, 30 Jun 2008 19:52:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:5c3807cb-2dff-4236-8050-0aca1d58d74b</guid>
      <author>Aaron Feng</author>
      <link>http://aaronfeng.com/articles/2008/06/30/closure-fun</link>
      <category>programming</category>
    </item>
    <item>
      <title>Lisp ninja 2 - Refactoring</title>
      <description>&lt;p&gt;&lt;a href="http://aaronfeng.com/articles/2008/04/29/lisp-ninja"&gt;Last post&lt;/a&gt; I talked about creating an abstraction using Lisp macros to  assist me with my unit tests.  If you look at the code, there is an obvious flaw.  get-result-for-test-case hard codes the target PHP function in it.  It wouldn't be very nice to rewrite a new version of it every time I need to call a different PHP function.&lt;/p&gt;

&lt;p&gt;In the original code from last post, the target PHP function was defined in string format.  Since I'm working in Lisp I would prefer to define it in sexp format to gain the most flexibility.  For example, calling the explode function in PHP would look like the following:&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;(explode &amp;quot; &amp;quot; &amp;quot;aaron feng&amp;quot;)&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Let's start the refactoring:&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;; helper function
(defun quote-string (input)
  (if (typep input 'string)
    (format nil &amp;quot;\&amp;quot;~a\&amp;quot;&amp;quot; input)
    input))

(defun get-function-signature (function-info)
  (let ((function (first function-info))
        (parameters (rest function-info))
        (signature &amp;quot;&amp;quot;) 
        (delimiter &amp;quot;&amp;quot;))
    (setf signature (format nil &amp;quot;~a~a&amp;quot; function &amp;quot;(&amp;quot;))

    (loop for parameter in parameters do
         (setf signature (format nil &amp;quot;~a~a~a&amp;quot; 
                                 signature
                                 delimiter 
                                 (quote-string parameter)))
         (setf delimiter &amp;quot;, &amp;quot;))

    (setf signature (format nil &amp;quot;~a~a&amp;quot; signature &amp;quot;)&amp;quot;))))&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;get-function-signature does all the dirty work by converting input function in sexp format to a string that we can eventually send to PHP.  Let's incorporate this function back into get-result-for-test-case, so it can accept other functions.&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;(defun get-result-for-test-case (func-info)
  (with-output-to-string (str)
    (let ((func-string
           (concatenate 'string &amp;quot;print_r(&amp;quot; (get-function-signature func-info) &amp;quot;);&amp;quot;)))
      (run-program *php-bin* (list
                              &amp;quot;-r&amp;quot;
                              func-string)
                   :output str))))&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;With these changes, it will make get-result-for-test-case much more generic.  However, there is another problem, not all PHP functions return a string.  If the function returns an array, the output will always be "Array".  It would be nice if it could convert PHP array back into Lisp list, so it can be used for comparison in the tests.  That is exactly what I'm going to do next.  Notice that I replaced the "echo" with "print_r", so it will output human readable values for data structure such as array.  &lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;(defun parse-php-array (array)
  (let ((parts (split-sequence #\Newline array))
        (output))
    (dolist (part parts)
      (let ((value (get-array-value part)))
        (format t &amp;quot;~a&amp;quot; part)
        (when value (push value output))))
    (reverse output)))&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now if I wrap get-result-for-test-case with parse-php-array, it should convert the output into a Lisp list.&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;(parse-php-array (get-result-for-test-case `(explode &amp;quot; &amp;quot; &amp;quot;aaron feng&amp;quot;)))&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Of course, more work can be done to make the code more intelligent, such as, only try to parse array if the output is an array type.  Currently the code can only handle Array and String as return type, but it can be extended further if desired.&lt;/p&gt;</description>
      <pubDate>Sat, 31 May 2008 23:01:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:ba0bad02-af28-44c9-af4e-faf52510a1ca</guid>
      <author>Aaron Feng</author>
      <link>http://aaronfeng.com/articles/2008/05/31/lisp-ninja-2-refactoring</link>
      <category>programming</category>
    </item>
    <item>
      <title>Lisp ninja</title>
      <description>&lt;p&gt;It's not hard to get caught up on cranking out code when you are in the zone.  All of the unit tests are passing one after another, and the implementation just flows out from your finger tips.  There's no need to stop, step back and question the work because everything feels so right.  Situations like this can really hinder your ability to unleash the power of your language.  Especially if Lisp is your language of choice.  After all, Lisp is the official programmable programming language.&lt;/p&gt;

&lt;p&gt;This recently happened to me.  I have been working on a side project (I'll talk about it in later post) that required me to implement string functions in Common Lisp that are similar, in spirit, to ones found in PHP.  Since I'm a huge fan of TDD, I  started with a failing test.  However, before the failing test can be written, I need to confirm the actual behavior in PHP.  During my the implementation cycle, I toggled back and forth between PHP and Lisp.  This can get tedious over time, but I just kept chugging along.&lt;/p&gt;

&lt;p&gt;This morning &lt;a href="http://kyle-burton.livejournal.com/"&gt;Kyle Burton&lt;/a&gt; showed me the light.  He sent me a few pieces of code that remove the tediousness from my implementation cycle.  I adopted the code to fit my environment and the testing framework.  Without further adieu:&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;(defparameter *php-bin* &amp;quot;/opt/local/bin/php&amp;quot;)

(when (not (probe-file *php-bin*))
  (error 
   &amp;quot;Error: %s was not found, please update *php-bin* to point to your php.&amp;quot; 
   *php-bin*))

(defun get-result-for-test-case (instr 
                 &amp;amp;optional (width 75) 
                 (lbreak #\Newline) 
                 (cut nil))
  (with-output-to-string (str)
    (run-program *php-bin* (list 
                &amp;quot;-r&amp;quot; 
                (format nil &amp;quot;echo wordwrap(\&amp;quot;~a\&amp;quot;,~a,\&amp;quot;~a\&amp;quot;,~a);&amp;quot;
                    instr
                    width
                    lbreak
                    (if cut &amp;quot;true&amp;quot; &amp;quot;false&amp;quot;)))
         :output str)))

(get-result-for-test-case &amp;quot;aaron feng&amp;quot; 3)&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I was executing PHP code externally just to get the output, so I can use it in my unit tests.  Why not ask PHP from Lisp!  &lt;/p&gt;

&lt;p&gt;The last line calls get-result-for-test-case function which calls the PHP wordwrap function directly and returns the result.  Now this removed the need for me having to go outside my Lisp environment while I'm hacking.  Why stop here?  Why not have a macro that generates the test case using the result from PHP?&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;(defmacro create-test-case (test-name string &amp;amp;optional (width 75)
                (lbreak #\Newline) (cut nil))
  `(addtest ,test-name
       (let ((input ,string)
         (expected ,(get-result-for-test-case string width lbreak cut)))
     (ensure-same (wordwrap input ,width ,lbreak ,cut) expected))))

(create-test-case empty-string &amp;quot;   &amp;quot; 4)&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Voila, instant test case.  the last line shows how the test case can be generated on the fly and run.  If you are a real ninja, you need to take one more step further.&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;(defmacro create-test-cases (&amp;amp;rest cases)
 `(prog2
      (deftestsuite wordwrap-suite () ())
      ,@(mapcar #'(lambda (case) (macroexpand-1 `(create-test-case
,@case))) cases)))

(create-test-cases
                (empty-string1       &amp;quot;   &amp;quot;)
                (empty-string2       &amp;quot;   &amp;quot; 4)
                (no-wrap             &amp;quot;foo&amp;quot;)
                (wrap-one-word-at-1  &amp;quot;foo&amp;quot; 1))&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;create-test-cases creates a testing suite to host all the test cases then it generates test cases based on input.  This takes WAY LESS typing than hand writing each test case.  I no longer have to switch between two environments (PHP and Lisp) because it's all automatically done for me!  Thanks Kyle!&lt;/p&gt;</description>
      <pubDate>Tue, 29 Apr 2008 22:27:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:282ea714-3797-4b72-984d-85a97ce39b8b</guid>
      <author>Aaron Feng</author>
      <link>http://aaronfeng.com/articles/2008/04/29/lisp-ninja</link>
      <category>programming</category>
    </item>
    <item>
      <title>Lisp has no syntax.  Lisp has no parentheses.  Lisp as no lists.</title>
      <description>&lt;p&gt;Lisp is often viewed as strange in syntax and parentheses centric language that only thing it cares about is processing lists.  After all, the name is derived from LISt Processing (LISP).  But it couldn't be more wrong!&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.informatimago.com/"&gt;Pascal Bourguignon&lt;/a&gt; has a great post on the lisp mailing explain why &lt;a href="http://groups.google.com/group/comp.lang.lisp/msg/6ec4dab4a8d57f6e"&gt;Lisp has no syntax.  Lisp has no parentheses.  Lisp as no lists&lt;/a&gt;.  For the lazy readers, who don't want to click on the link, I'll give a simple break down of the Bourguignon's post.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lisp has no syntax&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Anyone with knowledge of how a &lt;a href="http://en.wikipedia.org/wiki/Compiler"&gt;compiler&lt;/a&gt; works would know that the job of a parser is to create a parse tree.  The parser has knowledge of the syntax of the language so it can transform tokens from the source code into a tree structure.  The reason Lisp doesn't have a concrete syntax is because the source code is in parse tree syntax.  A parse tree can be represented in many formats.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lisp has no parentheses&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In lisp, a list is constructed by placing elements in the list between parentheses and leading the first parenthesis with a single quote.  For example '(a b c).  Internally lisp doesn't store or know anything about parentheses.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lisp has no list&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Lisp has no list type.  List is an abstraction on top of the CONS cells.  A CONS cell is equivalent to a node in a link list.  It has two pointers; one points to data and other points to the next node or nil.&lt;/p&gt;

&lt;p&gt;I've only covered each point superficially, but Bourguignon's post contains a lot more details.&lt;/p&gt;</description>
      <pubDate>Sun, 27 Apr 2008 23:49:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:ee2d81b5-fad6-4e8b-a8c6-cfa4cb571094</guid>
      <author>Aaron Feng</author>
      <link>http://aaronfeng.com/articles/2008/04/27/lisp-has-no-syntax-lisp-has-no-parentheses-lisp-as-no-lists</link>
      <category>programming</category>
    </item>
    <item>
      <title>Lisp newbie jump start</title>
      <description>&lt;p&gt;Many that are close to me have noticed my new obsession with a language that was invented in 1958: Lisp.  I don't think there has been a day that goes by that I don't make some kind of reference to Lisp.  The more I read about Lisp, the more mind blowing it is to me that most people don't use it.  I understand Lisp may be an acquired taste, but there are many interesting concepts/features that can impact one's thinking even when they are not using Lisp.  &lt;/p&gt;

&lt;p&gt;Everyone complains about the parentheses.  Please complain about something original.  To tell you the truth, after a couple of weeks, you won't even see the parens anymore.  You don't have to be a genius to do it, trust me, I'm definitely not one.&lt;/p&gt;

&lt;p&gt;With that said, I would like to recommend three books that have helped me gain an understanding of Lisp.  Best of all, they are all free!  The only cost is your time, and desire to learn.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.gigamonkeys.com/book/"&gt;Practical Common Lisp By Peter Siebel&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.cs.cmu.edu/~dst/LispBook/index.html"&gt;Common Lisp : A Gentle Introduction to Symbolic Computation By David S. Touretzky&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.paulgraham.com/onlisp.html"&gt;On Lisp By Paul Graham&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you don't want to pull your hair out, I would suggest you read "On Lisp" last as it contains many advanced topics.  It doesn't matter which order you read the other two books.  They require no previous Lisp experience.  The book by Touretzky is actually targeted for people with no programming experience at all, but I found it useful just to skim through real fast.&lt;/p&gt;

&lt;p&gt;What are you still doing here?  Click on the links and start reading!&lt;/p&gt;</description>
      <pubDate>Mon, 07 Apr 2008 23:46:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:f0d34162-c310-442f-b390-edb248062174</guid>
      <author>Aaron Feng</author>
      <link>http://aaronfeng.com/articles/2008/04/07/jump-start-in-lisp</link>
      <category>books</category>
      <category>programming</category>
    </item>
    <item>
      <title>Busy Apple</title>
      <description>&lt;p&gt;Yesterday was the grand opening of the second Apple store in my area.  I was out and about, so I decided to stop by the store around the opening time: 10 am.  I have never been to a grand opening of an Apple store before, and to my surprise, there were tons of people waiting in line just to get into the store.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://www.aaronfeng.com/files/apple_store.jpg" alt="apple_store"/&gt;&lt;/p&gt;

&lt;p&gt;Even though Apple was giving out free t-shirts to the first 1000 customers, there was still an impressive amount of people there.&lt;/p&gt;</description>
      <pubDate>Sun, 30 Mar 2008 23:06:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:c7701414-09d7-47f9-90f4-e78cbca14cdf</guid>
      <author>Aaron Feng</author>
      <link>http://aaronfeng.com/articles/2008/03/30/busy-apple</link>
      <category>random</category>
    </item>
    <item>
      <title>barf and slurp with paredit</title>
      <description>&lt;p&gt;If you are not barfing and slurping with &lt;a href="http://mumble.net/~campbell/emacs/paredit.el"&gt;paredit&lt;/a&gt; while you are editing your Lisp code in Emacs, you are missing out.  You need to read on.&lt;/p&gt;

&lt;p&gt;One of the biggest complaints for beginner Lispers  (like myself) is the overwhelming parentheses.  After working with Lisp code for a couple of weeks, the parens do disappear.  However, you still have to match up the parens even if you don't see them any more.  This is where paredit comes in.  Paredit will manage all the parens for you, so you never have deal with dangling parens again.  It feels annoying at first because it will not allow you to delete a closing paren without removing the opening one.  Just like anything else, if you can get over that, it can be quiet useful.&lt;/p&gt;

&lt;p&gt;Two of my favorite features are barf and slurp.  They are best explained with examples.&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;; starting with the following sexp

(x (y) (z))

; barf forward...

(x (y)) (z)

; barf forward...

(x) (y) (z)

; slurp forward...

(x (y)) (z)

; slurp forward...

(x (y) (z))

; barf backward...

x ((y) (z))

; barf backward...

x (y) ((z))

; slurp backward...

x ((y) (z))

; slurp backward...

(x (y) (z))&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You get the point.  There are many more features to paredit besides barf and slurp.  If you are interested in learning barfing, slurping and other delicious paredit features, check out this &lt;a href="http://mumble.net/~campbell/emacs/paredit.html"&gt;link&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Sun, 23 Mar 2008 20:58:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:46da7de8-ca20-4578-bc86-2f8dfea84cfb</guid>
      <author>Aaron Feng</author>
      <link>http://aaronfeng.com/articles/2008/03/23/barf-and-slurp-with-paredit</link>
      <category>tools</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
