I was not sure how to correctly name this thread, so if you can clarify it, do it.
My sample code is:
(doseq [x [1 2 3] y [3 2 1]] (println (str x y)))
The output of this code is:
13
12
11
23
22
21
33
32
31
nil
I understand that comprehension of the lists and the dose are so evaluated. Is there any other way to do this, so instead of 1 element from x is used for each element y, etc. 1 element from x is used with 1 element from y, etc., so instead, the output will be
13
22
31
Sorry, if I do not formulate this right, I just can not say it correctly.
EDIT: I think you can do it in Haskell with a list and a language extension. ParallelListComps or something like that.
source
share