[plt-scheme] attaching object names to values

From: Robby Findler (robby at cs.uchicago.edu)
Date: Sat Dec 6 11:55:55 EST 2008

I think there isn't one, but if you see how to make one, please let me know.

FWIW, provide/contract does a better job than just `contract' and I
believe would do what you want.


On Fri, Dec 5, 2008 at 12:44 PM, Sam TH <samth at ccs.neu.edu> wrote:
> The contract system uses the `object-name' of predicates to print out
> their names in error messages.  But this can be useless if the
> predicate itself is wrapped in a contract.  This program shows the
> problem pretty well:
> #lang scheme
> (define x? (contract (-> any/c boolean?) (lambda (x) #t) 'here 'there))
> (define my/c (-> x? x?))
> (contract my/c 5 'foo 'bar)
> It gives a contract error referencing "unsaved-editorx:y:z", instead
> of "x?".  Unfortunately, there seems to be nothing that I can do to
> change the object-name of the contract value (except eta-expand).
> Notably, the inferred-name syntax property doesn't work, since the
> actual lambda expression isn't available (it's in the contract
> library). Is there a solution here I'm missing?
> Thanks,
> --
> sam th
> samth at ccs.neu.edu
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Posted on the users mailing list.