[racket] Unexpected procedure identity

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Thu Sep 16 08:11:11 EDT 2010

Sorry, there isn't a way to do that at the moment.

But it occurs to me that when Stevie is done with the chaperone
overhaul of the contract system then equal? will do what you want (so
you can use hashes for your metadata).


On Thu, Sep 16, 2010 at 7:05 AM, Markku Rontu <markku.rontu at iki.fi> wrote:
> I'm continuing with define/contract a bit. Let's say there are two
> definitions like this
> #lang racket
> (define/contract (sum/c lon)
>   ((listof number?) . -> . number?)
>   (sum lon))
> (define (sum lon)
>   (if (empty? lon)
>       0
>       (+ (first lon)
>          (sum (rest lon)))))
>> (has-contract? sum/c)
> #t
>> (has-contract? sum)
> #f
> Is there a way to get to what is protected by the contract? I can figure out
> that the procedure sum/c is protected by a contract with has-contract? but I
> would like to get the wrapped procedure (unprotected sum/c) out in that
> case. Perhaps that would be suitable for identity purposes? Or let's say the
> blame object in case the procedure is to blame?
> I couldn't find anything from the documentation about this.
> -Markku

Posted on the users mailing list.