On Fri, Jul 10, 2015 at 11:40 PM, Pekka Niiranen
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 failu
I understand now. I still claim that an (explicit) inner loop is not needed:
(define (validate-ranges5 value-list low-list high-list)
(for*/fold ([failures 0])
([(lo hi) (in-parallel low-list high-list)]
[v value-list]
#:when (< lo v hi))
(printf "\n*
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.
About the problem (Stephen):
value-list: '(5, 15, 25)
low-list: '(1, 11, 21)
high-list: '(10, 20, 30)
I need to check the following 9 cases:
LV
On Fri, Jul 10, 2015 at 11:11 PM, Stephen Chang wrote:
> Perhaps I don't understand the problem, but why is the inner loop necessary?
He asked how to test each value against each of the limit pairs. I
assume this is a simplified/demo problem and in the problem he really
cares about there's a rea
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]
On Fri, Jul 10, 2015 at 10:45 PM, Pierpaolo Bernardi
wrote:
> If I understand correctly the spec, this should do what you ask?
which, fixing the typo, becomes:
(define (validate-ranges value-list low-list high-list)
(for/fold ((failures 0))
((low (in-list low-list))
(h
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 value-lis
Hello users,
I want to loop thru values and return the total number of failures
instead of breaking out of loop as soon as the first failure is encountered.
The code below works as intended:
define (validate-order value-list low-list)
;; Checks whether all the values are all above list of low
On Friday, July 10, 2015 at 12:05:55 AM UTC-7, Matthew Flatt wrote:
> At Thu, 9 Jul 2015 10:08:53 -0700 (PDT), Scott Bell wrote:
> > On Thursday, July 9, 2015 at 12:27:26 AM UTC-7, Matthew Flatt wrote:
> > > At Wed, 8 Jul 2015 18:23:32 -0700 (PDT), Scott Bell wrote:
> > > > On Wednesday, July 8, 20
At Thu, 9 Jul 2015 10:08:53 -0700 (PDT), Scott Bell wrote:
> On Thursday, July 9, 2015 at 12:27:26 AM UTC-7, Matthew Flatt wrote:
> > At Wed, 8 Jul 2015 18:23:32 -0700 (PDT), Scott Bell wrote:
> > > On Wednesday, July 8, 2015 at 4:05:20 PM UTC-7, Scott Bell wrote:
> > > > On Wednesday, July 8, 2015
10 matches
Mail list logo