This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-03
Channels
- # beginners (20)
- # boot (407)
- # cider (17)
- # cljs-dev (29)
- # cljsrn (33)
- # clojure (169)
- # clojure-greece (17)
- # clojure-russia (47)
- # clojure-spec (40)
- # clojure-uk (81)
- # clojurescript (64)
- # clr (3)
- # copenhagen-clojurians (3)
- # core-async (1)
- # cursive (28)
- # datomic (26)
- # editors-rus (4)
- # emacs (10)
- # events (1)
- # figwheel (1)
- # funcool (1)
- # hoplon (82)
- # jobs (1)
- # klipse (10)
- # lein-figwheel (26)
- # leiningen (1)
- # off-topic (2)
- # om (153)
- # overtone (2)
- # pedestal (15)
- # proton (1)
- # re-frame (6)
- # ring-swagger (1)
- # rum (1)
- # slack-help (4)
- # untangled (56)
- # vim (24)
- # yada (2)
@dnolen I just got invalid local name
error when compiling a macro in ClojureScript, it turned out that I need to use gensym
form. This was very confusing and didn’t really help, could we improve this error message to refer directly to what should be done to solve it?
@roman01la but what is there to detect?
@roman01la which is to say- a) determine what is the typical mistake (is even typical?), b) how can we detect it, and then c) assess whether it’s worth the trouble
@dnolen I assume this error popups when there's possible naming collision? (At least that what I can tell from looking at analyze-let-bindings*
fn)
If so, this could be changed to something like Naming collision. Invalid local name...
@roman01la don’t assume anything 🙂
@dnolen do you want a minimal project or a gist would be enough?
sure
Here I need to gensym
every var within loop
to compile the macro. I guess it’s because loop
is being compiled to JS while
loop which doesn’t have a scope.
(defmacro fast-mapv [f data]
`(loop [[x & xs] ~data
result []]
(let [nresult (conj result (~f x))]
(if (seq xs)
(recur xs nresult)
nresult))))
(fast-mapv inc [1 2 3])
@roman01la doesn’t the compiler emit a bunch of warnings?
@dnolen nope, that’s the only error reported by figwheel. the same goes to REPL
@roman01la figwheel doesn’t have anything do with this
@dnolen I’m not sure how this can help, could you please explain? Figwheel is the tool which I’m using daily, so I rely on it.
@roman01la reporting issues via other tooling is a huge waste of time
if you’re going to try to understand some compiler issue, report only by using the compiler
@dnolen ok, I understand. Thank you. I'll get back when I'll try compiler directly.