Re: gen-class and need for fully qualified class names

2021-10-01 Thread Elias Zaretsky
Jon, The ns macro is expanded such that the (gen-class) form appears before any (import) calls. So unqualified names are not available yet. There are more details in this StackOverflow answer I posted a while back. Thanks, Elias. On Thursday, Sep

Re: my first clojure "wat" moment - misunderstanding or bug?

2013-10-02 Thread Elias Zaretsky
Are you using Java 6 by any chance? This issue may be due to a gotcha in java.util.EnumMap. The implementation of the entry set iterator in EnumMap in Java 6 is unorthodox [1]. Its next() method always returns the same object, which is mutated to "point" to different entries in the map as the i

Re: my first clojure "wat" moment - misunderstanding or bug?

2013-10-03 Thread Elias Zaretsky
e. If you don't mind me asking, how did you even > know about this behavior? This isn't the type of information you typically > see on Hacker News, albeit much more helpful! :) > > On Wednesday, October 2, 2013 7:17:40 PM UTC-7, Elias Zaretsky wrote: >> >> Are you usi

Re: Create map from vector of keywords and other items

2013-02-20 Thread Elias Zaretsky
And this is mine (defn keycollect-too [key-fn coll] (let [not-key (complement key-fn)] (loop [[k & more] coll, res (transient {})] (let [[vv rr] (split-with not-key more)] (if-not k (persistent! res) (recur rr (assoc! res k (vec vv (keycollect-too k