Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not all println calls show output #241

Open
lspector opened this issue Dec 25, 2015 · 3 comments
Open

Not all println calls show output #241

lspector opened this issue Dec 25, 2015 · 3 comments

Comments

@lspector
Copy link

A simple call to println produces two output fields, one for the printed output and one for the return value. That's great. A call to doseq with a body that includes call to println seems to work fine too, as in (doseq [x (range 10)] (println x)).

However, this shows only the return value, with the printed stuff not being shown anywhere:

(repeatedly 20 #(do (println 1) 2))

@JonyEpsilon
Copy link
Owner

Isn't that the expected behaviour? I would have guessed that repeatedly would generate an unrealised lazy seq, so none of the print functions will get called unless something realises the seq.

@lspector
Copy link
Author

It's strange, because the sequence is realized, as we know because we see (2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2) in the field for the return value. We wouldn't see that if it was an unrealized lazy sequence. I assume it is being realized by the REPL.

However, I've now tried (doall (repeatedly 20 #(do (println 1) 2))) and this does show the additional field with the results of the println calls. This seems really odd to me.

@JonyEpsilon
Copy link
Owner

Huh, good point. That is very weird.

Looking in the debugger, I don't see any out messages coming back from the nREPL server, so I suspect the bug might be on that side of things (fine example of passing the buck there!)

But what's weird is that it does print the values, even without the doall in the command line REPL. And this, like Gorilla, is supposed to be just a client for the nREPL server, so the behaviour should be the same.

Will have to ponder on this some more ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants