I’ve updated my procedure contracts to have custom names that print like the constructor macro.
Now, I need to add support for pre and post conditions, so that both -> and ->* are fully covered.
Do they just affect printing, or do object-name and contract-name also work on your contracts?
contract-name works on my procedure contracts, but object-name returns 'make-chaperone-contract.
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.
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?