Ah,
thank you, so a newbie question.
But helped me a lot.
Andreas
On Jan 18, 10:26 pm, Jack Moffitt j...@metajack.im wrote:
doesn't show any effect of the for.
The only difference is the additional statement at the end.
I can not imagine how this statement sequentially behind can
Hello,
I am quite puzzled:
(defn fortest1 []
(for [a (range 2 10)
b (range 2 10)]
(do
(println x: a b: b)
(list a b)))
)
(fortest1)
Shows the running for macro
(defn fortest2 []
(for [a (range 2 10)
b (range 2 10)]
(do
(println x: a b: b)
doesn't show any effect of the for.
The only difference is the additional statement at the end.
I can not imagine how this statement sequentially behind can influence
the for.
for returns a lazy sequence. In the first case, in printing out the
result to the REPL, the lazy sequence is
for returns a lazy sequence.You may prefer doseq:
(defn fortest2 []
(doseq [a (range 2 10)
b (range 2 10)]
(do
(println x: a b: b)
(list a b)))
(println ende)
)
(fortest2)
doseq will be forced for side-effects.
2012/1/19 Jack Moffitt j...@metajack.im
doesn't show any