This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-20
Channels
- # aws (7)
- # bangalore-clj (2)
- # beginners (64)
- # boot (34)
- # cider (1)
- # cljs-dev (8)
- # cljsrn (22)
- # clojure (268)
- # clojure-greece (2)
- # clojure-italy (8)
- # clojure-quebec (1)
- # clojure-russia (5)
- # clojure-spec (7)
- # clojurescript (7)
- # consulting (1)
- # cursive (184)
- # data-science (1)
- # datascript (18)
- # datomic (54)
- # dirac (1)
- # emacs (17)
- # graphql (1)
- # klipse (2)
- # leiningen (1)
- # off-topic (17)
- # onyx (10)
- # pedestal (2)
- # reagent (16)
- # spacemacs (4)
- # untangled (3)
- # vim (28)
- # yada (3)
So working on CLJS-2041...
If I emit (f.IFn$blah || f)(the_arg)
it somehow loses this
context (sometimes). However (f.IFn$blah ? f.IFn$blah(the_arg) : f(the_arg))
works just fine. Just curious if there are any JS cracks that know why?
Welp, learnt some new JS:
(js* "(~{})(~{})"
(.-cljs$core$IFn$_invoke$arity$1 :a)
{:a 2})
;; => works
(js* "(~{} || 0)(~{})"
(.-cljs$core$IFn$_invoke$arity$1 :a)
{:a 2})
;; => null, loses this
sidenote - I would not change the codegen pattern here unless you have a really good reason
Yeah, not gonna change it, it was just an idea I wanted to try. Would've been nice, but probably even much slower.
@dnolen I'm guessing the gen-apply-to
was pre IFn
checks? https://github.com/clojure/clojurescript/commit/d43a350969b993d76671e78c27b8f791f1ff8d8d