[racket] sharing an expensive computation required in procedure and its contract?

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Sun Jul 20 20:18:47 EDT 2014

FWIW, I think raise-argument-error is a fine way to go here to avoid
that expense (I assuming you're thinking of not checking this aspect
of the contract using the racket/contract library but instead
computing 'expensive-result' once in the body and then checking it?).
And one day perhaps the research will catch up with this use of
contracts.

Can you supply a little more detail on what the expensive computation
is doing, tho, to help spur our imagination?

Robby

On Sun, Jul 20, 2014 at 3:15 PM, Jon Zeppieri <zeppieri at gmail.com> wrote:
> On Sun, Jul 20, 2014 at 2:47 PM, Alexander D. Knauth
> <alexander at knauth.org> wrote:
>>
>> On Jul 20, 2014, at 1:56 PM, Jon Zeppieri <zeppieri at gmail.com> wrote:
>>
>>> I feel like this has come up before, but I can't seem to find the
>>> discussion in the archive.
>>
>> Was this what you were thinking of?
>> http://lists.racket-lang.org/users/archive/2013-November/060427.html
>> http://lists.racket-lang.org/users/archive/2013-November/060429.html
>> http://lists.racket-lang.org/users/archive/2013-November/060430.html
>> http://lists.racket-lang.org/users/archive/2013-November/060433.html
>> http://lists.racket-lang.org/users/archive/2013-November/060437.html
>>
>
> I think so, yes. But since everyone is agreed that this is a bad idea,
> I'll go a different route. I'm perfectly happy to raise an exception
> inside the procedure. Is raise-argument-error the preferred way?
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users

Posted on the users mailing list.