1. I have a function that returns a set of unique words, get- wordlist() 2. (I think) this function returns a set, but the returned coll throws an UnsupportedOperationException if I try to count it 3. The weird thing is that the ancestors seem to be the same as with a set, #{}
Details: ---------- A. Method (defn get-wordlist ([] (set ["a" "b" "c"])) ([f] (set (read-lines f))) ([a & rest] (set (cons a rest)))) B. Ancestors look to be the same as for #{} user=> (ancestors (class (toddg.spell/get-wordlist))) #{java.io.Serializable clojure.lang.IPersistentSet java.lang.Object clojure.lang.Seqable clojure.lang.IPersistentCollection clojure.lang.IObj java.util.Set clojure.lang.AFn java.lang.Runnable clojure.lang.IFn clojure.lang.IEditableCollection java.util.Collection clojure.lang.APersistentSet java.util.concurrent.Callable clojure.lang.Counted clojure.lang.IMeta java.lang.Iterable} user=> (ancestors (class #{ "a" "b"})) #{java.io.Serializable clojure.lang.IPersistentSet java.lang.Object clojure.lang.Seqable clojure.lang.IPersistentCollection clojure.lang.IObj java.util.Set clojure.lang.AFn java.lang.Runnable clojure.lang.IFn clojure.lang.IEditableCollection java.util.Collection clojure.lang.APersistentSet java.util.concurrent.Callable clojure.lang.Counted clojure.lang.IMeta java.lang.Iterable} C. Method throws UOE when I try and count the set (count toddg.spell/get-wordlist) java.lang.UnsupportedOperationException: count not supported on this type: spell$get_wordlist__827 (NO_SOURCE_FILE:0) D. This works on a normal set... user=> (count #{ "a" "b"}) 2 Note: the reason I'm trying to count the set is b/c that's what the set methods do (intersection, etc.), and that's what I'm ultimately trying to do. So, what am I missing here, and how would I better debug this in the future? -Todd -- 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