Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureScript by

Hi there,

it seems to me I found a bug in cljs core.async 1.3.610 (clj works well). Do you guys agree with me?

The issue:

(cljs.core.async/go
  (println "XXX before")     
  (let [old 1
      new „my-new"]
   (println "XXX after")
   (println [old new])))
=> „XXX vorher"
=> „XXX nacher"
=> TypeError TypeError: 1.call is not a function

Changing the new symbol to xnew works:

(cljs.core.async/go
  (println "XXX before")     
  (let [old 1
      xnew „my-new"]
   (println "XXX after")
   (println [old xnew])))
=> „XXX vorher"
=> „XXX nacher"
=> [1 „my-new"]

The following snippet of macroexpanding shows the error I mean. The new for instantiating cljs.core/PersistentVector got resolved with the value I bound to new

...
(clojure.core/let
 [inst_35971
 (println "XXX before")
 inst_35972
 (. cljs.core/PersistentVector -EMPTY-NODE)
 inst_35973
 (js* "[{},{}]" 1 "my-new")
 inst_35974
 ("my-new"
  cljs.core/PersistentVector
  nil
  2
  5
  inst_35972
  inst_35973
  nil)
 inst_35975
 (println inst_35974)
 state_35977
 …]
…))

So do not use new as symbol! :-$

1 Answer

0 votes
by
selected by
 
Best answer

https://clojure.atlassian.net/browse/ASYNC-63

The cljs side of core.async could really use some love.

...