idiomatic way to use cond.

2009-12-27 Thread RD
Hello All, When every I write clj code that involves cond. It always involves a "do" in almost all of the classes. somethiing like (cond condition1 (do exp1 exp2 exp) condition2 (do exp1 exp2 ...) true (do ...)) Is there a better way (without the explicit "do"

Re: idiomatic way to use cond.

2009-12-28 Thread Jeff Rose
I can think of a couple ways to break it up. First, you can pull the expressions inside of each do form out into separate functions. Whether they are defined above the current function or inside it using let, both would clean it up and give a label to each of the groups of expressions (the functio

Re: idiomatic way to use cond.

2009-12-28 Thread Meikel Brandmeyer
Hi, Am 28.12.2009 um 04:59 schrieb RD: >(cond > condition1 (do exp1 exp2 exp) > condition2 (do exp1 exp2 ...) > true (do ...)) > > Is there a better way (without the explicit "do") to write this?? Since the results of exp1 up to expN-1 are thrown away you are doi