Re: need help understanding two issues

2010-06-20 Thread Albert Cardona
Thank you very much Rob and Michal, both issues are clear now. Michael, I agree that the documentation for clojure.set/project could improve. At least now there is your email to be sent around to those like me who don't get it from the very succinct default doc string. Albert -- http://albert.ri

Re: need help understanding two issues

2010-06-19 Thread MichaƂ Marczyk
On 19 June 2010 18:59, Albert Cardona wrote: > 1. How come APersistentMap$KeySet doesn't implement IPersistentSet? Beyond what Rob has already written above, keys works with APersistentMap$KeySeq (note the "q" at the end), not APersistentMap$KeySet. To get at the latter, use (.keySet {:a 1 :b 2})

Re: need help understanding two issues

2010-06-19 Thread Rob Lachlan
I'll take a whack at it. > 1. How come APersistentMap$KeySet doesn't implement IPersistentSet? Because keys and vals are designed to return (lazy) sequences. More important, these two functions return those two sequences in the same order. The laziness avoids having to incur the overhead of cr

need help understanding two issues

2010-06-19 Thread Albert Cardona
Hi all, I have run into the following two issues over the last few days. I would appreciate insight/help/advice: 1. How come APersistentMap$KeySet doesn't implement IPersistentSet? (clojure.set/intersection (keys {2 "two" 4 "four"}) #{2 3}) java.lang.ClassCastException: clojure.lang.APersiste