I'm running Clojure 1.2 on both my Snow Leopard OS X machine and my Ubuntu linux box via the lein repl
command. I am going through the enlive tutorial https://github.com/swannodette/enlive-tutorial/
When I get to the "Third Scrape" tutorial and run this command:
(print-stories)
it works as expected on Ubuntu, but on OS X, it outputs only the first story and then outputs the rest only after I enter some expression, whether it is a number, a (println "hello world"), or whatnot. Something seems to be weird about the way the REPL is working on OS X -- as if the buffer is not flushing its output completely.
I notice that a doseq
macro is used in the print-stories
function. So if I do this:
tutorial.scrape3=> (doseq [x (map extract (stories))] (println x))
I get this output on OSX:
{:summary , :byline , :headline With Stones and Firebombs, Mubarak Allies Attack}
which is only the first item. If I then enter 0
(or any valid expression) and press return, I get the rest of the output:
0
{:summary The Conversation: Long, worthy road to democracy. , :byline , :headline }
{:summary The Frugal Traveler scores a cheap ticket to Malaga, Spain, birthplace of Picasso., :byline , :headline A Taste of Picasso (and Iberian Cuisine)}
{:summary Lay claim to the next great place: four emerging destinations., :byline , :headline Beat the Crowds}
[etc]
I also notice that this behavior is not consistent. Sometimes, nothing is output, and then I can flush it out by typing 0
or something and enter. Sometimes, it flushes out all the output properly.
Does anyone have any ideas?