On Feb 17, 1:34 pm, David Powell <djpow...@djpowell.net> wrote: > > Lazy sequences implement java.util.List, which has a .size method. > > clojure.lang.APersistentVector/doEquiv (and doEquals) attempts to > > optimize when it sees it is being compared to something with a .size > > or .count method, by comparing sizes before doing the hard work of > > comparing elements. But this is not much of an optimization when > > the .size method is infinitely slow! Perhaps an additional test for > > lazy sequences should be added to these methods, but I'm certain the > > issue is more complicated than it appears after my cursory > > exploration, so that may well have other issues. > > Hmm, I suppose the Java equivalent of a clojure.core/realized? check > could be done first, and the count/size not compared if the collection > isn't realized? > > So basically, insert a check for: > (obj instanceof IPending && !((IPending)obj).isRealized()) >
Not really viable. What if the first item is realized and the rest aren't? -- 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