On Sat, Jun 27, 2015 at 6:20 PM, Aidan Gauland <aidal...@slingshot.co.nz> wrote:
> On 23/06/15 00:00, Robby Findler wrote:
>> On Mon, Jun 22, 2015 at 2:43 AM, Aidan Gauland:
>>>> If this does what you want, it’s fine, but the define/contract is probably 
>>>> unnecessary, and
>>>> (define fish-freshness/c
>>>>   (flat-named-contract ‘fish-freshness/c
>>>>     (lambda (x)
>>>>       (not (eq? ….)))))
>>>> Should do what you want.
>>>
>>> So are contracts on contracts generally unnecessary?
>>
>> No, the right generalization to draw here is that contracts aren't
>> necessary when it is "obvious" that they can never signal blame. As
>> another example, this:
>>
>>   (define/contract (f x) (-> integer?) 3)
>>
>> isn't really a helpful contract.
>>
>> The reason why the other generalization isn't right has to do with the
>> fact that contracts are themselves code and, like all code, can be
>> buggy.
>
> That makes more sense.  So far the only contracts I've looked at or
> written have been trivial.  And thanks for pointing me at some complex
> contracts for comparison.

Great! :)

Let us know if you have any questions about that code.

Robby

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to