This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-11
Channels
- # announcements (7)
- # babashka (125)
- # beginners (45)
- # calva (2)
- # cider (25)
- # clj-kondo (8)
- # clojure (123)
- # clojure-australia (4)
- # clojure-nl (5)
- # clojure-spec (3)
- # clojurescript (15)
- # community-development (6)
- # conjure (3)
- # datomic (6)
- # depstar (1)
- # exercism (1)
- # figwheel-main (5)
- # fulcro (37)
- # honeysql (3)
- # jobs-discuss (1)
- # lsp (79)
- # off-topic (24)
- # pathom (6)
- # schema (1)
- # shadow-cljs (35)
- # spacemacs (9)
- # sql (8)
- # tools-deps (6)
- # vim (9)
- # vrac (1)
- # xtdb (5)
Hello! given a clojuresecript vector stored into the global js var _vec
, why does _vec.constructor.name
in JS return ""
instead of something like "PersistentVector"
? Is there any other way to see that what clojure data structure it is?
(Use case: In my cljs code I actually ask for (type x)
which returns function (meta,cnt,shift,root,tail,__hash){ ...}
- which I know is a cljs vector but somehow type
does not pick it up so I am looking for alternative ways. This is for the purpose of error logging.) Thanks!
@holyjak the .cljs$lang$ctorStr
property (instead of .name
) should contain the full name in development builds. :advanced
will usually remove that, or definitely rename it
I've been trying to port a clj library to cljs, and part of it is a macro that uses resolve. When a macro is operating on cljs or cljc code, there’s no way to access either the metadata or the value of the var, even if it's in a cljc namespace?
Say, for example, an eql expression that has symbols that can be resolved to vars embedded in it. I’d like to inline those values at compile time.
Thinking the only way to do this is to convert those symbols to keywords at runtime, and match them up with some kind of map supplied when a function is invoked.
https://github.com/clj-pour/pour/blob/master/src/pour/compose.clj#L63 macro in question
you can use https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/analyzer/api.cljc#L200
Thanks, I tried that but it doesn't give me the values, sadly. Just the analyser meta data
well yes, the actual value only exists in JS at runtime so thats not accessible during compilation
Thought so. Thanks anyway. Quite a drawback this - wonder if compiling inside a js runtime instead of a jvm would help..