it should really be disallowed in all cases where it cannot possibly be a method call
well dot form really
I am confused by the definition of function js-obj in cljs.core. The 0 arity looks like a recursive call to me, but it certainly returns quickly without infinitely recursing. Is someone familiar with what is going on there?
Here is the defn for quick reference:
(defn js-obj
"Create JavaSript object from an even number arguments representing
interleaved keys and values."
([]
(cljs.core/js-obj))
([& keyvals]
(apply gobject/create keyvals)))
Maybe that is dead code?
When I try to declare my own similar function, it does call the 0 arity, and recurses infinitely. Hmmm.
@andy.fingerhut see https://blog.fikesfarm.com/posts/2016-03-01-clojurescript-macro-sugar.html cljs.core/js-obj is also a macro which will used first
ah, that makes sense then why I couldn't find it in the same source file with the defn of js-obj.
@andy.fingerhut this is a difference from Clojure
ClojureScript macros and fns can have the same name
I've coined the term "macro-function" https://blog.fikesfarm.com/posts/2015-12-12-clojurescript-macro-functions.html
^ That's non-normative, we have formal language in https://clojurescript.org/about/differences#_macros FWIW