This expression causes a stack overflow, instead evaluating to 9999:
(first (filter #(= 9999 %) (range)))
These expressions should be equivalent, and do not cause a stack overflow:
(first (filter #(= 9999 %) (vec (take 10000 (range)))))(some #(when (= 9999 %) %) (range))
Thus, it seems as if filter cannot handle an input that's already lazy.
More elaborate version: https://www.refheap.com/18490
See also this google group thread: https://groups.google.com/forum/#!topic/clojurescript/3NlQOxwNrRc
Please consider using ssl on dev.clojure.org ##
Tested in firefox 21.0 and chromium 27.0.1453.93
This expression causes a stack overflow, instead evaluating to 9999:
(first (filter #(= 9999 %) (range)))
These expressions should be equivalent, and do not cause a stack overflow:
(first (filter #(= 9999 %) (vec (take 10000 (range)))))
(some #(when (= 9999 %) %) (range))
Thus, it seems as if filter cannot handle an input that's already lazy.
More elaborate version: https://www.refheap.com/18490
See also this google group thread: https://groups.google.com/forum/#!topic/clojurescript/3NlQOxwNrRc
Please consider using ssl on dev.clojure.org ##