For the TR folks you can have your cake and eat it with a cup of coffee with `provide'. TR Rules<div><br></div><div>#lang typed/racket/base</div><div><br></div><div>;;public interface/w specifications</div><div>(provide:</div>
<div> [inc (Integer -> Integer)])</div><div><br></div><div>...</div><div><br></div><div>(: inc (Integer -> Integer))</div><div>(define (inc x) (add1 x))</div><div><br></div><div><br></div><div>...</div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Fri, Dec 14, 2012 at 10:44 AM, Matthias Felleisen <span dir="ltr"><<a href="mailto:matthias@ccs.neu.edu" target="_blank">matthias@ccs.neu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
It is critical to inform clients of the services that a module<br>
provides. In the absence of types, contracts are the closest<br>
information we have. Reading the implementation is against<br>
all good SE ideas.<br>
<br>
IF we could assume that people always programmed in DrRacket,<br>
we could compromise and add a tool that synthesizes the interface<br>
of a module in some way. Since some contributors break this guideline<br>
all the time anyway, we should have such a tool available anyway.<br>
<br>
BUT there are also people who use Emacs and the other editor.<br>
<br>
So, if you want to be good, put provide contract-out at the top<br>
of your module.<br>
<br>
<br>
<br>
<br>
<br>
On Dec 14, 2012, at 1:02 AM, Harry Spier wrote:<br>
<br>
> If you place provide/contract at the beginning of a module it makes<br>
> the interface clear but it is separated from its function. If you<br>
> place it right before its function and not at the top of the module,<br>
> it makes the function clearer but the module interface is not so<br>
> clear.<br>
><br>
> Is it possible (would it be a good idea?) to provide a new form that<br>
> splits the provide/contract form into two parts. One part the<br>
> contract definition which you could place immediately before the<br>
> function definition and the second part a provide spec for inclusion<br>
> in a provide statement that included the function name but not the<br>
> contract spec.) . That way the contract definition can be by the<br>
> function definition and the function name can be in a provide<br>
> statement at the beginning of the module.<br>
><br>
> Harry Spier<br>
> _________________________<br>
> Racket Developers list:<br>
> <a href="http://lists.racket-lang.org/dev" target="_blank">http://lists.racket-lang.org/dev</a><br>
<br>
_________________________<br>
Racket Developers list:<br>
<a href="http://lists.racket-lang.org/dev" target="_blank">http://lists.racket-lang.org/dev</a><br>
</blockquote></div><br></div>