Fork me on GitHub
#beginners
<
2019-10-16
>
sysarcher09:10:44

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

sysarcher09:10:08

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

herald09:10:36

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

👍 4
sysarcher10:10:38

I can check with Openjdk 8...

sysarcher10:10:52

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

herald10:10:38

Glad it worked!

sysarcher10:10:54

@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)

herald10:10:44

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

herald10:10:24

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

sysarcher10:10:40

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

sysarcher10:10:17

sorry about that

herald10:10:31

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

sysarcher10:10:23

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
sysarcher10:10:50

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

Seubas09:10:48

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

herald09:10:09

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)]

hansbugge14:10:53

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

dpsutton14:10:34

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!

noisesmith17:10:41

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