[plt-scheme] typed teaching languages

From: Todd O'Bryan (toddobryan at gmail.com)
Date: Sun Aug 9 21:40:24 EDT 2009

OK. I've made great progress, at least by my standards.

I've gone through the entire lang/private/teachprims.ss file and
clarified all the types with appropriate annotations, so that I don't
get anymore type errors.

However, I now get this error:

match: no matching clause for (Unknown Type: #(struct:top-arr 51 #f))

Unfortunately, there's no line highlighting and there's not even a
match statement in the file.

I've uploaded what I've got to a page on my class wiki:

https://www.dupontmanual.org/wikis/spectops/TypedScheme

If anyone has time to take a look or a process I could undertake to
start figuring out where the error is, I'd appreciate any insight!

Thanks,
Todd

On Sun, Aug 9, 2009 at 8:07 PM, Todd O'Bryan<toddobryan at gmail.com> wrote:
> OK. Any idea what to do about vector? which apparently isn't the
> predicate for (Vectorof Any).
>
> On Sun, Aug 9, 2009 at 8:00 PM, Todd O'Bryan<toddobryan at gmail.com> wrote:
>> Thanks. I'll do it the way you suggested...
>>
>> On Sun, Aug 9, 2009 at 6:39 PM, Carl Eastlund<carl.eastlund at gmail.com> wrote:
>>> Todd,
>>>
>>> I believe the ability to put predicate types in require/typed is
>>> unsound and soon to be unsupported.  Sam can probably say more on that
>>> subject if need be.  I recommend using number? to point Typed Scheme
>>> in the right direction (as in the email I sent a few seconds ago,
>>> which you likely had not received when you sent the below).
>>>
>>> Carl Eastlund
>>>
>>> On Sun, Aug 9, 2009 at 6:35 PM, Todd O'Bryan<toddobryan at gmail.com> wrote:
>>>> As so often happens, just after sending this message I realized that I
>>>> needed to convince Typed Scheme that real? is a predicate for Number,
>>>> so I added
>>>>
>>>> (require/typed scheme [real? (Any -> Boolean : Number)])
>>>>
>>>> at the top, and it now works.
>>>>
>>>> On Sun, Aug 9, 2009 at 6:28 PM, Todd O'Bryan<toddobryan at gmail.com> wrote:
>>>>> Thank you. I'm now making progress...
>>>>>
>>>>> However, I've hit a Typed Scheme hiccup.
>>>>>
>>>>> (define (positive-real? v)
>>>>>  (and (real? v) (>= v 0)))
>>>>>
>>>>> won't type check because it thinks the second v is just an Any.
>>>>>
>>>>> I tried adding a type annotation (ann v Number) with a begin around
>>>>> the second part of the and, but that didn't help.
>>>>>
>>>>> Anybody know how to give Typed Scheme the hint it needs here?
>>>>>
>>>>> Todd
>>>
>>
>


Posted on the users mailing list.