This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-08
Channels
- # announcements (43)
- # architecture (4)
- # beginners (115)
- # calva (6)
- # cider (4)
- # circleci (4)
- # clara (3)
- # clj-kondo (6)
- # cljs-dev (10)
- # cljsrn (1)
- # clojars (1)
- # clojure (108)
- # clojure-boston (1)
- # clojure-dev (4)
- # clojure-europe (5)
- # clojure-italy (6)
- # clojure-nl (13)
- # clojure-uk (17)
- # clojurescript (47)
- # core-async (2)
- # cursive (13)
- # data-science (1)
- # datavis (15)
- # datomic (12)
- # graphql (5)
- # juxt (10)
- # kaocha (20)
- # lumo (1)
- # off-topic (27)
- # pedestal (4)
- # reitit (2)
- # shadow-cljs (115)
- # spacemacs (4)
- # sql (74)
- # tools-deps (79)
- # vim (15)
- # xtdb (2)
I know, when I ask this questions and take your time, it’s not the contribution.
But, I’ve some questions.
I’ve been volunteer for the cljs-3152. Which says;
> Throw complier exception when method names start with .
special.
I think I have to dig down to the Analyzer. Which I did.
In Analyzer, parse-invoke*
method seems nice to me.
I have implement a control that takes name of the fexpr
--I think it means; Function Expression--.
(when ^boolean fn-var?
(let [{^boolean variadic :variadic? :keys [max-fixed-arity method-params name ns macro]} (:info fexpr)]
(when (= (first name) ;; +------------------------
".")
(throw (new js/Exception))) ;; Do we have a special Exception type for the Compiler Exceptions? + ----------------------------
;; don't warn about invalid arity when when compiling a macros namespace
;; that requires itself, as that code is not meant to be executed in the
;; `$macros` ns - António Monteiro
(when (and #?(:cljs (not (and (gstring/endsWith (str cur-ns) "$macros")
(symbol-identical? cur-ns ns)
(true? macro))))
(invalid-arity? argc method-params variadic max-fixed-arity))
(warning :fn-arity env {:name name :argc argc}))))
Am I doin’ good ?@scknkkrer no. the error should be thrown in def
, eg. disallow (defn .xyz [] ...)
the compile will automatically desugar (.foo bar)
calls so (.xyz)
would not be callable
That was my first idea. But, I was thinking about, if we do this in the defn
macro, it will not be flexible as we will need.
not in the macro. probably here https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/analyzer.cljc#L1832