tag:blogger.com,1999:blog-28916362509790168092024-02-18T18:43:29.119-08:00The Little Lisperthelittlelisperhttp://www.blogger.com/profile/08349066765107185158noreply@blogger.comBlogger17125tag:blogger.com,1999:blog-2891636250979016809.post-17035697474773766702010-09-16T05:05:00.000-07:002010-09-16T05:05:38.357-07:00Steve Yegge: How many primitives does it take to build a LISP machine?In one of <a href="http://steve-yegge.blogspot.com/2006/04/lisp-is-not-acceptable-lisp.html">S<span id="goog_403918580"></span>teve Yegge's awesome essays</a><span id="goog_403918581"></span> he says:<br />
<span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"></span><br />
<pre class="prettyprint" style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-height: 600px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; vertical-align: baseline; width: auto;"><code style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"><span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">Its</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"> part of the purity of the idea of LISP</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">:</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"> you only need the seven </span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">(</span><span class="kwd" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: darkblue; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">or</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"> </span><span class="kwd" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: darkblue; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">is</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">
it five</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">?)</span><span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"> primitives to build the full machine</span><span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">.</span></code></pre><br />
<div>So how many primitives do you need? What primitives don't you need? How do we define 'the full machine'? And How do we prove it? Let's go find out. This is going to be fun. </div><div><br />
</div><div><b>Assumptions:</b></div><div>For this exercise we'll be working in Common LISP. </div><div><br />
</div><div><b>How Many Primitives Do you Need?</b></div><div>How many have you got? <a href="http://hyperpolyglot.wikidot.com/lisp#ten-primitives">This site</a> reckons there are in fact <i>ten</i>. These being</div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; line-height: 18px;">atom, quote, eq, car, cdr, cons, cond, lambda, label, apply</span></div><div><br />
</div><div>So if Steve reckons we can do it in seven, some of these primitives are going to drop off the essentials list. </div><div><br />
</div><div><b>What Primitives Don't You Need?</b></div><div>We don't want to give the game away just yet, but it looks like Paul Graham reckons that McCarthy reckons that <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">apply </span>is the one that drops off. </div><div><br />
</div><div><b>How Do We Define 'The Full Machine'?</b></div><div>This is really the crux of the question. (You may even get different answers depending on how you define this.) For this question we'll say that 'the full machine' is a LISP <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">eval </span>function - and we'll use Paul Graham's interpretation of McCarthy's <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">eval </span>function for this. </div><div><br />
</div><div><b>How do we Prove it?</b></div><div>We write an <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">eval </span>function - and count the primitives it implements. </div><div><br />
</div><pre class="brush: csharp">(defun null. (x)
(eq x '()))
(defun and. (x y)
(cond (x (cond (y 't) ('t '())))
('t '())))
(defun not. (x)
(cond (x '())
('t 't)))
(defun append. (x y)
(cond ((null. x) y)
('t (cons (car x) (append. (cdr x) y)))))
(defun list. (x y)
(cons x (cons y '())))
(defun pair. (x y)
(cond ((and. (null. x) (null. y)) '())
((and. (not. (atom x)) (not. (atom y)))
(cons (list. (car x) (car y))
(pair. (cdr x) (cdr y))))))
(defun assoc. (x y)
(cond ((eq (caar y) x) (cadar y))
('t (assoc. x (cdr y)))))
(defun eval. (e a)
(cond
((atom e) (assoc. e a))
((atom (car e))
(cond
((eq (car e) 'quote) (cadr e))
((eq (car e) 'atom) (atom (eval. (cadr e) a)))
((eq (car e) 'eq) (eq (eval. (cadr e) a)
(eval. (caddr e) a)))
((eq (car e) 'car) (car (eval. (cadr e) a)))
((eq (car e) 'cdr) (cdr (eval. (cadr e) a)))
((eq (car e) 'cons) (cons (eval. (cadr e) a)
(eval. (caddr e) a)))
((eq (car e) 'cond) (evcon. (cdr e) a))
('t (eval. (cons (assoc. (car e) a)
(cdr e))
a))))
((eq (caar e) 'label)
(eval. (cons (caddar e) (cdr e))
(cons (list. (cadar e) (car e)) a)))
((eq (caar e) 'lambda)
(eval. (caddar e)
(append. (pair. (cadar e) (evlis. (cdr e) a))
a)))))
(defun evcon. (c a)
(cond ((eval. (caar c) a)
(eval. (cadar c) a))
('t (evcon. (cdr c) a))))
(defun evlis. (m a)
(cond ((null. m) '())
('t (cons (eval. (car m) a)
(evlis. (cdr m) a)))))
(eval '(car '(a a)) )
</pre><div><b>What's the Answer?</b></div><div>We've already given it away - but it is looking like 9 for Common LISP. </div><div><br />
</div><div><b>Are there any bugs in this?</b></div><div>Interestingly enough - <a href="http://stackoverflow.com/questions/3683388/">this guy @DomQ</a> reckons he emailed Paul Graham with notice of a bug in <a href="http://lib.store.yahoo.net/lib/paulgraham/jmc.lisp">the code </a>of <a href="http://www.paulgraham.com/rootsoflisp.html">his original article</a>. Paul Graham's response was that it was actually a bug in McCarthy's code - but that McCarthy wasn't interested in that kind of error handling. You can see a fix for the bug <a href="http://stackoverflow.com/questions/3683388/">here</a>. </div><div><br />
</div><div><b>Could this be improved?</b></div><div>To be truly LISP - you need an <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">eval </span>function that can <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">eval </span>itself. (Something for another day.)</div><div><br />
</div><div>Bibliography:</div><div><ul><li><a href="http://stackoverflow.com/questions/3482389/how-many-primitives-does-it-take-to-build-a-lisp-machine-ten-seven-or-five">Stack Overflow Question</a></li>
</ul></div><div><br />
</div>thelittlelisperhttp://www.blogger.com/profile/08349066765107185158noreply@blogger.com1tag:blogger.com,1999:blog-2891636250979016809.post-24594106369825303642010-07-17T05:54:00.000-07:002010-07-23T21:19:33.814-07:00What is the 100 days of the Little Lisper?The Little Lisper is an incredible book for a number of reasons:<br />
<br />
<ul><li>It frees your mind from the constraints of an algol-style language such as C# or Java and changes your hammer-based approach to algorithmic problem solving to that of a lever </li>
<li>It has a breezy question and answer style that helps you work through big concepts in an easy and approachable way</li>
<li>It's bottom-up, axiomatic approach shows how you can build up a whole language from a few simple primitives</li>
<li>Understanding the y-combinator will <a href="http://anthonylewis.com/2007/11/03/the-little-schemer/">blow your mind</a></li>
<li>It's style is rich in examples of food, avoiding the dryness of other programming books</li>
</ul><div><b><br />
</b></div><div><b>So Why the 100 Days of the Little Lisper?</b></div><div>The ideas in LISP are timeless and have influenced many modern languages. The latest incarnation of this has been the addition of lambda expressions to C#, and its proposed introduction in Java 7. </div><div><br />
</div><div>But these are but shadows of the original. To really understand how these ideas hang together, it is essential to go back to the beginning and understand the roots of all these ideas. </div><div><br />
</div><div><a href="http://thelittlelisper.blogspot.com/2010/06/little-lisper.html">The 100 days of the Little LISPer</a> celebrates these ideas by providing a new solution to a problem in the book each day - for each of the 100 in the book. It aims to respect the Copyright of the original book by providing no more than what is already available online - so it is much better if you buy the original. </div><div><b><span class="Apple-style-span" style="font-weight: normal;"><br />
</span></b></div><div><b>Why LISP?</b></div>Any other reason to read the book? It gets you started in LISP which has lead to the following:<br />
<ul><li>LISP's emphasis on homoiconic languages have big pay-offs when it comes to writing macros as evidenced by Paul Graham in <a href="http://www.paulgraham.com/avg.html">Beating the Averages</a></li>
<li>LISP's paradigms have influenced the development of massive computing clusters at Google, where the <a href="http://labs.google.com/papers/mapreduce.html">MapReduce</a> model is inspired by two LISP functions, map and reduce</li>
<li>Eric Raymond's comment that, <span class="Apple-style-span" style="font-family: inherit;">"</span><span class="Apple-style-span" style="line-height: 24px;"><span class="Apple-style-span" style="font-family: inherit;"><i>Lisp is worth learning for the profound enlightenment experience you will have when you finally get it; that experience will make you a better programmer for the rest of your days, even if you never actually use Lisp itself a lot.</i>"</span></span></li>
</ul><div><span class="Apple-style-span" style="line-height: 24px;"><br />
</span></div><div><span class="Apple-style-span" style="line-height: 24px;"><div><br />
</div></span></div>thelittlelisperhttp://www.blogger.com/profile/08349066765107185158noreply@blogger.com0tag:blogger.com,1999:blog-2891636250979016809.post-30517536352441481922010-06-12T17:10:00.000-07:002010-09-27T23:37:54.204-07:00The Little LISPer - Chapter 10 - What is the value of all this?<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;">You can go to the parent page <a href="http://thelittlelisper.blogspot.com/2010/06/little-lisper.html" style="color: #6699cc; text-decoration: none;">here</a>.</span><br />
<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;"><br />
</span><br />
<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;"></span><br />
<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;">These are links to worked examples of The Little Lisper (3rd Edn.) in Common Lisp. They are being released in sequence, so not all are available now.</span><br />
<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: inherit;"></span><br />
<span class="Apple-style-span" style="font-family: inherit;">The assumption is that you have a copy or have read Mattias Felleison's The Little LISPer. (</span><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"><a href="http://www.amazon.com/dp/0023397632/" style="color: #336699; text-decoration: none;">http://www.amazon.com/dp/0023397632/</a>). </span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"><br />
</span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"></span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">The questions are also available here (<a href="http://www.ccs.neu.edu/home/matthias/BTLS/exercises.ps" style="color: #336699; text-decoration: none;">http://www.ccs.neu.edu/home/matthias/BTLS/exercises.ps</a>)</span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"><br />
</span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">Exercise 1: <a href="http://ideone.com/kFZpz">YourDSL - Can you evaluate this S-expr?</a></span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;">Exercise 2: <a href="http://ideone.com/h4eEM">YourDSL - Can you evaluate this lazy S-expr?</a></span><br />
Exercise 3: <a href="http://ideone.com/bwLJf">YourDSL - Will your eval produce closures?</a><br />
Exercise 4: <a href="http://ideone.com/7TnpO">YourDSL - How to rewrite your function</a><br />
Exercise 5: <a href="http://ideone.com/yjhRY">YourDSL - How to rewrite closures and primitives</a><br />
Exercise 6: <a href="http://ideone.com/Vbz7V">YourDSL - Can you represent a table as a fn?</a><br />
Exercise 7: <a href="http://ideone.com/WejGx">YourDSL - Is this S-Expr a lambda-expression?</a><br />
Exercise 8: <a href="http://ideone.com/pNVcF">Can you change a function-table to a function?</a><br />
Exercise 9: <a href="http://ideone.com/U5A2i">YourDSL - building fns by eval'ing an expr</a><br />
Exercise 10: <a href="http://ideone.com/1RNUz">Can you completely rewrite lisp in your DSL?</a>thelittlelisperhttp://www.blogger.com/profile/08349066765107185158noreply@blogger.com0tag:blogger.com,1999:blog-2891636250979016809.post-62380774605067894332010-06-12T17:08:00.001-07:002010-09-16T04:08:40.851-07:00The Little LISPer - Chapter 9 - Lamdba The Ultimate<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;">You can go to the parent page <a href="http://thelittlelisper.blogspot.com/2010/06/little-lisper.html" style="color: #6699cc; text-decoration: none;">here</a>.</span><br />
<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;"><br />
</span><br />
<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;"></span><br />
<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;">These are links to worked examples of The Little Lisper (3rd Edn.) in Common Lisp. They are being released in sequence, so not all are available now.</span><br />
<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: inherit;"></span><br />
<span class="Apple-style-span" style="font-family: inherit;">The assumption is that you have a copy or have read Mattias Felleison's The Little LISPer. (</span><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"><a href="http://www.amazon.com/dp/0023397632/" style="color: #336699; text-decoration: none;">http://www.amazon.com/dp/0023397632/</a>). </span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"><br />
</span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"></span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">The questions are also available here (<a href="http://www.ccs.neu.edu/home/matthias/BTLS/exercises.ps" style="color: #336699; text-decoration: none;">http://www.ccs.neu.edu/home/matthias/BTLS/exercises.ps</a>)</span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">Exercise 1 - <a href="http://ideone.com/AI3iy">Can you rewrite your function to map it to a list?</a></span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;">Exercise 2 - <a href="http://ideone.com/lUDEK">ycombinator - Apply this fn to this pair in the list</a></span><br />
Exercise 3 - <a href="http://ideone.com/CM9jK">Can you rewrite your function for the ycombinator?</a><br />
Exercise 4 - <a href="http://ideone.com/YVNh6">Rewrite member for the ycombinator</a><br />
Exercise 5 - <a href="http://ideone.com/aticV">Use a continuation function instead of an evaluator</a><br />
Exercise 6 - <a href="http://ideone.com/TJevo">Can you abstract these two functions into an accumulator?</a><br />
Exercise 7 - <a href="http://ideone.com/eJG6N">Can you abstract accumulators into a single function?</a><br />
Exercise 8 - <a href="http://ideone.com/B2Bjq">Can you write your function as a thunk?</a><br />
Exercise 9 - <a href="http://ideone.com/sQxo7">Can you combine an S-expr and a thunk to make a stream?</a><br />
Exercise 10 - <a href="http://ideone.com/cYauT">Can you use P and Q to build a stream?</a>thelittlelisperhttp://www.blogger.com/profile/08349066765107185158noreply@blogger.com0tag:blogger.com,1999:blog-2891636250979016809.post-10305061835204972212010-06-12T17:07:00.000-07:002010-09-12T18:28:12.661-07:00The Little LISPer - Chapter 8 - Friends and Relations<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;">You can go to the parent page <a href="http://thelittlelisper.blogspot.com/2010/06/little-lisper.html" style="color: #6699cc; text-decoration: none;">here</a>.</span><br />
<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;"><br />
</span><br />
<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;"></span><br />
<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;">These are links to worked examples of The Little Lisper (3rd Edn.) in Common Lisp. They are being released in sequence, so not all are available now.</span><br />
<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: inherit;"></span><br />
<span class="Apple-style-span" style="font-family: inherit;">The assumption is that you have a copy or have read Mattias Felleison's The Little LISPer. (</span><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"><a href="http://www.amazon.com/dp/0023397632/" style="color: #336699; text-decoration: none;">http://www.amazon.com/dp/0023397632/</a>). </span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"><br />
</span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"></span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">The questions are also available here (<a href="http://www.ccs.neu.edu/home/matthias/BTLS/exercises.ps" style="color: #336699; text-decoration: none;">http://www.ccs.neu.edu/home/matthias/BTLS/exercises.ps</a>)</span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"><br />
</span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">Exercise 1: <a href="http://ideone.com/CqsZQ">Expression evaluators - Is this an identity relation?</a></span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;">Exercise 2: <a href="http://ideone.com/eyGGv">Expression evaluators - Is this reflexive?</a></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;">Exercise 3: <a href="http://ideone.com/UjDsC">Expression evaluators - Is this symmetric?</a></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><a href="http://ideone.com/UjDsC"></a>Exercise 4: <a href="http://ideone.com/URl7O">Expression evalutors - What is value of f at x?</a></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;">Exercise 5: <a href="http://ideone.com/m7XKr">Expression evaluators - Compose function f and g?</a></span><br />
Exercise 6: <a href="http://ideone.com/4Pt0X">Expression evalutors - Can you evaluate this relation?</a><br />
Exercise 7: <a href="http://ideone.com/5OdiQ">Expression evals - Is your relation of pairs prepped?</a><br />
Exercise 8: <a href="http://ideone.com/nOLNu">Expression evals - Can you compose these relations?</a><br />
Exercise 9: <a href="http://ideone.com/xc8ps">Expression evaluators - Is your expression transitive?</a><br />
Exercise 10: <a href="http://ideone.com/KNRM6">Expression evals - Is your expression partial order?</a><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><a href="http://ideone.com/URl7O"></a><br />
</span>thelittlelisperhttp://www.blogger.com/profile/08349066765107185158noreply@blogger.com0tag:blogger.com,1999:blog-2891636250979016809.post-8115414566076210662010-06-12T17:06:00.000-07:002010-08-27T21:37:14.662-07:00The Little LISPer - Chapter 7 - Shadows<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;">You can go to the parent page <a href="http://thelittlelisper.blogspot.com/2010/06/little-lisper.html" style="color: #6699cc; text-decoration: none;">here</a>.</span><br />
<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;"></span><br />
<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;">These are links to worked examples of The Little Lisper (3rd Edn.) in Common Lisp. They are being released in sequence, so not all are available now.</span><br />
<span class="Apple-style-span" style="font-family: inherit;"></span><br />
<span class="Apple-style-span" style="font-family: inherit;">The assumption is that you have a copy or have read Mattias Felleison's The Little LISPer. (</span><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"><a href="http://www.amazon.com/dp/0023397632/" style="color: #336699; text-decoration: none;">http://www.amazon.com/dp/0023397632/</a>). </span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"></span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">The questions are also available here (<a href="http://www.ccs.neu.edu/home/matthias/BTLS/exercises.ps" style="color: #336699; text-decoration: none;">http://www.ccs.neu.edu/home/matthias/BTLS/exercises.ps</a>)</span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"><br />
</span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">Exercise 1: </span><a href="http://ideone.com/UPkxp"><span class="Apple-style-span" style="font-family: inherit;">Starting writing your own arithmetic DSL in Lisp</span></a></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">Exercise 2: </span><span class="Apple-style-span" style="font-family: inherit;"><a href="http://ideone.com/Muxqu">Validating an expression in your DSL</a></span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;">Exercise 3: <a href="http://ideone.com/7zciw">Count the operators in your DSL</a></span><br />
Exercise 4: <a href="http://ideone.com/ImoBd">Count the operands in your DSL</a><br />
Exercise 5: <a href="http://ideone.com/b9GsJ">Make your DSL expressions scalable</a><br />
Exercise 6: <a href="http://ideone.com/QVu1u">Add binary operators to your expressions</a><br />
Exercise 7: <a href="http://ideone.com/CqdAM">In your DSL check you have values for your expressions</a><br />
Exercise 8: <a href="http://ideone.com/MgXuF">Get the variables passed into your expression DSL</a><br />
Exercise 9: <a href="http://ideone.com/lKU5Y">Evaluate your expression in your DSL</a><br />
Exercise 10: <a href="http://ideone.com/Ng7xQ">Add binary operators into the evaluation of your DSL</a>thelittlelisperhttp://www.blogger.com/profile/08349066765107185158noreply@blogger.com0tag:blogger.com,1999:blog-2891636250979016809.post-84629715777937418292010-06-12T17:05:00.000-07:002010-08-19T02:55:49.660-07:00The Little LISPer - Chapter 6 - *Oh my Gawd*: It's Full of Stars<span class="Apple-style-span" style="font-family: Arial; font-size: small;"><span class="Apple-style-span" style="font-size: 13px;"><span class="Apple-style-span" style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;">You can go to the parent page <a href="http://thelittlelisper.blogspot.com/2010/06/little-lisper.html" style="color: #6699cc; text-decoration: none;">here</a>.</span><br />
<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;"></span><br />
<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;">These are links to worked examples of The Little Lisper (3rd Edn.) in Common Lisp. They are being released in sequence, so not all are available now.</span><br />
<span class="Apple-style-span" style="font-family: inherit;"></span><br />
<span class="Apple-style-span" style="font-family: inherit;">The assumption is that you have a copy or have read Mattias Felleison's The Little LISPer. (</span><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"><a href="http://www.amazon.com/dp/0023397632/" style="color: #336699; text-decoration: none;">http://www.amazon.com/dp/0023397632/</a>). </span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"></span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">The questions are also available here (<a href="http://www.ccs.neu.edu/home/matthias/BTLS/exercises.ps">http://www.ccs.neu.edu/home/matthias/BTLS/exercises.ps</a>)</span></span></span></span></span><br />
<span class="Apple-style-span" style="font-family: Arial; font-size: small;"><span class="Apple-style-span" style="font-size: 13px;"><span class="Apple-style-span" style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"><br />
</span></span></span></span></span><br />
<span class="Apple-style-span" style="font-family: Arial; font-size: small;"><span class="Apple-style-span" style="font-size: 13px;"><span class="Apple-style-span" style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">Exercise 1: <a href="http://ideone.com/NWsjz">Finding the hidden chili and separating them out</a></span></span></span></span></span><br />
<span class="Apple-style-span" style="font-family: Arial; font-size: small;"><span class="Apple-style-span" style="font-size: 13px;"><span class="Apple-style-span" style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;">Exercise 2: <a href="http://ideone.com/Kf27E">Is there chili in the hot potatoes? (nested intersection)</a></span></span></span></span><br />
<span class="Apple-style-span" style="font-family: Arial; font-size: small;"><span class="Apple-style-span" style="font-size: 13px;"><span class="Apple-style-span" style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Exercise 3: <a href="http://ideone.com/4oqIF">Double frying the baked tomatoes (nested atom duplication)</a></span></span></span><br />
<span class="Apple-style-span" style="font-family: Arial; font-size: small;"><span class="Apple-style-span" style="font-size: 13px;"><span class="Apple-style-span" style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 15px; line-height: 20px;">Exercise 4: </span></span></span><span class="Apple-style-span" style="font-family: Arial;"><a href="http://ideone.com/S44zn">LISP asking three questions about the fried potatoes</a></span><br />
Exercise 5: <a href="http://ideone.com/JutgZ">Fish and chips - finding the first nested occurrence</a><br />
Exercise 6: <a href="http://ideone.com/7To0G">Adding the nested numbers</a><br />
Exercise 7: <a href="http://ideone.com/ZlkUE">What does this function g* do?</a><br />
Exercise 8: <a href="http://ideone.com/v2uOd">What does this function f* do?</a><br />
Exercise 9: <a href="http://ideone.com/tM1M2">Can we accumulate the potatoes in this dish?</a><br />
Exercise 10: <a href="http://ideone.com/zg94m">Can we accumulate the (nested) potatoes in this dish?</a>thelittlelisperhttp://www.blogger.com/profile/08349066765107185158noreply@blogger.com0tag:blogger.com,1999:blog-2891636250979016809.post-70706300554782316052010-06-12T16:58:00.000-07:002010-08-09T01:42:24.691-07:00The Little LISPer - Chapter 5 - The Multichapter Chapter<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;">You can go to the parent page <a href="http://thelittlelisper.blogspot.com/2010/06/little-lisper.html">here</a>.</span><br />
<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;"><br />
</span><br />
<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;">These are links to worked examples of The Little Lisper (3rd Edn.) in Common Lisp. They are being released in sequence, so not all are available now.</span><br />
<span class="Apple-style-span" style="font-family: inherit;"></span><br />
<span class="Apple-style-span" style="font-family: inherit;">The assumption is that you have a copy or have read Mattias Felleison's The Little LISPer. (</span><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"><a href="http://www.amazon.com/dp/0023397632/">http://www.amazon.com/dp/0023397632/</a>). </span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"></span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">The questions are also available here (<a href="http://www.ccs.neu.edu/home/matthias/BTLS/exercises.ps">http://www.ccs.neu.edu/home/matthias/BTLS/exercises.ps</a>)</span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"><br />
</span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">Exercise 1: <a href="http://ideone.com/sOI8T">Substituting the bananas for kiwis</a></span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;">Exercise 2: <a href="http://ideone.com/8Dfpe">Substituting two things for kiwis</a></span><br />
Exercise 3: <a href="http://ideone.com/W0BnD">Building a nests for the banana kiwi list (multidown)</a><br />
Exercise 4: <a href="http://ideone.com/PIFaV">Counting the common ingredients (occurN)</a><br />
Exercise 5: <a href="http://ideone.com/WMvCA">Finding the common ingredients</a><br />
Exercise 6: <a href="http://ideone.com/ZsHhZ">Is this just one? Does it break the law(s)?</a><br />
Exercise 7: <a href="http://ideone.com/alt1r">Are these equal? Does it break the law?</a><br />
Exercise 8: <a href="http://ideone.com/JyUkY">Broken count function - can you fix it?</a><br />
Exercise 9: <a href="http://ideone.com/cA6rv">Curry chicken - How to de-nest this list</a><br />
Exercise 10: <a href="http://ideone.com/YRlQz">Have we broken a law? Did we obey the spirit of the law?</a>thelittlelisperhttp://www.blogger.com/profile/08349066765107185158noreply@blogger.com0tag:blogger.com,1999:blog-2891636250979016809.post-64933290855745221642010-06-12T16:55:00.000-07:002010-07-29T03:33:23.289-07:00The Little LISPer - Chapter 4 - Number Games<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;">You can go to the parent page <a href="http://thelittlelisper.blogspot.com/2010/06/little-lisper.html" style="color: #6699cc; text-decoration: none;">here</a>.</span><br />
<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;"></span><br />
<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;">These are links to worked examples of The Little Lisper (3rd Edn.) in Common Lisp. They are being released in sequence, so not all are available now.</span><br />
<span class="Apple-style-span" style="font-family: inherit;"></span><br />
<span class="Apple-style-span" style="font-family: inherit;">The assumption is that you have a copy or have read Mattias Felleison's The Little LISPer. (</span><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"><a href="http://www.amazon.com/dp/0023397632/" style="color: #336699; text-decoration: none;">http://www.amazon.com/dp/0023397632/</a>). </span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"></span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">The questions are also available here (<a href="http://www.ccs.neu.edu/home/matthias/BTLS/exercises.ps" style="color: #336699; text-decoration: none;">http://www.ccs.neu.edu/home/matthias/BTLS/exercises.ps</a>)</span></span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"><br />
</span></span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">Exercise 1. <a href="http://ideone.com/y5q2b">Duplicate that atom</a></span></span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">Exercise 2. <a href="http://ideone.com/V3jjH">Multiply that list of numbers</a></span></span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">Exercise 3. <a href="http://ideone.com/jcq2r">What is the fifth commandment?</a></span></span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">Exercise 4. <a href="http://ideone.com/WGvOz">Is the list exponent function correct?</a></span></span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">Exercise 5. <a href="http://ideone.com/CqkJy">What is the index of this atom in the list?</a></span></span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">Exercise 6. <a href="http://ideone.com/zNiHN">What is the index of this atom in the list?</a></span></span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">Exercise 7. <a href="http://ideone.com/77yVx">What is the vector dot product of these two lists?</a></span></span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">Exercise 8. <a href="http://ideone.com/4vMmM">Divide that list of numbers</a></span></span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">Exercise 9. <a href="http://ideone.com/UGEl5">Telling LISP to find that remainder</a></span></span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">Exercise 10. <a href="http://ideone.com/iEHiv">Less than or equal to?</a></span></span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: medium;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-size: 15px; line-height: 13px; white-space: pre;"><br />
</span></span>thelittlelisperhttp://www.blogger.com/profile/08349066765107185158noreply@blogger.com0tag:blogger.com,1999:blog-2891636250979016809.post-58895111706609586302010-06-12T16:54:00.000-07:002010-07-20T02:15:36.485-07:00The Little LISPer - Chapter 3 - Cons the Magnificent<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;">You can go to the parent page <a href="http://thelittlelisper.blogspot.com/2010/06/little-lisper.html" style="color: #6699cc; text-decoration: none;">here</a>.</span><br />
<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;"></span><br />
<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;">These are links to worked examples of The Little Lisper (3rd Edn.) in Common Lisp. They are being released in sequence, so not all are available now.</span><br />
<span class="Apple-style-span" style="font-family: inherit;"></span><br />
<span class="Apple-style-span" style="font-family: inherit;">The assumption is that you have a copy or have read Mattias Felleison's The Little LISPer. (</span><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"><a href="http://www.amazon.com/dp/0023397632/" style="color: #336699; text-decoration: none;">http://www.amazon.com/dp/0023397632/</a>). </span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"></span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">The questions are also available here (<a href="http://www.ccs.neu.edu/home/matthias/BTLS/exercises.ps" style="color: #336699; text-decoration: none;">http://www.ccs.neu.edu/home/matthias/BTLS/exercises.ps</a>)</span></span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"><br />
</span></span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">Exercise 1. <a href="http://ideone.com/Le9ud">Getting the spanish red beans out of a nested list</a></span></span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">Exercise 2. <a href="http://ideone.com/F2rG5">Hot chili - List of duplicates function</a></span></span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">Exercise 3. <a href="http://ideone.com/upJnG">hot hot chili - duplicating an atom function</a></span></span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">Exercise 4. <a href="http://ideone.com/MtPbc">hot sauce - substutition function</a></span></span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">Exercise 5. <a href="http://ideone.com/Y9MLb">and tomato sauce - multi substution function</a></span></span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">Exercise 6. <a href="http://ideone.com/40oiW">texas hot hot - list intersection substitution function</a></span></span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">Exercise 7. <a href="http://ideone.com/E4bw5">Telling LISP to remove the sauce (atom)</a></span></span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">Exercise 8. <a href="http://ideone.com/In3cQ">red wine - Is this a natural recursion?</a></span></span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">Exercise 9. <a href="http://ideone.com/AbYbz">Removing the second chili (from this list)</a></span></span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">Exercise 10. <a href="http://ideone.com/7NO2A">Are there some common ingredients in insert and subst?</a></span></span></span></span></span>thelittlelisperhttp://www.blogger.com/profile/08349066765107185158noreply@blogger.com0tag:blogger.com,1999:blog-2891636250979016809.post-37369037893939702462010-06-12T16:52:00.000-07:002010-07-09T06:26:36.518-07:00The Little LISPer - Chapter 2 - Do It, Do It Again<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;">You can go to the parent page <a href="http://thelittlelisper.blogspot.com/2010/06/little-lisper.html" style="color: #6699cc; text-decoration: none;">here</a>.</span><br />
<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;"></span><br />
<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;">These are links to worked examples of The Little Lisper (3rd Edn.) in Common Lisp. They are being released in sequence, so not all are available now.</span><br />
<span class="Apple-style-span" style="font-family: inherit;"></span><br />
<span class="Apple-style-span" style="font-family: inherit;">The assumption is that you have a copy or have read Mattias Felleison's The Little LISPer. (</span><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"><a href="http://www.amazon.com/dp/0023397632/" style="color: #336699; text-decoration: none;">http://www.amazon.com/dp/0023397632/</a>). </span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"></span></span><br />
<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">The questions are also available here (<a href="http://www.ccs.neu.edu/home/matthias/BTLS/exercises.ps" style="color: #336699; text-decoration: none;">http://www.ccs.neu.edu/home/matthias/BTLS/exercises.ps</a>)</span></span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"><br />
</span></span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">Exercise 1. <a href="http://ideone.com/B2tlo">German chocolate cake - What is a List of AToms?</a></span></span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;">Exercise 2. <a href="http://ideone.com/rhc34">(poppy seed cake) - How LISP know it’s a List of AToms?</a></span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;">Exercise 3. <a href="http://ideone.com/SlP7j">Is there coffee in this cake? Member of a list</a></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;">Exercise 4. <a href="http://ideone.com/48XRe">Changing the recipe (of the member? function)</a></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;">Exercise 5. <a href="http://ideone.com/S33ff">Is this (poppy seed cake) fake? LISP and fake LATs</a></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;">Exercise 6. <a href="http://ideone.com/mjpIL">Is there cake in this list?</a></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;">Exercise 7. <a href="http://ideone.com/TueNk">Can we change the recipe of member? again?</a></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;">Exercise 8. <a href="http://ideone.com/uF6mr">Did changing the recipe spoil the cake? (member? function)</a></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;">Exercise 9. <a href="http://ideone.com/G8NcD">Is there cake in this red wine? (member? and nested lists)</a></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;">Exercise 10. <a href="http://ideone.com/3mI87">Did we put the chocolate in twice? (Dup. list members)</a></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><br />
</span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><br />
</span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><br />
</span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><br />
</span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><br />
</span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"><br />
</span></span></span></span></span><br />
<span class="Apple-style-span" style="color: #333333; font-size: medium;"><span class="Apple-style-span" style="font-size: 15px; line-height: 20px;"><span class="Apple-style-span" style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"><br />
</span></span></span></span></span>thelittlelisperhttp://www.blogger.com/profile/08349066765107185158noreply@blogger.com0tag:blogger.com,1999:blog-2891636250979016809.post-38795481600249493772010-06-12T03:10:00.000-07:002010-06-12T03:10:20.846-07:00Run LISP on your iPhone in four stepsHow to get started with LISP on your iPhone in 4 steps<br />
1. In Safari go to <a href="http://ideone.com/">ideone.com</a><br />
2. In the main text field enter <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">(print "Hello World")</span><br />
3. In the left hand drop down select Common Lisp (clisp)<br />
4. Click submit<br />
Voilà - LISP running on your Iphone!<br />
<br />
JGthelittlelisperhttp://www.blogger.com/profile/08349066765107185158noreply@blogger.com0tag:blogger.com,1999:blog-2891636250979016809.post-32693558915957162532010-06-10T04:15:00.000-07:002010-06-10T04:15:09.095-07:0010 Steps to getting started with Common Lisp on Windows<div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><b>Disclaimer</b>: I don't work for Allegro Common Lisp and have no financial interest in them. This is just a really quick way to get started with Allegro Common Lisp for a new user.</span></span></div><div class="MsoNormal"><br />
</div><div class="MsoListParagraphCxSpFirst" style="mso-list: l0 level1 lfo1; text-indent: -18.0pt;"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">1.</span><span style="font: 7.0pt "Times New Roman";"><span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"> 1. </span></span></span></span><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">Go to the following page </span></span><a href="http://www.franz.com/downloads/clp/survey"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">http://www.franz.com/downloads/clp/survey</span></a></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">2. Download the free download of Allegro Common Lisp</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">3. Install it on your machine</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">4. Run Allegro Common Lisp</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">5. Select New Project</span></span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnmCGOj4fvmV7uIoEGy7UQGPdtFF73dXcJ2ansj-vQV8UUBsNoCqQwDqyEY3XGVivfSjXVDT8PO_Y0ihBC1n8iYUa1Rfrip0Kb7CVReCStOtrc5Lsh9Cy3rWxL4oYaVXA1_YjcVcaVjFY/s1600/Image1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnmCGOj4fvmV7uIoEGy7UQGPdtFF73dXcJ2ansj-vQV8UUBsNoCqQwDqyEY3XGVivfSjXVDT8PO_Y0ihBC1n8iYUa1Rfrip0Kb7CVReCStOtrc5Lsh9Cy3rWxL4oYaVXA1_YjcVcaVjFY/s320/Image1.png" /></a></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">6. Enter HelloWorld as the new Project Directory</span></span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhO2mw24BjguaG4R6UKPRWCjEqHAaShzGq7mcwt2avq2mYrrIB_H6fHi7FIAyoOUv7IU8W06FmmvpkoY5yqpV50IXLUWLvK1f8wQBxFmKmHl3hv70q5vq_hBKD-wk1N3O2RkeLE5_8rcZQ/s1600/Image2.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhO2mw24BjguaG4R6UKPRWCjEqHAaShzGq7mcwt2avq2mYrrIB_H6fHi7FIAyoOUv7IU8W06FmmvpkoY5yqpV50IXLUWLvK1f8wQBxFmKmHl3hv70q5vq_hBKD-wk1N3O2RkeLE5_8rcZQ/s320/Image2.png" /></a></div><div class="MsoNormal"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></div><div class="MsoNormal"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">7. In the Untitled Code Window press CTRL-S</span></span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsXiuAns0J0tMIDqIo3hyphenhyphenDkepZvTQnYTFB6ip9CVLzCht5PkQQAk3CAZrlVhE72bVHY7RfC7nR1VqXntyNKsK5C4MM8YrntlfGgQzeuwIC_poHjVSXMGKMIDn4RxyTWx2wDMQlc1inuvc/s1600/Image3.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsXiuAns0J0tMIDqIo3hyphenhyphenDkepZvTQnYTFB6ip9CVLzCht5PkQQAk3CAZrlVhE72bVHY7RfC7nR1VqXntyNKsK5C4MM8YrntlfGgQzeuwIC_poHjVSXMGKMIDn4RxyTWx2wDMQlc1inuvc/s320/Image3.png" /></a></div><div class="MsoNormal"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></div><div class="MsoNormal"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">8. Click ‘Yes’ to add this to the current project</span></span></div><div class="MsoNormal"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnrewQO5yCLqgrepqQ9tYWo_WmjraEnflLsNebes6xntIIpXhFc0Ge_nnQKwpPehzbZKExQsYaBa4tOsFGWV4OYSMSP2_CTG5odJtzRgCBhOtzFi1whnOwCMY3Kpt3iTmWkqUB8zPrMEo/s1600/Image4.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnrewQO5yCLqgrepqQ9tYWo_WmjraEnflLsNebes6xntIIpXhFc0Ge_nnQKwpPehzbZKExQsYaBa4tOsFGWV4OYSMSP2_CTG5odJtzRgCBhOtzFi1whnOwCMY3Kpt3iTmWkqUB8zPrMEo/s320/Image4.png" /></a></div><div class="MsoNormal"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></div><div class="MsoNormal"><br />
</div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">9. Enter ‘HelloWorld’ as the filename</span></span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEireOli6r3J1g5ztI42m9Cxhjnxewwj9urjmRvJU5Trb9uihDYbQKmUxRhRazDU54UwUt-9MO5O_rLiuikh46oeAxa4yzK__oTywn-CgBjaZXfPlw-E67vm4lXAmqAizNJh_DwJJGFrjz4/s1600/Image5.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEireOli6r3J1g5ztI42m9Cxhjnxewwj9urjmRvJU5Trb9uihDYbQKmUxRhRazDU54UwUt-9MO5O_rLiuikh46oeAxa4yzK__oTywn-CgBjaZXfPlw-E67vm4lXAmqAizNJh_DwJJGFrjz4/s320/Image5.png" /></a></div><div class="MsoNormal"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></div><div class="MsoNormal"><br />
</div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">10. In the code window enter (print “Hello World”). Hilight the text and type CTRL-E. </span></span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBqKY-T23xXDH2kV2wjK_3kCAmapZu-Fs8nKDc2zucFXBRAELr6dsHtrkl6vmWF4jbIAYPDXMSfKDLM7WKhIh73psqhYTe8EBnz-RKzRBWCT6o9Y9FynLnIRYr6vneVUQN1HUkV8PCHQ0/s1600/Image6.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBqKY-T23xXDH2kV2wjK_3kCAmapZu-Fs8nKDc2zucFXBRAELr6dsHtrkl6vmWF4jbIAYPDXMSfKDLM7WKhIh73psqhYTe8EBnz-RKzRBWCT6o9Y9FynLnIRYr6vneVUQN1HUkV8PCHQ0/s320/Image6.png" /></a></div><div class="MsoNormal"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></div><div class="MsoNormal"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></span></div><div class="MsoNormal"><span lang="EN-AU"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">Voila – Hello World appears in the Debug window. </span></span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNMB5Am19XqMW3vpMvlo1jhzjqS2T5IBAu6WLiMNNRZsPtgi94IHtL2wBNCm-57EJWtt3iECzT4bjUhnq0IHiCmOnTzhnhJ9csculpntdKsKRnoTqHnBqpyu8jBkKwb137zwxN5OsV8c0/s1600/Image7.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNMB5Am19XqMW3vpMvlo1jhzjqS2T5IBAu6WLiMNNRZsPtgi94IHtL2wBNCm-57EJWtt3iECzT4bjUhnq0IHiCmOnTzhnhJ9csculpntdKsKRnoTqHnBqpyu8jBkKwb137zwxN5OsV8c0/s320/Image7.png" /></a></div><div class="MsoNormal"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></div><div class="MsoNormal"><br />
</div><div class="MsoNormal"><br />
</div><div class="MsoNormal"><br />
</div>thelittlelisperhttp://www.blogger.com/profile/08349066765107185158noreply@blogger.com0tag:blogger.com,1999:blog-2891636250979016809.post-39851713311933756972010-06-06T00:13:00.000-07:002012-05-20T04:50:03.353-07:00The Little LISPer - Chapter 1 - Toys<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;">You can learn more about the Little Lisper and this project <a href="http://thelittlelisper.blogspot.com/2010/06/little-lisper.html" style="color: #6699cc; text-decoration: none;">here</a>.</span><br />
<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;"></span><br />
<span class="Apple-style-span" style="color: #333333; font-family: inherit; font-size: 15px; line-height: 20px;">These are links to worked examples of The Little Lisper (3rd Edn.) in Common Lisp. They are being released in sequence, so not all are available now.</span><br />
<span class="Apple-style-span" style="font-family: inherit;">The assumption is that you have a copy or have read Dan Friedman and Matthias Felleison's The Little LISPer. (</span><span class="Apple-style-span" style="border-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"><a href="http://www.amazon.com/dp/0023397632/" style="color: #336699; text-decoration: none;">http://www.amazon.com/dp/0023397632/</a>). </span></span><br />
<span class="Apple-style-span" style="border-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"> </span></span><br />
<span class="Apple-style-span" style="border-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;"></span></span><br />
<span class="Apple-style-span" style="border-spacing: 2px; line-height: 13px; white-space: pre;"><span class="Apple-style-span" style="font-family: inherit;">The questions are also available here (<a href="http://www.ccs.neu.edu/home/matthias/BTLS/exercises.ps" style="color: #336699; text-decoration: none;">http://www.ccs.neu.edu/home/matthias/BTLS/exercises.ps</a>)</span></span><br />
<br />
Question 1. <a href="http://ideone.com/vfFF5">First steps towards learning LISP - What distinguishes an atom?</a><br />
Question 2. <a href="http://ideone.com/onZ71">First steps towards learning LISP - What distinguishes a list?</a><br />
Question 3. <a href="http://ideone.com/HByqS">First steps towards Learning LISP - Cons a piece of cake onto your mouth</a><br />
Question 4. <a href="http://ideone.com/KW4wc">Putting the french in french fries. (What is a list remainder?)</a><br />
Question 5. <a href="http://ideone.com/sJrad">Are two lisp's the same? When are atoms equal?</a><br />
Question 6. <a href="http://ideone.com/0qrYq">What is the meaning of nothing? Can you have a null list?</a><br />
Question 7. <a href="http://ideone.com/8052J">What if you add nothing to nothing? What about a null list?</a><br />
Question 8. <a href="http://ideone.com/sDVZW">Meatballs and spaghetti. Is the end of a nested list an atom or null?</a><br />
Question 9. <a href="http://ideone.com/hF2w5">Kiwis, mangoes, lemons . How do you traverse down a nested list?</a><br />
Question 10. <a href="http://ideone.com/cLp9J">Peanut butter. How do I manually extract a particular atom from a list?</a><br />
<div>
<br /></div>thelittlelisperhttp://www.blogger.com/profile/08349066765107185158noreply@blogger.com2tag:blogger.com,1999:blog-2891636250979016809.post-15481507206978499792010-06-06T00:06:00.000-07:002010-07-17T05:54:34.844-07:00100 Days of The Little LisperWhat follows are chapters of The Little Lisper. Click one to see questions associated with it. These are being released in sequence, so not all are available immediately.<br />
<br />
1. <a href="http://thelittlelisper.blogspot.com/2010/06/little-lisper-chapter-1-toys.html">Toys</a><br />
2. <a href="http://thelittlelisper.blogspot.com/2010/06/little-lisper-chapter-2-do-it-do-it.html">Do It, Do It Again</a><br />
3. <a href="http://thelittlelisper.blogspot.com/2010/06/little-lisper-chapter-3-cons.html">Cons the Magnificent</a><br />
4. <a href="http://thelittlelisper.blogspot.com/2010/06/little-lisper-chapter-4-number-games.html">Number Games</a><br />
5. <a href="http://thelittlelisper.blogspot.com/2010/06/little-lisper-chapter-5-multichapter.html">Multichapter Chapter</a><br />
6. <a href="http://thelittlelisper.blogspot.com/2010/06/little-lisper-chapter-6-oh-my-gawd-its.html">Its Full of Stars</a><br />
7. <a href="http://thelittlelisper.blogspot.com/2010/06/little-lisper-chapter-7-shadows.html">Shadows</a><br />
8. <a href="http://thelittlelisper.blogspot.com/2010/06/little-lisper-chapter-8-friends-and.html">Friends and Relations</a><br />
9. <a href="http://thelittlelisper.blogspot.com/2010/06/little-lisper-chapter-9-lamdba-ultimate.html">Lamdba The Ultimate</a><br />
10. <a href="http://thelittlelisper.blogspot.com/2010/06/little-lisper-chapter-10-what-is-value.html">What is the value of all this?</a>thelittlelisperhttp://www.blogger.com/profile/08349066765107185158noreply@blogger.com0tag:blogger.com,1999:blog-2891636250979016809.post-82943464059664999982010-05-29T23:07:00.000-07:002010-05-29T23:08:51.332-07:00Which dialect of LISP should I use?<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">It really depends on what your requirements are:</span><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">Assuming you want:</span><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">1) <a href="http://www.gigamonkeys.com/book/">The </a><a href="http://www.paulgraham.com/onlisp.html">most </a><a href="http://aima.cs.berkeley.edu/">documentation</a></span><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">2) Supported on a large number of platforms</span><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">3) Supported by the most number of IDEs</span><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">4) Strong commercial support for your enterprise from a number of vendors</span><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">Then you're looking at </span><a href="http://en.wikipedia.org/wiki/Common_Lisp"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">Common Lisp</span></a><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">If you're looking for a dialect that is</span><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">1) Really fun to learn</span><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">2) Has some <a href="http://en.wikipedia.org/wiki/Structure_and_Interpretation_of_Computer_Programs">classic Computer Science</a> <a href="http://www.ccs.neu.edu/home/matthias/BTLS/">texts </a>written for it</span><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">Then you're looking at </span><a href="http://en.wikipedia.org/wiki/Scheme_(programming_language)"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">Scheme</span></a><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">If you're looking for a dialect that</span><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">1) Has support for a large number of platforms</span><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">2) Is integrated into modern libraries like the JDK and the CLR</span><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">3) Has a really <a href="http://groups.google.com/group/clojure?pli=1">dynamic passionate community</a></span><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">4) Is still evolving and is the hottest thing on the block</span><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">5) Has a <a href="http://pragprog.com/titles/shcloj/programming-clojure">growing </a><a href="http://apress.com/book/view/1430272317">number </a>of <a href="http://joyofclojure.com/">books </a><a href="http://www.clojureinaction.com/">published </a>for it</span><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">Then you're looking at </span><a href="http://clojure.org/"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">Clojure</span></a><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br />
</span><br />
<b><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">More discussion</span></b><br />
<br />
<ul><li><a href="http://stackoverflow.com/questions/1007250/which-dialect-of-lisp-should-i-learn"><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">Stack overflow discussion on Lisp Dialects</span></a></li>
<li><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><a href="http://ask.metafilter.com/29373/Lisp-dialects">Metafilter discussion on Lisp Dialects</a></span></li>
</ul>thelittlelisperhttp://www.blogger.com/profile/08349066765107185158noreply@blogger.com0tag:blogger.com,1999:blog-2891636250979016809.post-3109595585324839342010-02-07T02:58:00.000-08:002010-02-14T02:50:11.760-08:00Solving the Birthday Problem in Clojure<div>The Birthday Paradox poses the following question: "How many people do you need in a room for there to be a greater than 50% probability of two people having the same birthday?"</div><div></div><div>At first guess - it feels big. There are 365 days in a year - so the answer must fall somewhere in the hundreds. (You can read more about the problem on the <a href="http://en.wikipedia.org/wiki/Birthday_problem">wikipedia page</a>)</div><div>Let's fire up <a href="http://clojure.org/">clojure </a>to solve this problem:</div><br />
<pre class="brush: clojure">C:\clojure-1.1.0>java -cp clojure.jar clojure.main
</pre><pre>Clojure 1.1.0
</pre><pre class="brush: clojure">user=> (def +year-size+ 365)
</pre><pre>#'user/+year-size+
</pre><pre class="brush: clojure">user=> (defn birthday-problem [probability number-of-people]
(let [new-probability (* (/ (- +year-size+ number-of-people)
+year-size+)
probability)]
(if (< new-probability 0.5
(+ 1 number-of-people)
(birthday-problem new-probability (+ 1 number-of-people)))))
</pre>
<pre>#'user/birthday-problem
</pre><pre class="brush: clojure">user=> (birthday-problem 1.0 1)
</pre><pre>23
</pre><div>The answer: 23 people! Which when you think about it - rings true when you think of classes at school. There was at least one person who had the same birthday as someone else. </div><div></div><div>(If you were thinking of a number greater than 100 then you were probably thinking of the number of people you'd need for someone to have <i>the same birthday as you</i> - which is a problem for another day.)</div>thelittlelisperhttp://www.blogger.com/profile/08349066765107185158noreply@blogger.com0