[load-file] Reimplement load-file again#391
Conversation
095d229 to
8bcf8c8
Compare
f0a24e1 to
2f409f7
Compare
| * `:column` The column number in [file] at which [code] starts. | ||
| * `:eval` A fully-qualified symbol naming a var whose function value will be used to evaluate [code], instead of ``clojure.core/eval`` (the default). | ||
| * `:file` The path to the file containing [code]. ``clojure.core/\*file*`` will be bound to this. | ||
| * `:file-name` Name of source file, e.g. io.clj |
There was a problem hiding this comment.
My main concern with the PR is that now looks a bit strange that we have a :file param and a :file-name param. Perhaps we should either rename the old param with a more descriptive name (as an alias, keeping backwards compatibility) or expand the description about the need for both.
There was a problem hiding this comment.
I'll edit the docs. Renaming, even with an compatibility alias, might be too much for the holy eval. Maybe, one day, we can do a sweeping take on it where we can clean up all the cruft – rename it from interruptible-eval? (gasp!) Maybe in nREPL 2?
There was a problem hiding this comment.
Perhaps. I'm mostly concerned about this from the perspective of the people looking at the current implementation as the spec, but I guess we can do a cleaner "official spec" around nREPL 2 as well.
But I agree that down the road we can revisit the name of the eval middleware and potentially the need for load-file as a separate op.
2f409f7 to
f042780
Compare
|
Overall the code changes look good to me, but you'll have to dogfood them for a while before we can merge this, given the the relative importance of this functionality. I always start with |
|
So, you are saying that you rely on |
This - I was just sharing how I normally use |
20e5403 to
3a51f8b
Compare
3a51f8b to
79af59f
Compare
|
@bbatsov I'm going to merge this and publish an alpha1 release, just need a thumbs up from @ericdallo. On my side, nothing has broken in the days I've been using this. |
|
Sounds good to me. |
This is the first piece of the jigsaw puzzle called "how to retain the debugger instrumentation during
C-c C-k" (see clojure-emacs/cider-nrepl#946, https://clojurians.slack.com/archives/C04CAKAGADU/p1757684821897969).To make it possible for the debugger to instrument forms when doing
C-c C-kwe have to abandon theCompiler/loadapproach forload-filemiddleware and instead let theinterruptible-evalmiddleware be the driver for everything. Interruptible-eval must read through the whole file form by form and call the custom eval function on each form.By doing this there are a few risks:
load-filewill work, but I tried to make it as resemblingCompiler/loadas possible.nrepl.helpers/load-file-command. This looks like a command-line REPL affordance to load files using the old old way. There is no mention of it in the documentation, and no occurance of using this funciton on Github. I'd just remove it and wait for anybody to complain. If this is still useful to somebody, we can provide a better helper for that.Don't need to merge this yet as this is experimental, I should definitely dogfood this, and backwards-compatible changes are required in cider-nrepl too.