Fork me on GitHub

Hello everyone ... How does one get about trying out the reagent-cookbook? I did:

lein new rc input-validation
which created an input-validation folder and when I went in there and ran lein cljsbuild once it threw up on my face


Am I doing something wrong? (Full Noob here) version: Leiningen 2.9.1 on Java 11.0.4 OpenJDK 64-Bit Server VM


It worked for me, although I'm using Openjdk 8 instead of 11. I'm guessing the problem lies there?

👍 4

I can check with Openjdk 8...


WTF!!! @UCW9TUDNK thanks a lot... it built with Openjdk 8


Glad it worked!


@UCW9TUDNK maybe it's a stupid question but can you give me a hint as to how I can try the examples out? I do a lein cljs build once but then I open the index.html file (`firefox resources/public/index.html`) I get a blank page... (I tried it again for the simple-sidebar example)


I'm not familiar with reagent-cookbook, but I guess they expect you to fill in the code yourself?


If you're like me and would like hot-reloading when you play around, using reagent-template might be a better solution Then just run lein figwheel after lein new reagent <name>. With the rc template you would have to refresh the page on every change.


achsoo... sorry I didn't open the code... i thought these were like examples


sorry about that


No worries, I can see how it's easy to misunderstand [=


I think after spending the last couple of hours trying to figure out the problem with lein (which turned out to be an openjdk version issue) I've lost it

😅 4

right now, I'm configuring my CI for the project


hello, why map function returns some #object[clojure.core$map$fn__5583 0xc10e2888 "clojure.core$map$fn__5583@c10e2888"] object instead of regular collection?


You're probably calling map with a single argument, which makes it return a transducer (see (doc map)). If you want it to return a collection, you have to pass it as the 2nd argument.

[object Object]14:10:33

Hi. Is there a builtin that given two vectors applies functions from the first one on corresponding elements of the second? (... [f g h] [1 2 3]) => [(f 1) (g 2) (h 3)]


You can use apply, e.g., (map #(apply %1 %&) [f g h] [1 2 3])


in paul graham's bel lisp he made a function called upon that seems quite nice. but if you know arities you can also just do (map #(%1 %2) fns vals)

[object Object]14:10:09

I was hoping there was a generic builtin

[object Object]14:10:13

No problem though!


I think the more usual version is to use #(%1 %2) or some equivalent (map #(%1 %2) [f g h] [1 2 3])