This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-11-27
Channels
- # adventofcode (1)
- # announcements (4)
- # beginners (120)
- # calva (5)
- # cider (12)
- # clara (3)
- # cljdoc (48)
- # cljs-dev (33)
- # cljsrn (4)
- # clojure (124)
- # clojure-dev (43)
- # clojure-europe (2)
- # clojure-italy (168)
- # clojure-nl (2)
- # clojure-spec (7)
- # clojure-uk (79)
- # clojurescript (50)
- # core-logic (6)
- # cursive (12)
- # datascript (1)
- # datomic (8)
- # devcards (2)
- # emacs (5)
- # events (2)
- # figwheel-main (6)
- # fulcro (18)
- # graphql (42)
- # hyperfiddle (3)
- # jobs (1)
- # luminus (2)
- # nrepl (5)
- # off-topic (59)
- # onyx (5)
- # parinfer (2)
- # pathom (10)
- # pedestal (2)
- # portkey (3)
- # re-frame (24)
- # reagent (6)
- # reitit (54)
- # remote-jobs (1)
- # ring (5)
- # shadow-cljs (75)
- # spacemacs (35)
- # sql (22)
- # tools-deps (16)
- # unrepl (10)
@dnolen what is my best option for instantiating a deftype knowing its name at runtime?
i.e. the equivalent of clojure's (clojure.lang.Reflector/invokeConstructor (Class/forName "my-ns.type") args)
you can't really look anything up dynamically given that :advanced
will have renamed everything
If really pressed, perhaps you could export the positional factory functions for all deftypes you need in advance. That might work if you have a smallish closed set of them.
@bbrinck Since that error message work is rather large, I'm currently pursuing it in a branch, committing WIP as I go. It now has the :macro-syntax-check
phase you pointed out. I'm thinking about trying to at least knock out a phase at a time to see where that leads. See https://gist.github.com/mfikes/cca647f962f38edb599596f8e7bffc43
@thheller hm, maybe that's why I never implemented https://dev.clojure.org/jira/browse/TRDR-57 then
I remember looking into it when the initial port happened but I forgot the reason why that feature was not included
not a terrible loss if we can't do it given that I've only gotten one request for it in 3 years I guess
Same conclusion here https://dev.clojure.org/jira/browse/CLJS-1560?focusedCommentId=42171&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-42171
It might be nice to have static and/or REPL support for this (for dev-time), but users may then expect it to work everywhere...
This ticket seems to explore other interesting ideas on the subject https://dev.clojure.org/jira/browse/CLJS-1328
I believe, the lookup table could be exported into a var wrapped with (delay ...)
this would get elided by DCE if no one referenced it, after requiring tools.reader or something else making use of it, then you would pay the price
I can imagine, it could be in a separate nameaspace, so people could require it on-demand
I'd rather have the user register the reader manually if support is really required for them
yeah, if we're requiring an explicit toggle then it doesn't improve much vs having users register ctors as tagged literals IMO
since tag registration is explicit - I wonder if this isn’t a good case for goog.reflect
and a standard table for lookup
that said, given Transit, it’s not clear to me how popular EDN is anymore as a format
afraid I don't know enough about goog.reflect
/cljs advanced compilation to figure it out myself
FWIW I finally did the split of special-doc-map
to cljs.env
- it took a while I know 😄