Fork me on GitHub
#beginners
<
2016-07-13
>
seancorfield04:07:17

@krchia: Which version of Clojure are you seeing that on? (I think I'm reading this correctly that you're seeing different results from running the same expression multiple times, right?)

seancorfield04:07:51

I tried it on Clojure 1.9 and always got the second result...

krchia20:07:54

what’s a good way to multiply elements of 2 list?

krchia20:07:07

[1 2] [3 4] -> [3 8]

krchia21:07:38

got it - (apply (fn [x y] (map * x y)) test1)

donaldball21:07:08

(map * [1 2] [3 4]) is more succinct, though that may or may not be desirable

donaldball21:07:59

Nevermind, sorry, you already got there, I misread

seancorfield21:07:39

(apply map * [[1 2] [3 4]])

seancorfield21:07:09

@krchia: Did you see my question to you above, posted last night?

krchia21:07:52

oh actually both snippets are slightly different

krchia21:07:00

i found out the reason why it was not behaving the way i wanted

seancorfield21:07:37

In your posted snippet, they were identical — copy’n’paste error perhaps? At least that explains why I didn’t repro your results 🙂