Hello,

As I work through the Programming Clojure book, I play with the code I
enter into the REPL.
I just want to say that I am infinitely enjoying using the REPL in
Counterclockwise. It does make multi-line code so much nicer.

I entered this.
(defn whole-numbers [] (iterate inc 1))
(take 10 (for [n (whole-numbers) :when (> 100 n)] n))

As expected it outputs the desired results.
This is after my first experiment which ended in putting the REPL into
an infinite loop which required force quitting.

(take 10 (for [n (whole-numbers) :when (> 10 n)] n))

As I had enter the above in a REPL that I had to quit. I tried it
again after entering the successful command at the top. And I wondered
why this one was infinite. Then I noticed that I had a (take 10 ...)
which would never be satisfied and seq which was infinite and never
cease iterating.

So while I was watching the REPL churn up one of my two cores, I had a
thought. I re-entered the successful command again. And the REPL took
it and executed it just fine.

I continued for a while executing both the infinite and finite
versions of the above into the REPL. It just kept on going. It took
all the cpu I could give, but kept going. At some point it ran out of
resources and exited. This was not unexpected by me.

Awesome job guys.

Now that I had my perverse pleasure. Is there a way to force quit a
command/job rather than the REPL?

Thanks again for a totally awesome tool and language.

Jimmie

-- 
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

Reply via email to