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

+1 vote
in ClojureScript by
retagged by

There is currently a difference between Clojure and ClojureScript in how the readers handle the provided :line and :column meta for forms.

In Clojure:

Clojure 1.11.1
user=> ^{:line 40} (defn foo [])
user=> (-> #'foo meta :line)

while in ClojureScript:

ClojureScript 1.11.60
cljs.user=> ^{:line 40} (defn foo [])
cljs.user=> (-> #'foo meta :line)

I think this is specially important in ClojureScript where there isn't a way of modifying vars meta.

Tooling like editors, when sending forms to the repl, can use this mechanism to add for example line information when they know it. Keeping this information is important since other stuff like clojure.repl/source depends on it, which currently breaks as soon as you eval a form from your editor.

I added a PR here with one possible solution https://github.com/clojure/clojurescript/pull/210

Please log in or register to answer this question.