<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: SICP section 1.2.2</title>
	<atom:link href="http://eli.thegreenplace.net/2007/06/28/sicp-section-122/feed/" rel="self" type="application/rss+xml" />
	<link>http://eli.thegreenplace.net/2007/06/28/sicp-section-122/</link>
	<description>Eli Bendersky's personal website</description>
	<pubDate>Thu, 04 Dec 2008 00:46:10 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: eliben</title>
		<link>http://eli.thegreenplace.net/2007/06/28/sicp-section-122/#comment-121069</link>
		<dc:creator>eliben</dc:creator>
		<pubDate>Tue, 13 May 2008 16:27:02 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2007/06/28/sicp-section-122/#comment-121069</guid>
		<description>Anh,

My solution gives correct values for all the elements &lt;i&gt;inside&lt;/i&gt; the triangle. As far as my understanding goes, there is no required value for elements outside the triangle, and the exercise in SICP doesn't enforce anything specific.

Your solution is shorter and gives 0 for outside the triangle.</description>
		<content:encoded><![CDATA[<p>Anh,</p>
<p>My solution gives correct values for all the elements <i>inside</i> the triangle. As far as my understanding goes, there is no required value for elements outside the triangle, and the exercise in SICP doesn&#8217;t enforce anything specific.</p>
<p>Your solution is shorter and gives 0 for outside the triangle.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anh</title>
		<link>http://eli.thegreenplace.net/2007/06/28/sicp-section-122/#comment-119932</link>
		<dc:creator>Anh</dc:creator>
		<pubDate>Wed, 23 Apr 2008 03:23:40 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2007/06/28/sicp-section-122/#comment-119932</guid>
		<description>sorry somehow it got cut off, and my x = your col and vice versa
&lt;CODE&gt;
(define (pascal x y)
  (cond ((= 1 x) 1)
        ((&#62; x y) 0)
        (else (+ (pascal (- x 1) (- y 1))
                 (pascal x (- y 1))))))
&lt;/CODE&gt;</description>
		<content:encoded><![CDATA[<p>sorry somehow it got cut off, and my x = your col and vice versa<br />
<code><br />
(define (pascal x y)<br />
  (cond ((= 1 x) 1)<br />
        ((&gt; x y) 0)<br />
        (else (+ (pascal (- x 1) (- y 1))<br />
                 (pascal x (- y 1))))))<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anh</title>
		<link>http://eli.thegreenplace.net/2007/06/28/sicp-section-122/#comment-119931</link>
		<dc:creator>Anh</dc:creator>
		<pubDate>Wed, 23 Apr 2008 03:16:08 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2007/06/28/sicp-section-122/#comment-119931</guid>
		<description>Hi,

I just started reading SICP as well. Looks like your version of the pascal function gives some wrong answers, e.g. (pascal 2 4) gives 2 instead of 0.

Here's mine in Scheme

(define (pascal x y)
  (cond ((= 1 x) 1)</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I just started reading SICP as well. Looks like your version of the pascal function gives some wrong answers, e.g. (pascal 2 4) gives 2 instead of 0.</p>
<p>Here&#8217;s mine in Scheme</p>
<p>(define (pascal x y)<br />
  (cond ((= 1 x) 1)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eliben</title>
		<link>http://eli.thegreenplace.net/2007/06/28/sicp-section-122/#comment-59213</link>
		<dc:creator>eliben</dc:creator>
		<pubDate>Fri, 06 Jul 2007 09:25:38 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2007/06/28/sicp-section-122/#comment-59213</guid>
		<description>It is necessary for the case of a wrong column in row 1 (say, column 2). Without the test, it goes into an infinite loop (instead of just giving a wrong answer)</description>
		<content:encoded><![CDATA[<p>It is necessary for the case of a wrong column in row 1 (say, column 2). Without the test, it goes into an infinite loop (instead of just giving a wrong answer)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jaime</title>
		<link>http://eli.thegreenplace.net/2007/06/28/sicp-section-122/#comment-59211</link>
		<dc:creator>Jaime</dc:creator>
		<pubDate>Fri, 06 Jul 2007 08:57:42 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2007/06/28/sicp-section-122/#comment-59211</guid>
		<description>Hi Eli,

i've been doing these exercises on paper since i don't have a scheme interpreter right here. For the Pascal's Triangle i came up with a solution quite similar to yours (besides that i start counting from zero). The only big difference is the initial test, is it necessary to test that you're in the first row? I mean, the first level matches the other 2 conditions (first col and row = col).</description>
		<content:encoded><![CDATA[<p>Hi Eli,</p>
<p>i&#8217;ve been doing these exercises on paper since i don&#8217;t have a scheme interpreter right here. For the Pascal&#8217;s Triangle i came up with a solution quite similar to yours (besides that i start counting from zero). The only big difference is the initial test, is it necessary to test that you&#8217;re in the first row? I mean, the first level matches the other 2 conditions (first col and row = col).</p>
]]></content:encoded>
	</item>
</channel>
</rss>
