Re: [racket-users] How to return summary from the inner loop?

2015-07-10 Thread Stephen Chang
Perhaps I don't understand the problem, but why is the inner loop necessary? By the way, you can use (printf ...) instead of (fprintf (current-output-port) ...) Would this work? (define (validate-ranges2 value-list low-list high-list) (for/sum ([v value-list] [lo low-list]

Re: [racket-users] How to return summary from the inner loop?

2015-07-10 Thread Pierpaolo Bernardi
If I understand correctly the spec, this should do what you ask? (define (validate-ranges value-list low-list high-list) (for/fold ((failures 0)) ((low (in-list value-list)) (high (in-list high-list))) (for/fold ((failures 0)) ((value (in-list