[racket] [plt-scheme] Re: Typed scheme: Cannot apply expression of type Procedure, since it is not a function type

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Tue Jun 8 08:19:22 EDT 2010

On Mon, Jun 7, 2010 at 4:08 PM, keydana at gmx.de <keydana at gmx.de> wrote:
>> Try the other way around:
>> (truncate (inexact->exact n))
> Finally I've found the time to try this - but it gives me a Real (same with round):
> (truncate (inexact->exact 1.222))
> - : Real
> 1

If you use the now-released 5.0, this should work.

> One general question...
> Having right now read through the "untyped" http://docs.racket-lang.org/reference/numbers.html page, which introduces the exact vs. inexact concept and the sets of numbers from mathematics as orthogonal, I'd be curious about how TS handles this in the type hierarchy?
> Also, in practice,  think it'd be helpful to show the inclusion hierarchy for numeric types in the typed scheme reference...

We plan to add this to the docs.

> in fact I just realized that even in my ultra-simplistic representation, where I just want to have one "number" type (like the sql number type), I should think more about which one to use, whether it should be an exact or an inexact one... but I'm not really sure which possibilities there are for both options (e.g., I assume Number and Real are inexact, and Exact-Rational is the farthest I can get away from Integer with exact numbers? -- BTW, Exact-Rational is not in the docs, I just see it in drscheme).

I'll fix that.

sam th
samth at ccs.neu.edu

Posted on the users mailing list.