-
-
Notifications
You must be signed in to change notification settings - Fork 645
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
Pretty-printing expressions yields nil *1, etc. #468
Comments
I'm aware of the current problem and I've been meaning to fix it for a while, but I've been pretty busy at work lately. I'd gladly accept a patch for (1). Option (2) sounds great as well and something like your suggestion is definitely the way to go long-term. I'll have to think a bit more about the details, though. |
PR sent for (1). I'm happy to revisit this once (2) is done. That's the only (reasonable) way pretty-printing in ClojureScript REPLs is ever going to work AFAICT. |
Btw, why can't pretty printing be implemented for ClojureScript? (I don't track its development) |
Let *1 be set properly when pretty-printing, fixes gh-468
My understanding is that cider implements pretty-printing in the REPL and elsewhere by wrapping the expression to be evaluated in an explicit
clojure.pprint/pprint
form (e.g. https://github.com/clojure-emacs/cider/blob/master/cider-repl.el#L554). Naturally, this leaves*1
holdingnil
, something I presume no one likes.I'd like to suggest two options:
(let [x %s] (clojure.pprint/pprint x) x)
, which will leave*1
set properly.cider-repl-handler
can then simply not do anything with:value
, which will ensure that only one printed representation of the evaluated value is seen, e.g.:pr-values
middleware can be modified to provide aset!
-able session-local configuration var so that clients/users can (a) set which function should generate the printed representation of:value
, and (b) set which slot in the response message that representation should put in (since certain printed representations are likely notread
-able, something that:value
strings really should be).I've tweaked my cider locally to do (1), and it works well. Would you like a patch for that?
Further, thoughts on the utility of (2) are welcome.
The text was updated successfully, but these errors were encountered: