Hi,

On Sun, Feb 14, 2010 at 08:32:42AM -0800, Martin Hauner wrote:

> > (cond
> >   (empty? rolls)     0
> >   (strike? rolls)    (+ (score-strike rolls) (score-after-strike rolls))
> >   (spare?  rolls)    (+ (score-spare rolls)  (score-after-frame rolls))
> >   (more?   rolls)    (+ (score-frame rolls)  (score-after-frame rolls)))
>
> Someone suggested to use a (binding) to avoid the repeating rolls
> parameter. He wasn't sure if
> it would be ok (learning too).
> Since I have to change the code to calculate (score) in parallel
> anyway it may be ok to make
> rolls thread locale!?

I think the cond – as you did – is the best way to go. condp is supposed
to be used with a single predicate testing against different values.
The suggested condp forms are pushing this a little bit too much, IMHO.

How binding could used in this case is rather unclear to me…

Just me two 0.02€.

Sincerely
Meikel

-- 
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