Verifying the contract on a function

26 views
Skip to first unread message

David Storrs

unread,
Feb 24, 2021, 6:03:18 PM2/24/21
to Racket Users
I have some macros that generate functions.  For testing purposes, I'd like to be able to ask the function "Do you have this contract <contract>?"  Is there a way to do that?  I've been digging through the Contracts section and googled for it but I'm not seeing one.

Sam Tobin-Hochstadt

unread,
Feb 24, 2021, 10:20:24 PM2/24/21
to David Storrs, Racket Users
You can use the value-contract function, along with contract-stronger? to do this. 

Sam

On Wed, Feb 24, 2021, 6:03 PM David Storrs <david....@gmail.com> wrote:
I have some macros that generate functions.  For testing purposes, I'd like to be able to ask the function "Do you have this contract <contract>?"  Is there a way to do that?  I've been digging through the Contracts section and googled for it but I'm not seeing one.

--
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 racket-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CAE8gKodrApnAtr%3D5BpvSLxiKAAQJjO2bj7HkE_75-VLb25rNgA%40mail.gmail.com.

David Storrs

unread,
Feb 24, 2021, 11:01:57 PM2/24/21
to Racket Users
Aha.  That and contract-equivalent? do what I need.  Thanks, Sam.
Reply all
Reply to author
Forward
0 new messages