https://clojurians.slack.com/archives/C04CAKAGADU/p1757685501508859?thread_ts=1757684821.897969&cid=C04CAKAGADU
It's my understanding that there's no way to set the source name and line number without using Compiler/load. It would be great to be able to include meta data like source, line, col, and more when evaling individual forms. Specifically, this comes up when trying to map exceptions and https://docs.oracle.com/en/java/javase/21/docs/api//java.base/java/lang/StackTraceElement.html back to source code.
One simple example of the difference between cider-eval-defun-at-point and cider-load-buffer
(throw (Exception. "This is from cider-eval-defun-at-point"))
Execution error at com.phronemophobic.easel/eval123716 (REPL:1263).
This is from cider-eval-defun-at-point
(throw (Exception. "This is from cider-load-buffer"))
Execution error at com.phronemophobic.easel/eval125489 (easel.clj:1263).
This is from cider-load-bufferThis is already fixed in nREPL (not released yet), whatcha gonna do 😁 https://github.com/nrepl/nrepl/pull/385
@alexyakushev is eval-fn usually set? I assume this doesn't work with eval and you need to use Compiler/eval?
I think we only use eval-fn in load-file middleware, and only started doing that recently
It works with regular eval
If you open the sources for Compiler.load, binding the dynvars is the only interesting thing it does.
ok, interesting. Thanks for the tip