[plt-scheme] Problem with contract in module

From: Chongkai Zhu (czhu at cs.utah.edu)
Date: Sat Aug 16 17:55:04 EDT 2008

If you want to provide `log-to-console' with the contract, then there is 
no need to have the `(provide log-to-console)' line. `provide/contract' 
provides it with a contract. The error message means you provided ` 
log-to-console' twice, once with contract and once without.

Chongkai


Woodhouse Gregory wrote:
> This code will not compile
>
> #lang scheme
>
> (require scheme/date)
>
> (provide log-to-console)
>
> (provide/contract
>  [log-to-console (-> logger?
>                      (one-of/c 'debug 'info 'warning 'error 'fatal) 
>                      procedure?)])
> (define (log-to-console logger level)
>
> ...)
>
>
> The error is 
>
> module: identifier already provided (as a different binding) in: 
> log-to-console
>
> On the other hand, if I comment out the contract, it works as 
> expected. Am I using the contract facility correctly?
>
>
> "In the human mind, one-sidedness has 
> always been the rule and many-sidedness the
>  exception. Hence, even in revolutions of 
> thought, one part of the truth usually sets while
>  another rises."
> --John Stuart Mill
>
> http://www.gwoodhouse.com
> http://GregWoodhouse.ImageKind.com
>
>
>
>
>
> ------------------------------------------------------------------------
>
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>   



Posted on the users mailing list.