In the run-up to version 5.3, we introduced some new problems in the
handling of numeric types in Typed Racket, which leads to this not
type checking. These problems have since been corrected, but this is
a bug in the released version. If you use a pre-release build [1],
the code will work correctly. Using 5.3, you'll need to use `Number`
instead of `Real` (which has exactly the drawbacks you mention).
Sorry about the mess,
Sam
[1] http://pre.racket-lang.org/installers/
On Fri, Aug 24, 2012 at 2:07 PM, Pekka Karjalainen <pekkakarj at gmail.com> wrote:
>> Why does it give a type error? Is the Guide out of date with regard to
> the current state of Typed Racket?
>> $ racket typed.rkt
> typed.rkt:7:2: Type Checker: Expected Real, but got Number
> in: (sqrt (+ (sqr (- (pt-x p2) (pt-x p1))) (sqr (- (pt-y p2) (pt-y p1)))))
> context...:
> [...]
--
sam th
samth at ccs.neu.edu