[plt-scheme] typed scheme intro

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Thu Apr 8 16:25:39 EDT 2010

On Thu, Apr 8, 2010 at 4:21 PM, Robby Findler
<robby at eecs.northwestern.edu> wrote:
> Ah. I see. (I didn't understand the error message, fwiw. I do now that
> I know what the error is, tho... kind of.)
>
> I changed the fields to Number and it also type checked. Maybe that's
> also a good change to the example?

I didn't really want them to be 4D points, but given that positiveness
isn't represented in the type system, maybe I should change them.  Or
add a NonNegativeReal type.  Or maybe we should have `real-sqrt'.

>
> Robby
>
> On Thu, Apr 8, 2010 at 3:17 PM, Sam Tobin-Hochstadt <samth at ccs.neu.edu> wrote:
>> On Thu, Apr 8, 2010 at 4:15 PM, Robby Findler
>> <robby at eecs.northwestern.edu> wrote:
>>> What type annotations did you put, exactly? I tried changing the
>>> result of mag to Number and otherwise leaving it as is (from the docs)
>>> and I get this:
>>>
>>> Welcome to DrScheme, version 4.2.5.6-svn8apr2010 [3m].
>>> Language: typed/scheme; memory limit: 512 MB.
>>> . Type Checker: No function domains matched in function application:
>>> Domains: Exact-Nonnegative-Integer
>>>         Number
>>> Arguments: Number Number
>>>  in: (sqrt (sqr (pt-x p)) (sqr (pt-y p)))
>>
>> That's from the missing `+' operation.
>> --
>> sam th
>> samth at ccs.neu.edu
>>
>



-- 
sam th
samth at ccs.neu.edu


Posted on the users mailing list.