<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Scheme on galvanist</title>
    <link>/tags/scheme/</link>
    <description>Recent content in Scheme on galvanist</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Thu, 22 Aug 2013 19:57:00 +0000</lastBuildDate>
    <atom:link href="/tags/scheme/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Tail-Recursive Function Transformation in Python</title>
      <link>/posts/2013-08-22-tail-recursive-function-transformation-in-python/</link>
      <pubDate>Thu, 22 Aug 2013 19:57:00 +0000</pubDate>
      <guid>/posts/2013-08-22-tail-recursive-function-transformation-in-python/</guid>
      <description>&lt;h2 id=&#34;intro&#34;&gt;Intro&lt;/h2&gt;&#xA;&lt;p&gt;In 1986, Hal Abelson and Gerald Jay Sussman recorded some videos for their M.I.T. EECS course on the &lt;a href=&#34;http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-001-structure-and-interpretation-of-computer-programs-spring-2005/&#34;&gt;Structure and Interpretation of Computer Programs&lt;/a&gt;. Twenty-seven years later, these videos are still a great resource. But the language featured is the &lt;a href=&#34;http://en.wikipedia.org/wiki/Scheme_%28programming_language%29&#34;&gt;Scheme&lt;/a&gt;&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt; dialect of Lisp and while I can/do follow along in &amp;ldquo;edwin&amp;rdquo;, sometimes it&amp;rsquo;s nice to play in a (language (with (less (parens)))), like python.&lt;/p&gt;&#xA;&lt;p&gt;One of the early challenges that I faced while trying to follow a scheme course using python was Scheme&amp;rsquo;s heavily tail-recursive programming idiom. Here&amp;rsquo;s a toy example from the videos where we define a &lt;a href=&#34;http://en.wikipedia.org/wiki/Peano_axioms&#34;&gt;Peano addition&lt;/a&gt; operation that only uses increment and decrement.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
