Re: Sorry Don't understand "for macro", a bug or a newbie-question??

2012-01-20 Thread aschoerk
Ah, thank you, so a newbie question. But helped me a lot. Andreas On Jan 18, 10:26 pm, Jack Moffitt 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 influence >

Re: Sorry Don't understand "for macro", a bug or a newbie-question??

2012-01-18 Thread dennis zhuang
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 > > doesn't show any effect of t

Re: Sorry Don't understand "for macro", a bug or a newbie-question??

2012-01-18 Thread Jack Moffitt
> 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 reali

Sorry Don't understand "for macro", a bug or a newbie-question??

2012-01-18 Thread aschoerk
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:"