clojure - How do I multiply all elements in one collection with all the elements in another collection? -


say have:

(def s1 [1 2 3 4 5]) (def s2 [1 2 3 4 5]) 

for every x in s1, want multiply every y in s2.


to clarify, want cartesian product, don't think map works here.

(for [x1 s1       x2 s2]   (* x1 x2)) 

Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -