<?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: Hash Tables and a Wee Bit of Sugar in Common Lisp</title>
	<atom:link href="http://mikael.jansson.be/log/hash-tables-and-a-wee-bit-of-sugar-in-common-lisp/feed" rel="self" type="application/rss+xml" />
	<link>http://mikael.jansson.be/log/hash-tables-and-a-wee-bit-of-sugar-in-common-lisp</link>
	<description>The views of a hacker, hobby chef &#38; adrenaline junkie.</description>
	<pubDate>Tue, 07 Feb 2012 11:56:34 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Mikael Jansson &#187; Blog Archive &#187; Jag, en arg LCHF-människa?</title>
		<link>http://mikael.jansson.be/log/hash-tables-and-a-wee-bit-of-sugar-in-common-lisp/comment-page-1#comment-29660</link>
		<dc:creator>Mikael Jansson &#187; Blog Archive &#187; Jag, en arg LCHF-människa?</dc:creator>
		<pubDate>Thu, 05 Mar 2009 20:21:21 +0000</pubDate>
		<guid isPermaLink="false">http://mikael.jansson.be/journal/2009/01/hash-tables-and-a-wee-bit-of-sugar-in-common-lisp#comment-29660</guid>
		<description>[...] Hash Tables and a Wee Bit of Sugar in Common Lisp [...]</description>
		<content:encoded><![CDATA[<p>[...] Hash Tables and a Wee Bit of Sugar in Common Lisp [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mikael Jansson</title>
		<link>http://mikael.jansson.be/log/hash-tables-and-a-wee-bit-of-sugar-in-common-lisp/comment-page-1#comment-29108</link>
		<dc:creator>Mikael Jansson</dc:creator>
		<pubDate>Fri, 06 Feb 2009 12:38:13 +0000</pubDate>
		<guid isPermaLink="false">http://mikael.jansson.be/journal/2009/01/hash-tables-and-a-wee-bit-of-sugar-in-common-lisp#comment-29108</guid>
		<description>Property lists are less efficient than hash-tables for larger sizes.

But you're missing the point. Lisp is the &lt;em&gt;programmable&lt;/em&gt; programming language. 

You need new syntax? Add it! Try doing the same thing in Python.

In fact, add &lt;code&gt;do&#46;..while&lt;/code&gt; to your current version of Python as portable Python code so people won't have to replace their Python with your Python.

In Lisp, that's just a &lt;code&gt;defmacro&lt;/code&gt; away. How much work is it in &lt;em&gt;your&lt;/em&gt; language?</description>
		<content:encoded><![CDATA[<p>Property lists are less efficient than hash-tables for larger sizes.</p>
<p>But you&#8217;re missing the point. Lisp is the <em>programmable</em> programming language. </p>
<p>You need new syntax? Add it! Try doing the same thing in Python.</p>
<p>In fact, add <code>do&#46;..while</code> to your current version of Python as portable Python code so people won&#8217;t have to replace their Python with your Python.</p>
<p>In Lisp, that&#8217;s just a <code>defmacro</code> away. How much work is it in <em>your</em> language?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bearophile</title>
		<link>http://mikael.jansson.be/log/hash-tables-and-a-wee-bit-of-sugar-in-common-lisp/comment-page-1#comment-29107</link>
		<dc:creator>bearophile</dc:creator>
		<pubDate>Fri, 06 Feb 2009 12:28:57 +0000</pubDate>
		<guid isPermaLink="false">http://mikael.jansson.be/journal/2009/01/hash-tables-and-a-wee-bit-of-sugar-in-common-lisp#comment-29107</guid>
		<description>If that nice syntax already exists, what's the point of this whole blog post?</description>
		<content:encoded><![CDATA[<p>If that nice syntax already exists, what&#8217;s the point of this whole blog post?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mikael Jansson</title>
		<link>http://mikael.jansson.be/log/hash-tables-and-a-wee-bit-of-sugar-in-common-lisp/comment-page-1#comment-29105</link>
		<dc:creator>Mikael Jansson</dc:creator>
		<pubDate>Fri, 06 Feb 2009 10:36:27 +0000</pubDate>
		<guid isPermaLink="false">http://mikael.jansson.be/journal/2009/01/hash-tables-and-a-wee-bit-of-sugar-in-common-lisp#comment-29105</guid>
		<description>The key is to create a readable notation for hash tables. That way, everyone will be able to understand that it is, indeed, a hash table.

Adding separators for the sake of readability is trivial, it is just a simple matter of skipping that item when deconstructing the list.  Semicolon is not possible, as it's reserved for comments.

If you're not picky about the keys, however, there is already built-in syntax for mappings, called &lt;em&gt;property lists&lt;/em&gt;:

&lt;pre&gt;&lt;br /&gt;
* (defvar *presidents* (list :abe 25 :lincoln 26))&lt;br /&gt;
* (get *presidents* :abe)&lt;br /&gt;
25&lt;br /&gt;
&lt;/pre&gt;

where &lt;code&gt;(list)&lt;/code&gt; would be the empty mapping.</description>
		<content:encoded><![CDATA[<p>The key is to create a readable notation for hash tables. That way, everyone will be able to understand that it is, indeed, a hash table.</p>
<p>Adding separators for the sake of readability is trivial, it is just a simple matter of skipping that item when deconstructing the list.  Semicolon is not possible, as it&#8217;s reserved for comments.</p>
<p>If you&#8217;re not picky about the keys, however, there is already built-in syntax for mappings, called <em>property lists</em>:</p>
<pre>
* (defvar *presidents* (list :abe 25 :lincoln 26))
* (get *presidents* :abe)
25
</pre>
<p>where <code>(list)</code> would be the empty mapping.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bearophile</title>
		<link>http://mikael.jansson.be/log/hash-tables-and-a-wee-bit-of-sugar-in-common-lisp/comment-page-1#comment-29102</link>
		<dc:creator>bearophile</dc:creator>
		<pubDate>Fri, 06 Feb 2009 10:23:38 +0000</pubDate>
		<guid isPermaLink="false">http://mikael.jansson.be/journal/2009/01/hash-tables-and-a-wee-bit-of-sugar-in-common-lisp#comment-29102</guid>
		<description>The following syntax is bad, because there's no guide for the eye to tell apart pairs:
({} 7 5 5 55 2 15 25 5 1 9 5 11 57 9)
{} is ugly as function name, better something like dict or hash or make-hash something else.
Can some separator be added? Is this possible?
(dict 7 5; 5 55; 2 15; 25 5; 1 9; 5 11; 57 9)
A possible syntax for the empty hash:
(dict)
Finally, a really important thing the author here has missed is that such hash syntax has to become standard, so everyone uses it, and you can understand it as soon as you see it. If everyone re-invents something different it's nearly useless.</description>
		<content:encoded><![CDATA[<p>The following syntax is bad, because there&#8217;s no guide for the eye to tell apart pairs:<br />
({} 7 5 5 55 2 15 25 5 1 9 5 11 57 9)<br />
{} is ugly as function name, better something like dict or hash or make-hash something else.<br />
Can some separator be added? Is this possible?<br />
(dict 7 5; 5 55; 2 15; 25 5; 1 9; 5 11; 57 9)<br />
A possible syntax for the empty hash:<br />
(dict)<br />
Finally, a really important thing the author here has missed is that such hash syntax has to become standard, so everyone uses it, and you can understand it as soon as you see it. If everyone re-invents something different it&#8217;s nearly useless.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mikael Jansson</title>
		<link>http://mikael.jansson.be/log/hash-tables-and-a-wee-bit-of-sugar-in-common-lisp/comment-page-1#comment-29101</link>
		<dc:creator>Mikael Jansson</dc:creator>
		<pubDate>Fri, 06 Feb 2009 09:34:33 +0000</pubDate>
		<guid isPermaLink="false">http://mikael.jansson.be/journal/2009/01/hash-tables-and-a-wee-bit-of-sugar-in-common-lisp#comment-29101</guid>
		<description>I forgot about the second version which is indeed less verbose than what I wrote.

The point was that without syntactic sugar, i.e., your first version, you'd have to write it out fully.  In Lisp, where you don't have shortcuts, it would be enough to sprinkle some grains on the basic functionality and come up with something fairly closely resembling the native Python &lt;code&gt;{}&lt;/code&gt; syntax. Or, like I concluded, a reader macro.

Which is to say, while Lisp has little sugar, it allows you to invent your &lt;em&gt;own preferred&lt;/em&gt; syntax, making the original posts' argument a moot point in practice.</description>
		<content:encoded><![CDATA[<p>I forgot about the second version which is indeed less verbose than what I wrote.</p>
<p>The point was that without syntactic sugar, i.e., your first version, you&#8217;d have to write it out fully.  In Lisp, where you don&#8217;t have shortcuts, it would be enough to sprinkle some grains on the basic functionality and come up with something fairly closely resembling the native Python <code>{}</code> syntax. Or, like I concluded, a reader macro.</p>
<p>Which is to say, while Lisp has little sugar, it allows you to invent your <em>own preferred</em> syntax, making the original posts&#8217; argument a moot point in practice.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bearophile</title>
		<link>http://mikael.jansson.be/log/hash-tables-and-a-wee-bit-of-sugar-in-common-lisp/comment-page-1#comment-29100</link>
		<dc:creator>bearophile</dc:creator>
		<pubDate>Fri, 06 Feb 2009 09:26:57 +0000</pubDate>
		<guid isPermaLink="false">http://mikael.jansson.be/journal/2009/01/hash-tables-and-a-wee-bit-of-sugar-in-common-lisp#comment-29100</guid>
		<description>In Python the syntax for dicts it just:
&lt;pre&gt;{&#039;Lincoln&#039;: 25, &#039;Abe&#039;: 26}&lt;/pre&gt;
Or:
&lt;pre&gt;dict(Abe=26, Lincoln=25)&lt;/pre&gt;
You never write:
&lt;pre&gt;dict([(&#34;Abe&#34;, 26), (&#34;Lincoln&#34;, 25)])&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>In Python the syntax for dicts it just:</p>
<pre>{&#039;Lincoln&#039;: 25, &#039;Abe&#039;: 26}</pre>
<p>Or:</p>
<pre>dict(Abe=26, Lincoln=25)</pre>
<p>You never write:</p>
<pre>dict([(&quot;Abe&quot;, 26), (&quot;Lincoln&quot;, 25)])</pre>
]]></content:encoded>
	</item>
</channel>
</rss>

