[plt-scheme] Case lambda in typed scheme

From: Paulo J. Matos (pocmatos at gmail.com)
Date: Thu Mar 19 08:09:52 EDT 2009

On Thu, Mar 19, 2009 at 2:45 AM, Sam TH <samth at ccs.neu.edu> wrote:
> On Wed, Mar 18, 2009 at 8:54 PM, Paulo J. Matos <pocmatos at gmail.com> wrote:
>> While on an adventure to use typed-scheme I faced this issue:
>> #lang typed-scheme
>>
>> (: foo (case-lambda [-> Symbol]
>>                    [Symbol -> Symbol]))
>> (define foo
>>  (case-lambda [() 'foo]
>>               [(s) s]))
>>
>> I can't see what might be wrong here. Still I get in 4.1.4:
>> typecheck: untyped var: s in: s
>
> Unfortunately, doing something intelligent here with `case-lambda' is
> trickier, and that's why this doesn't work yet. Carl and Anthony's
> solutions are right, but can you file this as a bug so I remember to
> fix it in the future?
>

I will file it as a bug but why do I need case-lambda: ?
I thought I would need it only if I didn't annotate the type of foo
function. But I do annotate it with
 (: foo (case-lambda [-> Symbol]
                    [Symbol -> Symbol]))

the type of s is defined to be a symbol there... in the second line by
saying, Symbol -> Symbol, right?

Cheers,

Paulo Matos
> Thanks,
> --
> sam th
> samth at ccs.neu.edu
>



-- 
Paulo Jorge Matos - pocmatos at gmail.com
Webpage: http://www.personal.soton.ac.uk/pocm


Posted on the users mailing list.