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

<channel>
	<title>So Jake Says &#187; lisp examples</title>
	<atom:link href="http://www.jakevoytko.com/blog/tag/lisp-examples/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jakevoytko.com/blog</link>
	<description>Ye Olde Computer Science Blogge</description>
	<lastBuildDate>Sun, 17 Jan 2010 15:16:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Review of &#8220;ANSI Common Lisp&#8221;</title>
		<link>http://www.jakevoytko.com/blog/2008/07/14/review-of-ansi-common-lisp/</link>
		<comments>http://www.jakevoytko.com/blog/2008/07/14/review-of-ansi-common-lisp/#comments</comments>
		<pubDate>Mon, 14 Jul 2008 04:00:02 +0000</pubDate>
		<dc:creator>Jake</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Programming Languages]]></category>
		<category><![CDATA[ANSI Common Lisp]]></category>
		<category><![CDATA[Lisp cons]]></category>
		<category><![CDATA[lisp examples]]></category>
		<category><![CDATA[Paul Graham]]></category>
		<category><![CDATA[Review of ANSI Common Lisp]]></category>
		<category><![CDATA[Thinking in Lisp]]></category>

		<guid isPermaLink="false">http://www.jakevoytko.com/blog/?p=95</guid>
		<description><![CDATA[Why Lisp? A few months ago, I decided that this summer would be the summer I learn Common Lisp. There are two bloggers who are at fault for this decision: Steve Yegge and Slava Akhmechet . Linked are the pertinent articles, both proposing and explaining the idea of data storage as a Lisp program. The [...]]]></description>
			<content:encoded><![CDATA[<h2>Why Lisp?</h2>
<p>A few months ago, I decided that this summer would be the summer I learn Common Lisp. There are two bloggers who are at fault for this decision: <a href="http://steve.yegge.googlepages.com/the-emacs-problem">Steve Yegge</a> and <a href="http://www.defmacro.org/ramblings/lisp.html">Slava Akhmechet</a> . Linked are the pertinent articles, both proposing and explaining the idea of data storage as a Lisp program.</p>
<p>The idea is beautifully simple: Why spend the time to parse and transform your XML into usable code when you can get parsing, <strong>for free</strong> , in an equivalent S-expression? To me, this is simple, yet profound. it helped me realize why I wanted to learn Lisp: <strong>It&#8217;s interesting</strong> . Lisp is functional, it uses a very different syntax than any other coding I&#8217;ve ever used, its macro support causes pseudo-religious experiences, and a lot of very smart people swear by it.</p>
<p>At this point, I&#8217;ve spent almost a month going through <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;location=http%3A%2F%2Fwww.amazon.com%2FANSI-Common-Prentice-Artificial-Intelligence%2Fdp%2F0133708756%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1215999519%26sr%3D8-1&amp;tag=jakvoyshom-20&amp;linkCode=ur2&amp;camp=1789&amp;creative=9325">ANSI Common Lisp</a> <img style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=jakvoyshom-20&amp;l=ur2&amp;o=1" border="0" alt="" width="1" height="1" /> by Paul Graham. I&#8217;ve read through the book once, and I have played around with a lot of the exercises in the top-level interpreter. I am currently solving all of the exercises, chapter by chapter.</p>
<p><a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;location=http%3A%2F%2Fwww.amazon.com%2FANSI-Common-Prentice-Artificial-Intelligence%2Fdp%2F0133708756%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1215999519%26sr%3D8-1&amp;tag=jakvoyshom-20&amp;linkCode=ur2&amp;camp=1789&amp;creative=9325"></a><img style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=jakvoyshom-20&amp;l=ur2&amp;o=1" border="0" alt="" width="1" height="1" /></p>
<p style="text-align: center;"><img class="alignnone size-medium wp-image-97 aligncenter" title="ansi_common_lisp_cover" src="http://www.jakevoytko.com/blog/wp-content/uploads/2008/07/ansi_common_lisp_cover-194x300.jpg" alt="\" width="194" height="300" /></p>
<h2>How was the book?</h2>
<p><span style="text-decoration: underline;"><strong>The Good</strong> </span></p>
<p>I would never in good conscience let someone teach themselves their first programming language with this book, but it works very well for the experienced programmer. Mr. Graham explains most of the concepts very clearly, programmer-to-programmer. He gives design rationale, anecdotes, interesting history, helpful diagrams, and good examples.</p>
<p>As opposed to many authors that attempt to build all knowledge from the ground up, Mr. Graham starts by giving the reader enough tools to be dangerous. The first coding chapter, <em>Chapter 2</em> , gives the readers functions, printing, variables, lists, conditionals, and introduces the idea of recursion for the uninformed.</p>
<p>For me, this was wonderful. Once I figured out what Lisp environment I wanted to use (I ended up using SBCL in Slime), I spent some time experimenting with the Lisp equivalents of the building blocks I knew from other languages. If anything can be learned of Paul Graham from <a href="http://www.paulgraham.com/arc.html">Arc</a>, it is that he likes to experiment. In this vein, he gives the reader plenty of opportunities to play with the syntax of Lisp.</p>
<p>The explanations of the fundamentals (cons, predicates, lambdas, structures, etc) were all very well done. Unfortunately, his meticulous explanations were not a constant through the whole book. For example, the explanation of functional programming techniques like closures was cursory, even though he constantly refers to the importance of functional programming in Lisp. Were better explanations the victim of strict editing? It&#8217;s difficult to tell.</p>
<p>These missing or unsatisfying explanations were few and far between, however. For the most part, this book was well-conceived and well-explained.</p>
<p><span style="text-decoration: underline;"><strong>The Great</strong> </span></p>
<p>Some of my favorite math books are the texts that have tons of examples, and Paul Graham followed this style successfully. <strong>The biggest challenge of learning Lisp is thinking in Lisp. </strong>I&#8217;m used to a C++ style syntax and thought process, so Lisp was hard to work with in the beginning. Thankfully, the example code written for the book was up to the challenge: In fact, it was the best part of the book.</p>
<p>Every idea presented comes with the necessary code to run it. Every chapter has one or two minor sample applications that use the concepts presented in the chapter. Typing these into the top level interpreter and puzzling through their rudimentary logic helped infinitely more than his explanations. This is not to say that the explanations did not belong in the book. However, they were at best a supplement to the sample code.</p>
<p>Mr. Graham also includes a few badass applications, such as ray tracing. The book has examples of real programs that perform interesting work, and the practical grounding gives the book a sensible air.</p>
<p><strong><span style="text-decoration: underline;">The Cons</span><br />
</strong></p>
<p>Some of the exercises left for the reader showed quite a bit of carelessness on a few levels.</p>
<p>First, some of them were not even solvable, <em>Chapter 3</em> standing out in my mind. One of the exercises asks you to find the longest finite walk in a graph, cycles allowed.</p>
<p>You show me your longest finite walk with a cycle, and I&#8217;ll show you one better.</p>
<p>Next came the lack of volume of exercises. All of the exercises are short exercises. Very short. Each of the questions either asks you modify a previously-written program in some minor way, or to write a small snippet of code.</p>
<p>The lengthy puzzles were lengthy because I was trying to find a common trick, such as passing a lambda function to a reduce call in order to switch argument order. On one hand, I appreciated these puzzles, but couldn&#8217;t help but wonder if they were better suited as examples in the text.</p>
<p>Don&#8217;t get me wrong! A lot of the questions are there to ensure that the reader has learned very basic Lisp concepts, and the book wouldn&#8217;t be as effective without them. However, I never got the appreciation for medium-scale application design in Lisp. All of the problems were very small and situational, designed to help the newbie understand simple features of Common Lisp.</p>
<h2>Do you recommend this book?</h2>
<p>Absolutely.</p>
<p>At the end of the day, coding books are just an excuse to get the reader to write code, and <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;location=http%3A%2F%2Fwww.amazon.com%2FANSI-Common-Prentice-Artificial-Intelligence%2Fdp%2F0133708756%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1215999519%26sr%3D8-1&amp;tag=jakvoyshom-20&amp;linkCode=ur2&amp;camp=1789&amp;creative=9325">ANSI Common Lisp</a> <img style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=jakvoyshom-20&amp;l=ur2&amp;o=1" border="0" alt="" width="1" height="1" /> succeeds marvelously. Code is clearly the central focus of this book, and most of the code is well-supported by explanations. Even though there were not enough programming exercises, and there was a notable absence of hard programming assignments, this text works very well as a &#8220;First Common Lisp Book&#8221;. Going through all of the exercises will give you a nice introduction to Common Lisp, and if you&#8217;re like me, an in-depth examination of compiler and interpreter errors of the Common Lisp implementation of your choice.</p>
<p>Do I feel like I am a Lisp programmer? Hardly. However, this book has given me an appetite for learning more about the language.</p>
<h2>Next up:</h2>
<p><a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;location=http%3A%2F%2Fwww.amazon.com%2FParadigms-Artificial-Intelligence-Programming-Studies%2Fdp%2F1558601910%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1216001266%26sr%3D8-1&amp;tag=jakvoyshom-20&amp;linkCode=ur2&amp;camp=1789&amp;creative=9325">Paradigms of Artificial Intelligence Programming</a><img style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=jakvoyshom-20&amp;l=ur2&amp;o=1" border="0" alt="" width="1" height="1" /> by Dr. Peter Norvig. Given its size, I&#8217;m sure the review will be ready by 2012.</p>
<img src="http://www.jakevoytko.com/blog/?ak_action=api_record_view&id=95&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.jakevoytko.com/blog/2008/07/14/review-of-ansi-common-lisp/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
