<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Map As Homoiconic Basis</title>
	<atom:link href="http://blog.fogus.me/2009/07/23/map-as-homoiconic-basis/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.fogus.me/2009/07/23/map-as-homoiconic-basis/</link>
	<description>λ λ λ</description>
	<lastBuildDate>Sun, 29 Jan 2012 10:17:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: fogus</title>
		<link>http://blog.fogus.me/2009/07/23/map-as-homoiconic-basis/comment-page-1/#comment-10982</link>
		<dc:creator>fogus</dc:creator>
		<pubDate>Tue, 06 Oct 2009 14:35:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.fogus.me/?p=1920#comment-10982</guid>
		<description>&lt;p&gt;@olabini&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;In fact, I would say that the above code examples are definitely not represented with maps – since maps are unordered and the code above depends on being sequenced.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Small point of contention; the maps above are listed in order, but only for clarity&#039;s sake.  There is no reason to think that they would need to be.&lt;/p&gt;

&lt;p&gt;-m&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@olabini</p>

<blockquote>
  <p>In fact, I would say that the above code examples are definitely not represented with maps – since maps are unordered and the code above depends on being sequenced.</p>
</blockquote>

<p>Small point of contention; the maps above are listed in order, but only for clarity&#8217;s sake.  There is no reason to think that they would need to be.</p>

<p>-m</p>]]></content:encoded>
	</item>
	<item>
		<title>By: fogus</title>
		<link>http://blog.fogus.me/2009/07/23/map-as-homoiconic-basis/comment-page-1/#comment-9521</link>
		<dc:creator>fogus</dc:creator>
		<pubDate>Tue, 28 Jul 2009 00:35:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.fogus.me/?p=1920#comment-9521</guid>
		<description>&lt;p&gt;@djspiewak&lt;/p&gt;

&lt;p&gt;Thank you for the thoughtful posts.  You&#039;ve definitely elaborated on my sugared examples.  I tried to make a more readable version, but you&#039;ve captured a more homoiconic illustration.  I would be interesting to take these thoughts further, I only hope that time allows me to do so.&lt;/p&gt;

&lt;p&gt;-m&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@djspiewak</p>

<p>Thank you for the thoughtful posts.  You&#8217;ve definitely elaborated on my sugared examples.  I tried to make a more readable version, but you&#8217;ve captured a more homoiconic illustration.  I would be interesting to take these thoughts further, I only hope that time allows me to do so.</p>

<p>-m</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Spiewak</title>
		<link>http://blog.fogus.me/2009/07/23/map-as-homoiconic-basis/comment-page-1/#comment-9510</link>
		<dc:creator>Daniel Spiewak</dc:creator>
		<pubDate>Mon, 27 Jul 2009 05:00:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.fogus.me/?p=1920#comment-9510</guid>
		<description>&lt;p&gt;Upon further reflection, here&#039;s an example of a somewhat more consistent homoiconic language based on maps.  Well, maybe not more consistent, but certainly more sane:&lt;/p&gt;

&lt;pre&gt;{
  weird-fac:fac[ x:0 ]:0      ;; factorial where fac(0) = 0
  
  fac:{                       ;; simple factorial
    { x:0 }:1
    
    args:if[
      cond:&lt;[ left:args[x] right:0 ]
      then:fac[ x:0 ]
      else:*[
        0:args[x]
        1:fac[
          x:-[ 0:args[x] 1:1 ]
        ] 
      ]
    ]
  }
}

do[
  0:print[ str:&quot;Enter a number: &quot; ]
  1:let[ num:readLine[]
    body:println[
      str:format[ str:&quot;Factorial of %d is %d&quot; 0:num 1:fac[ x:num ] ]
    ]
  ]
]&lt;/pre&gt;

&lt;p&gt;The weird-fac &quot;function&quot; demonstrates remapping existing values.  So, weird-fac is equal to the fac map with the x:0 key remapped to the 0 value.  Map keys can themselves be maps, values or symbols.  Function calls (if you can give it that term) are done by dereferencing the &quot;function&quot; map based on its key.  In the case of a function, that key is most often a map itself, but it can of course be a value as well.&lt;/p&gt;

&lt;p&gt;It&#039;s just an idea, but I think you get the picture.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Upon further reflection, here&#8217;s an example of a somewhat more consistent homoiconic language based on maps.  Well, maybe not more consistent, but certainly more sane:</p>

<pre>{
  weird-fac:fac[ x:0 ]:0      ;; factorial where fac(0) = 0
  
  fac:{                       ;; simple factorial
    { x:0 }:1
    
    args:if[
      cond:&lt;[ left:args[x] right:0 ]
      then:fac[ x:0 ]
      else:*[
        0:args[x]
        1:fac[
          x:-[ 0:args[x] 1:1 ]
        ] 
      ]
    ]
  }
}

do[
  0:print[ str:"Enter a number: " ]
  1:let[ num:readLine[]
    body:println[
      str:format[ str:"Factorial of %d is %d" 0:num 1:fac[ x:num ] ]
    ]
  ]
]</pre>

<p>The weird-fac &#8220;function&#8221; demonstrates remapping existing values.  So, weird-fac is equal to the fac map with the x:0 key remapped to the 0 value.  Map keys can themselves be maps, values or symbols.  Function calls (if you can give it that term) are done by dereferencing the &#8220;function&#8221; map based on its key.  In the case of a function, that key is most often a map itself, but it can of course be a value as well.</p>

<p>It&#8217;s just an idea, but I think you get the picture.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Spiewak</title>
		<link>http://blog.fogus.me/2009/07/23/map-as-homoiconic-basis/comment-page-1/#comment-9509</link>
		<dc:creator>Daniel Spiewak</dc:creator>
		<pubDate>Mon, 27 Jul 2009 03:06:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.fogus.me/?p=1920#comment-9509</guid>
		<description>&lt;p&gt;Ola is right, the language given in the article does not appear to be homoiconic at all.  However, the following could be a simple map-oriented, homoiconic functional language (I hope this &quot;example&quot; is reasonably clear):&lt;/p&gt;

&lt;pre&gt;{ call:letrec name:fac    ;; cheaters way of avoiding fixpoint
  value:{ call:def args:args
    body:{ call:if cond:{ call:&lt;= x:args[x] y:1 }
      then:1
      else:{ call:* 
        0:args[x] 
        1:{ call:fac x:{ call:- 0:args[x] 1:1 } } } } } }&lt;/pre&gt;

&lt;p&gt;Obviously, all of this could have been more elegantly accomplished using Lisp.  That&#039;s because I&#039;m not really exploiting the map data structure in any way.  Also, I suspect that maps aren&#039;t as ideally suited to lambda calculus as are lists.  It deserves some thought...&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Ola is right, the language given in the article does not appear to be homoiconic at all.  However, the following could be a simple map-oriented, homoiconic functional language (I hope this &#8220;example&#8221; is reasonably clear):</p>

<pre>{ call:letrec name:fac    ;; cheaters way of avoiding fixpoint
  value:{ call:def args:args
    body:{ call:if cond:{ call:&lt;= x:args[x] y:1 }
      then:1
      else:{ call:* 
        0:args[x] 
        1:{ call:fac x:{ call:- 0:args[x] 1:1 } } } } } }</pre>

<p>Obviously, all of this could have been more elegantly accomplished using Lisp.  That&#8217;s because I&#8217;m not really exploiting the map data structure in any way.  Also, I suspect that maps aren&#8217;t as ideally suited to lambda calculus as are lists.  It deserves some thought&#8230;</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Ola Bini</title>
		<link>http://blog.fogus.me/2009/07/23/map-as-homoiconic-basis/comment-page-1/#comment-9471</link>
		<dc:creator>Ola Bini</dc:creator>
		<pubDate>Fri, 24 Jul 2009 10:37:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.fogus.me/?p=1920#comment-9471</guid>
		<description>&lt;p&gt;Well, sure. But there is nothing that says code is data in the examples either - and if code is data, it doesn&#039;t say anything about that representation as being map-driven.&lt;/p&gt;

&lt;p&gt;Which goes back to my original point, I&#039;m not sure if it even makes sense to represent code as maps, and I certainly can&#039;t imagine what it would look like - and you have no content in this blog post about it either.&lt;/p&gt;

&lt;p&gt;In fact, I would say that the above code examples are definitely not represented with maps - since maps are unordered and the code above depends on being sequenced.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Well, sure. But there is nothing that says code is data in the examples either &#8211; and if code is data, it doesn&#8217;t say anything about that representation as being map-driven.</p>

<p>Which goes back to my original point, I&#8217;m not sure if it even makes sense to represent code as maps, and I certainly can&#8217;t imagine what it would look like &#8211; and you have no content in this blog post about it either.</p>

<p>In fact, I would say that the above code examples are definitely not represented with maps &#8211; since maps are unordered and the code above depends on being sequenced.</p>]]></content:encoded>
	</item>
</channel>
</rss>

