[plt-scheme] provide/contract and inferred-name
Unfortunately, not. Function contracts create wrappers. And the
wrapper is created as part of the ->, only once, before the actual
function shows up. So, the contract library does its best and uses the
name in the contract (but even this is not possible if you start
abstracting over the contract constructors).
Robby
On Mon, Apr 14, 2008 at 7:16 PM, Doug Orleans <dougorleans at gmail.com> wrote:
> The following module:
>
> #lang scheme
>
> (define foo1 (let ((bar1 (lambda (x) 0))) bar1))
> (provide foo1)
>
> (define foo2 (let ((bar2 (lambda (x) 0))) bar2))
> (provide/contract (foo2 (-> string? number?)))
>
> produces the following behavior:
>
> > foo1
> #<procedure:bar1>
> > foo2
> #<procedure:foo2>
>
> It seems that provide/contract overwrites the inferred name. Is there
> a way around this?
>
> --dougorleans at gmail.com
> _________________________________________________
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>