kellysmith12.21
2021-1-16 23:47:23

I’ve updated my procedure contracts to have custom names that print like the constructor macro.


kellysmith12.21
2021-1-16 23:48:13

Now, I need to add support for pre and post conditions, so that both -> and ->* are fully covered.


notjack
2021-1-17 00:47:26

Do they just affect printing, or do object-name and contract-name also work on your contracts?


kellysmith12.21
2021-1-17 01:43:37

contract-name works on my procedure contracts, but object-name returns 'make-chaperone-contract.


kellysmith12.21
2021-1-17 01:44:50

My procedure contract macro builds a contract with -> or ->*, then renames it with rename-contract, using a special struct that holds the name information and has gen:custom-write enabled.


kellysmith12.21
2021-1-17 04:07:03

I’m deciding how to handle pre- and postconditions, and I have a potential solution: a precondition of #:pre [<name> <test-expr> <fail-msg>] would be transformed into a precondition within ->* of the form #:pre/desc (if <test-expr> #true <fail-msg>), and <name> would appear in the contract-name. I think that would be a slightly clearer/better API than what ->* currently provides. Is that a reasonable solution?