[CLJ-2165] #clojure/var tag for transmitting var identity Created: 22/May/17 Updated: 17/Mar/18
|Affects Version/s:||Release 1.9|
|Fix Version/s:||Release 1.10|
|Labels:||print, reader, var|
Currently one can't send vars around in edn. #' is clojure reader specific. Objective is to transmit var identity and bind to same-named var on reading side (a la var serialization support).
Proposed: This is not generic enough to add to edn, so use #clojure/var for tag. Printing may print #clojure/var instead of #' (perhaps via a flag) - needs more assessment. #clojure/var tag reader should be installed in data readers.
|Comment by Christophe Grand [ 11/Jul/17 10:14 AM ]|
Should unnamed vars (eg created by with-local-vars) print to #clojure/var nil or throw an exception? (exception is the print-dup behavior)
|Comment by Steven Yi [ 08/Aug/17 11:49 AM ]|
I think the vartag2.patch has an issue in that the test for print-var-tagged in missing an assertion. I think it is supposed to have something like:
(is (and ...))
within the last let-binding.
|Comment by Ghadi Shayban [ 17/Mar/18 2:21 PM ]|
Printing unnamed vars has little utility (nothing distinguishes them from each other without knowing their code context), seems like it would be fine to have #clojure/var nil or #clojure/var :unnamed