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

Lost result and exceptions with cider #31

Closed
danskarda opened this issue Sep 29, 2014 · 3 comments
Closed

Lost result and exceptions with cider #31

danskarda opened this issue Sep 29, 2014 · 3 comments

Comments

@danskarda
Copy link

Recently Emacs Cider changed behavior of eval expression. It internally
uses nrepl load-file instead of eval. This works fine for Clojure, but
it breaks ClojureScript evaluation. User cannot see result of his
expression and even exceptions are lost.

The reason for the bug is difference between CLJ and CLJS load function.
While CLJ load returns last expression, ClojureScript returns nil.

It would be dangerous to change CLJS load function itself. CLJS does not
have variables and last file expression (def x (complex-value)) would
result in performance penalty due to printing of complex value.

I propose workaround to modify piggieback to return value of last expression in load-file. This would fix the issue and give us more time solve in better way: find why cider needs load-file instead of eval and update eval to meet cider needs.

For more details see clojure-emacs/cider#830

@cemerick
Copy link
Collaborator

I replied @ clojure-emacs/cider#830 (comment), as the particular UX of "eval-expr-at-point" seems to be the real driver.

Thank you for your efforts. The patch @ #32 isn't bad; I just think it's furthering a hack that, in hindsight, I shouldn't have suggested in the first place.

If someone would like to work on getting piggieback's eval to support optional file/line/column, that would be a great way to prototype the interface prior to bringing it all the way back to nREPL itself for Clojure.

@bbatsov
Copy link
Contributor

bbatsov commented Dec 5, 2014

I mentioned this on the PR and I'll mention it here as well - isn't supporting in-ns during load-file a good idea in general?

@cemerick
Copy link
Collaborator

The work on the new-cljs-repl branch, currently available in 0.2.0-SNAPSHOT, is effectively a rewrite due to the new ClojureScript REPL API, etc. Closing all issues filed against 0.1.x; most (or all) of them should be resolved and/or irrelevant.

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

3 participants