Hi.

Am 19.08.2010 um 22:14 schrieb Nicolas Oury:

>> in because I was getting null pointer exceptions when the string was
>> null. What is the difference between {:count 1 :words (list words)}
>> and a hash-map? I was under the impression that {} created a hash.
>> 
> I just find it easier to read because it looks like a value and not a
> function call.

Another difference is that in this case it creates not a hash map but an array 
map. Rule of thumb: up to 8 keys => array map, more than 8 => hash map. The 
array map is simply a short alist, not a full blown hash map. For such small 
maps this is faster than pulling at the hash cannon. So the difference is not 
limited to syntax alone.

Sincerely
Meikel

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to