This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-02
Channels
- # arachne (8)
- # beginners (48)
- # carry (4)
- # chestnut (2)
- # cider (12)
- # cljs-dev (3)
- # clojure (28)
- # clojure-belgium (2)
- # clojure-brasil (1)
- # clojure-greece (4)
- # clojure-russia (6)
- # clojure-spec (1)
- # clojurescript (32)
- # cursive (11)
- # defnpodcast (2)
- # euroclojure (1)
- # hoplon (43)
- # jobs (2)
- # jobs-rus (10)
- # off-topic (11)
- # om (32)
- # onyx (28)
- # overtone (5)
- # parinfer (4)
- # planck (11)
- # protorepl (2)
- # reagent (2)
- # spacemacs (3)
- # yada (5)
so i dug in a little deeper and it appears that a var as val nested in a ^{...}
meta block is added as the symbol itself and not what it resolves to. <-- @mfikes
oooh, this seems to work:
cljs.user=> (def a nil)
#'cljs.user/a
cljs.user=> (def a (with-meta 'a {:doc doc-string}))
#'cljs.user/a
cljs.user=> (meta a)
{:doc "docstring"}
cljs.user=> doc-string
"docstring"
I think I could use the above fact with intern
to make this happen but alas intern
doesn't seem to be supported on CLJS.
@johanatan: planck.core/intern
exists if it helps 🙂
cljs.user=> (def doc-string "docstring")
#'cljs.user/doc-string
cljs.user=> (planck.core/intern 'cljs.user (with-meta 'a {:doc doc-string}) nil)
#'cljs.user/a
cljs.user=> a
nil
cljs.user=> (doc a)
{:ns cljs.user, :name a, :doc docstring, :forms nil, :arglists nil}
-------------------------
cljs.user/a
docstring
nil