Welcome! Please see the About page for a little more info on how this works.

0 votes
in REPL by

It's quite difficult when writing REPL client tooling to know whether it's safe to attach the clojure.core/eval-file and clojure.core/line metadata to the forms being sent. You can make an approximation based on the start character, but it doesn't seem like a reliable approach to this problem.

An example of where the metadata fails is if you're sending a number or string to be evaluated.

1 Answer

+1 vote
by

I'm not entirely sure if you're asking for this, but it might be useful:

In edamame I check if something can carry metadata like this:

?(:clj (instance? clojure.lang.IObj obj)
  :cljs (satisfies? IWithMeta obj))
by
One problem with this from a REPL perspective is that you aren't necessarily in the same JVM as the form.  Your notion of the form is just a string that you send.
...