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. --Aidan -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.

