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 function name).  Otherwise if you have duplicated
expressions in the do forms, then you could do the minimum amount
possible in the cond and put it in a let to keep the return value, and
then use it to execute the rest of the code within the body of the
let.  One of those seems to work for me most of the time, but I could
be missing something too...

Cheers,
Jeff

On Dec 28, 4:59 am, RD <rdsr...@gmail.com> wrote:
> 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") to write this??
>
> regards,
> rdsr

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to