Given the following:
user> (map (fn [x] (map #(* x %) '(1 2))) '(2 3))
((2 4) (3 6))
In clojure how can I make change this idiomatically so that the output becomes:
(2 4 3 6)
I used lists to ilustrate, but any collection is fine.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Which is shorthand for:
concatconcatenates collections together into one sequence. Calling it withapplyallows you to pass a collection of collections to be concatenated.