On Fri, Jul 10, 2015 at 11:40 PM, Pekka Niiranen <pekka.niira...@pp5.inet.fi> wrote: > Thanks Sir, > > This was exactly what I tried to reason. > It never occured to me that parameter "failure" can be used > in both for/fold -constructs.
I must fix once again my code. Sigh. I fixed a mistake, and renamed one of the two failures accumulators, so as to avoid possible confusion. What I should have written in the first place is: (define (validate-ranges value-list low-list high-list) (for/fold ((failures 0)) ((low (in-list low-list)) (high (in-list high-list))) (for/fold ((failures2 failures)) ((value (in-list value-list))) (if (<= low value high) failures2 (add1 failures2))))) Cheers P. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.