[racket] Contracts and submodules

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Thu Nov 29 20:32:39 EST 2012

That looks like a bug to me.

Robby

On Thu, Nov 29, 2012 at 6:59 PM, Harry Spier <vasishtha.spier at gmail.com> wrote:
> Dear list members,
>
> Case 1 below doesn't give a contract violation but case 2 does.  Is
> this desired behavour or is it a bug?
>
> In DrRacket
> Case 1
> ---------
> #lang racket
> (provide (contract-out [ident-number (-> number? number?)]))
> (define (ident-number x)  x)
> (module+ main
>   (ident-number 'a))
>
>> 'a
>
>
> Case 2
> ------------
> #lang racket
> (provide (contract-out [ident-number (-> number? number?)]))
> (define (ident-number x)  x)
> (module+ main
>   (require (submod ".."))
>   (ident-number 'a))
>
>>
>  ident-number: contract violation
>  expected: number?
>  given: 'a
>  in: the 1st argument of
>       (-> number? number?)
>  contract from:
>       c:\users\harry\ocr_project\test2.rkt
>  blaming:
>       (c:\users\harry\ocr_project\test2.rkt main)
>  at: c:\users\harry\ocr_project\test2.rkt:2.24
>
> Thanks,
> Harry Spier
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users

Posted on the users mailing list.