[racket-dev] syntax/syntax proposal

From: Ryan Culpepper (ryan at cs.utah.edu)
Date: Thu Jun 21 16:23:35 EDT 2012

On 06/21/2012 09:53 AM, Eli Barzilay wrote:
> A few minutes ago, Matthias Felleisen wrote:
>>
>> On Jun 21, 2012, at 11:26 AM, Eli Barzilay wrote:
>>
>>> I don't see how that would help -- you'll still get the same errors.
>>
>> Ouch. That's again a misunderstanding of contracts.
>>
>> The idea is that contracts specify in interfaces what is expected,
>> not deep inside some code.
>
> I'm not talking about having contracts -- just about this part:
>
>> [...] make a racket/pre-contracts subcollection and just stuff all
>> of racket/contract/base's dependencies in there, then say everything
>> else is allowed (maybe even expected) to use contracts.
>
> You can already know that, for example, `syntax/stx' is part of that
> because you'll get a cyclic module dependency error if you try to add
> contracts to it.  (And that error would be the same whether it's
> listed in a new `racket/pre-contracts' module.)

The reorganization would discourage people from trying to add contracts 
to modules in the racket/pre-contracts subcollection. It's apparent from 
the name, as opposed to being discoverable by running the compiler.

It would also encourage people to add contracts to every other library. 
Modules like syntax/stx and racket/list currently don't use contracts; 
they use hand-coded checks instead (or they just don't check their 
arguments). Is racket/contract/base a "heavy" dependency that we want to 
avoid for such libraries?

Ryan

Posted on the dev mailing list.