This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-21
Channels
- # aws (3)
- # beginners (98)
- # boot (18)
- # cider (6)
- # cljsrn (8)
- # clojure (56)
- # clojure-dev (11)
- # clojure-spec (3)
- # clojure-turkiye (1)
- # clojurescript (34)
- # core-async (42)
- # cursive (8)
- # datascript (79)
- # defnpodcast (2)
- # dirac (13)
- # emacs (14)
- # jobs-discuss (3)
- # onyx (27)
- # overtone (1)
- # pedestal (1)
- # protorepl (1)
- # re-frame (40)
- # reagent (5)
- # unrepl (29)
- # vim (3)
Perhaps the problem for which the solution is "add #clojure/var reader support" is obvious to most others, but is it described anywhere?
Yep I am with above ☝️ , in particular, why this kind of serialization is needed as part of the reader, maybe I am missing some useful use case here 😀
As an example, consider a configuration file that contains a reference to a function that does some kind of initializatipn. Right now you'd probably save a symbol, and then have some code on the read side that resolved the symbol. With var tag support you could just serialize the var, and on read it will be a runnable thing.
would (read-string "#var clojure.core/+)
return (var c.c/+)
or #'c.c/+
(as in, the var object)?
i'm assuming the latter to avoid the need for eval
but then that means that printing vars using that tagged literal could be a breaking change
The var - why would that be breaking?
The tag will be #clojure/var btw
For the printing options, this is the root of the request for comment in the clojure-dev mailing list
it would be breaking if what prints now as #'foo
changed to #clojure/var foo
, as reading it back would change from reading (var foo)
to reading a var object