Fork me on GitHub

@dnolen could you advise me how to report clojurescript bugs like that?

cljs.user=> (for [x [1]] :a :b)


That works for me

cljs.user> (for [x [1]] :a)
cljs.user> (for [x [1]] :a :b)
Unexpected error (ArityException) compiling at (<cljs repl>:1:1).
Wrong number of args (3) passed to: cljs.core/for
I'm using [org.clojure/clojurescript "1.10.520"]


What kind of REPL do you use? I've tried Planck and Lumo with the same result.


:dependencies => [nrepl "0.6.0"] [cider/piggieback "0.4.0"]


:plugins [cider/cider-nrepl "0.21.1"]


Im using emacs + cider 0.21 and this is what it adds to my project.clj environment when it jacks in


I have cider autostart figwheel. and those versions are: :plugins -> [lein-figwheel "0.5.19"] :dependencies -> [figwheel-sidecar "0.5.19"]


so to clarify, those figwheel deps are in my project.clj for any environment, and when I jack-in from cider, it adds the ones above (cider + nrepl)


so just tested without cider. Have just the two figwheels in the project:

Prompt will show when Figwheel connects to your application
[Rebel readline] Type :repl/help for online help info
ClojureScript 1.10.520
dev:cljs.user=> (for [x [1]] :a :b)
----  Could not Analyze  <cljs form>   line:1  column:1  ----

  Wrong number of args (3) passed to: cljs.core/for

  1  (for [x [1]] :a :b)

----  Analysis Error  ----


you can get to this with


lein new figwheel tempapp


cd into tempapp and go lein figwheel


it may be figwheel catching that problem! :thinking_face:


I tried Planck, as I understand it is nodejs based not java


figwheel says it works with nodejs. I've never used it with node though.


says it hotloads into node. compiler might need to be running on java though still.


File a ticket in JIRA


there is a problem - <mailto:[email protected]|[email protected]> doesn't have access to when I press "Request access" button I got 404: Oops, you've found a dead link.

Alex Miller (Clojure team)00:07:02

If you don’t have a jira, file it in the support portal

Alex Miller (Clojure team)00:07:58

No acct needed. I’ll move it to the right place from there


thank you.

Abhinav Sharma03:07:24

Hello everyone! I’m trying to call in Phaser ( in a ClojureScript project here ( I’ve tried the npm-deps as well as cljsjs version of phaser but it seems there are problems while importing the phaser library. I am trying out this snippet in the associated cljs repl

(ns rum-tavern.phaser
  (:require [phaser :refer (Phaser)]))
And here’s the output
#object[Error Error: Assert failed: No more than 1024 pending puts are allowed on a single channel. Consider using a windowed buffer.
(< (.-length puts) impl/MAX-QUEUE-SIZE)]
   cljs.core.async.impl.channels.ManyToManyChannel.prototype.cljs$core$async$impl$protocols$WritePort$put_BANG_$arity$3 (jar:file:/Users/eklavya/.m2/repository/org/clojure/core.async/0.4.500/core.async-0.4.500.jar!/cljs/core/async/impl/channels.cljs:86:19)
   cljs.core.async.impl.protocols/put! (jar:file:/Users/eklavya/.m2/repository/org/clojure/core.async/0.4.500/core.async-0.4.500.jar!/cljs/core/async/impl/protocols.cljs:17:10)
   cljs.core.async.put_BANG_.cljs$core$IFn$_invoke$arity$2 (jar:file:/Users/eklavya/.m2/repository/org/clojure/core.async/0.4.500/core.async-0.4.500.jar!/cljs/core/async.cljs:122:20)
   cljs.core.async/put! (jar:file:/Users/eklavya/.m2/repository/org/clojure/core.async/0.4.500/core.async-0.4.500.jar!/cljs/core/async.cljs:116:1)
   figwheel.client.file_reloading.queued_file_reload.cljs$core$IFn$_invoke$arity$2 (jar:file:/Users/eklavya/.m2/repository/figwheel/figwheel/0.5.19/figwheel-0.5.19.jar!/figwheel/client/file_reloading.cljs:320:27)
   figwheel$client$file_reloading$queued_file_reload (jar:file:/Users/eklavya/.m2/repository/figwheel/figwheel/0.5.19/figwheel-0.5.19.jar!/figwheel/client/file_reloading.cljs:318:1)
   figwheel$client$file_reloading$figwheel_require (jar:file:/Users/eklavya/.m2/repository/figwheel/figwheel/0.5.19/figwheel-0.5.19.jar!/figwheel/client/file_reloading.cljs:178:30)
Can anyone point me to the right direction here please?

Abhinav Sharma12:07:08

So, i’ve solved it by switching to shadow-cljs which makes things a bit faster as well.

Michaël Salihi11:07:14

Hi ! I'm developing a Reagent/React Native app and I'm stuck for concatening ratom state which contains a JS object. I would doing like this in ES6 JS : movies: [ ...this.state.movies, ] or the equivalent movies: this.state.movies.concat(data.results). Any clue ? Should I use goog.object/extend ? thx



(let [state (atom {:movies #js [1 2]})]
  (swap! state update :movies #(.concat % #js [3 4])))


updated with js array


Wondered about this implementation

(defn keyword-identical?
  "Efficient test to determine that two keywords are identical."
  [x y]
  (if (identical? x y)
    (if (and (keyword? x) (keyword? y))
      (identical? (.-fqn x) (.-fqn y))
  (identical? x y)
    (keyword? x)
    (keyword? y) 
    (identical? (.-fqn x) (.-fqn y)))


Isn’t the last one more idiomatic? Or is there a semantical difference I do not see?


I am hesitant to reply here, because my ClojureScript implementation knowledge is much much lower than my Clojure/Java implementation knowledge, but at least with Clojure/Java, if two keywords "look the same" when printed, i.e. same namespace and name, they always return true for identical?. In ClojureScript have you found two such keywords where identical? returns false?


did a quick test in my cljs repl and (identical? :k1 :k1) returns false


OK, today I learned something. In Clojure/Java having all keywords that 'look the same' also be identical is a source of some efficiency when using them as map keys.


Well, keyword-identical? is an optimization that is apparently sometimes necessary. But my question was more about the coding style of the function.


There is an optimization in ClojureScript where constants like keywords are pooled (this is the default under :advanced) and in that situation identical? starts to be more useful


@andy.fingerhut keywords are not guaranteed to be indentical? according to the ClojureScript “Differences”


@grav I don’t think either one is more idiomatic than the other. The first is probably much easier for the analyzer to infer types and therefore could end up with more efficient output, though


@grav I do not see a behavior difference between those two ways of writing it, because identical? always returns true or false. If you do an or where one of the functions can return a non-nil non-false value that short-circuits the or, you will get back that as the value of the or.


the generated code looks about the same tbh


 * Efficient test to determine that two keywords are identical.
cljs.user.keyword_identical_QMARK_ = (function cljs$user$keyword_identical_QMARK_(x,y){
  if((x === y)){
    return true;
  } else {
    if((((x instanceof cljs.core.Keyword)) && ((y instanceof cljs.core.Keyword)))){
      return (x.fqn === y.fqn);
    } else {
      return false;
cljs.user.keyword_identical_SINGLEQUOTE_ = (function cljs$user$keyword_identical_SINGLEQUOTE_(x,y){
  return (((x === y)) || ((((x instanceof cljs.core.Keyword)) && ((y instanceof cljs.core.Keyword)) && ((x.fqn === y.fqn)))));


@U4YGF4NGM @grav Of historical interest: when keyword-identical? was written, ClojureScript was still using Clojure's or macro, so, even though Mikkel has a side point regarding whether the code is idiomatic, it may have actually produced nearly the same code back then. What we have now is nicer and and or implementations that spit out && and || like in your second example generated from Mikkel's proposed variant.

👍 4

Is there a straightforward way to see the html a hiccup-like-form will be translated to by reagent?


at a REPL you can do: (require ‘[reagent.dom.server :as rds]) and then (rds/render-to-string [:div “foo”])


just trying to get accustomed to all things web-designy


in the re-frame todomvc tutorial there is a part of a hiccup-returning function that goes

  (for [todo visible-todos]
  ^{:key (:id todo)} [todo-item todo])]
with todo-item being a function taking no arguments that returns a function taking one argument and rendering some hiccup. now I am somewhat confused by the magic here - first, is this translating meta-data to html-attributes (I presume) canonical hiccup? Also, how is this function-call-like syntax there supposed to go? Is it always higher-order functions?


there’s really no such thing as canonical hiccup. libraries implement it in various ways


there’s a few things happening here


1. Reagent (and some other libraries) extend hiccup to allow a “component” to exist in the first position, just like a keyword :div. The component will be called with the rest of the hiccup vector as “props”. 2. The metadata used here won’t get converted to html attributes, but is used to signal to React the “key” to use when rendering a dynamic list. It won’t appear in the actual HTML. See for more info 3. The todo-item implementation that you’re talking about sounds like a “form-2” component and is a way of defining a reagent component. take a look at for the 3 ways of creating Reagent components


I would suggest reading and consuming the reagent docs and trying out reagent by itself before diving into re-frame. re-frame assumes familiarity with Reagent


Indeed, that turned out to be very necessary. Thanks a lot for the clarifications though.