I just wanted to mention to those interested in the issues raised by this 
thread that a patch for CLJ-1065 was committed to Clojure master today, and is 
part of release clojure-1.5.0-alpha5:

http://dev.clojure.org/jira/browse/CLJ-1065

All of the set and map constructor functions now explicitly allow duplicate set 
elements/map keys.  They handle the duplicates as if by repeated assoc calls, 
and this is mentioned in the doc strings for those functions.

Set and map literals still throw errors if there are duplicate set elements/map 
keys, as was the case before the CLJ-1065 patch was committed.

Andy

On Sep 12, 2012, at 3:22 AM, Rich Hickey wrote:

> 
> On Sep 8, 2012, at 7:38 PM, Andy Fingerhut wrote:
> 
>> Rich:
>> 
>> I'm not sure what you mean by the not-fastest-path possible that exists in 
>> today's Clojure code, so if you get a chance, see if the below is what you 
>> mean.
>> 
>> As far as I can tell (i.e. putting debug println's in the Java code of 
>> RT.map), when someone enters a map literal in, say, a function definition, 
>> and all keys *and* values are compile time constants, it calls RT.map() 
>> while the function is being compiled, but never again when the function is 
>> called.
>> 
>> If I make a similar function with run-time variable keys or values, RT.map() 
>> is called every time the function is invoked.  Each of these calls repeats 
>> the check that the keys are unique.
>> 
>> Do you mean that you want a new code path where if the keys are compile time 
>> constants, but the values are variables at compile-time, then at run time 
>> this map should be created with a method that avoids the unnecessary check 
>> for unique keys?
>> 
> 
> Exactly.
> 
>> And by the word "restore" do you mean to imply that it was this way at one 
>> time before?
>> 
> 
> Nope. It was that fast, but did no compile-time checks.
> 
> Thanks
> 
> Rich
> 
>> 
> 
> -- 
> 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

-- 
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