[racket-dev] Wrapping loops for TR isn't working, and the type annotations are for the wrong value

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Wed Aug 15 16:55:37 EDT 2012

> There is a similar problem with for/product: . The initial 1 is that an integer, a real
> or a complex?

> (for/product: : Real ([i : Integer (in-range 0 5)]) (/ i))

Type Checker: Expected Integer, but got Exact-Rational in:
(for/product: : Real ((i : Integer (in-range 0 5))) (/ i))

It does not help to change the type of i to Real :

> (for/product: : Real ([i : Real (in-range 0 5)])   (/ i))
Type Checker: Expected Integer, but got Real in: (for/product: : Real
((i : Real (in-range 0 5))) (/ i))

/Jens Axel


/Jens Axel

Posted on the dev mailing list.