[plt-scheme] Case lambda in typed scheme
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
>
> Cheers,
>
> --
> Paulo Jorge Matos - pocmatos at gmail.com
> Webpage: http://www.personal.soton.ac.uk/pocm
You were very close!
#lang typed-scheme
(: foo (case-lambda [-> Symbol]
[Symbol -> Symbol]))
(define foo
(case-lambda: [() 'foo]
[((s : Symbol)) s]))
Anthony