Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[New REPL Window] REPL window freezes when the evaluation takes a long time #128
When evaluating something that takes ”a sufficiently long time” to evaluate, the REPL window freezes. Evaluating the same thing inline works.
** REPRO **
Below is a naïve implementation of Eratosthenes Sieve. When evaluating the top-level form in that
(defn not-divisible-by [n d] (when-not (integer? (/ n d)) n)) (defn sieve [n] (loop [found-primes  candidates (range 3 (inc n))] (let [highest-found-prime (last found-primes) remaining (->> candidates (map #(not-divisible-by % highest-found-prime)) (remove nil?))] (if (= remaining candidates) (concat found-primes candidates) (recur (conj found-primes (first remaining)) (rest remaining)))))) (comment (sieve 1000000))
Again, evaluating the same form inline (
Also, closing the REPL window and reopening it again works as a fix for getting the window back in operation.
Update: It doesn't seem to be about how long time the evaluation takes. If I wrap my run of this test in
eratosthenes=> (time (str "mine: " (count (sieve-refined 1000000)) " primes")) "Elapsed time: 7845.699169 msecs" "mine: 78498 primes"
I do get the prompt back (even running this for primes up to 1,000,000).
So now I am guessing it is that the REPL Window chokes on the size of the results.