This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-04
Channels
- # announcements (25)
- # babashka (7)
- # beginners (52)
- # calva (29)
- # clara (1)
- # clj-kondo (4)
- # cljs-dev (55)
- # clojure (86)
- # clojure-europe (5)
- # clojure-finland (1)
- # clojure-france (1)
- # clojure-italy (1)
- # clojure-nl (1)
- # clojure-uk (57)
- # clojurescript (33)
- # conjure (107)
- # cursive (20)
- # datomic (37)
- # emacs (23)
- # events (13)
- # fulcro (67)
- # helix (73)
- # jobs-discuss (22)
- # lambdaisland (1)
- # leiningen (32)
- # malli (2)
- # meander (9)
- # mid-cities-meetup (1)
- # observability (1)
- # off-topic (14)
- # overtone (3)
- # pathom (39)
- # re-frame (22)
- # reagent (13)
- # reitit (13)
- # shadow-cljs (52)
- # sql (15)
- # tools-deps (29)
- # vim (11)
Relatively new to Calva, I'm wondering why (flush) doesn't actually flush stdout to the output panel during (nREPL) evaluation of a form. I've observed this in situations where the evaluation takes some time (e.g. waiting for IO) or evaluation is paused in the debugger. When an exception gets thrown, what was printed before never even appears (unless I catch the exception within the form of course). Is there anything else I can do to force the flush to the output panel after all? Or is this actually an nREPL issue?
Consider this form (simplest use case I can think of):
(do
(println "hello world")
(flush)
(/ 1 0))
When, connected to the nREPL, I evaluate it, 'hello world' is never printed.
I find that strange (even when I leave out the flush). Am I wrong to expect the output?(I am looking at the 'Calva says' output panel here. With the above form it does print the ArithmeticException. When I leave out the (/ 1 0)
, "hello world" is printed as expected (either with or without the flush.)
So, in my mind 'flush' is not the issue, but some kind of stdout swapping is. I hoped it would ring a bell. 🙂
I've noticed the repl window seems to print output "as it's printed" but the Calva says window waits until execution completes (or does not print like in this case I suppose). This may have something to do with streaming output with nrepl (which Calva does not do, but I think Cider does). We have "enable using nrepl in streaming mode" on the todo list @pez
It may be related to the :nrepl.middleware.print/stream?
optional param to the eval
nrepl operation
Sounds promising! 🙂 The issue I opened: https://github.com/BetterThanTomorrow/calva/issues/638
Thanks. I will!
Has anyone seen this on 2.0.97
? Activating extension 'betterthantomorrow.calva' failed: Cannot read property '0' of undefined.