I have a project with 57 prefab structure types. I need to construct instances 
using a local contract (module level contracts do not fit my needs here). Since 
I cannot define guards, the solution is easy enough.

(struct foo (num) #:prefab)
(define/contract make-foo (-> real? foo?) foo)

Problem: I already have a few hundred constructor calls without contracts. I 
could either A) rewrite them all to use contracted constructors, or B) attach 
local contracts in a sweet spot so that I don't have to rewrite anything else.

I prefer option B, but it doesn't look like I can attach a local contract to a 
constructor with `struct` alone, or even with an impersonator. When I hack 
around to rebind or hide the constructor's identifier, I break compatibility 
with `match` and `defstruct*`.

If you were in my position, what would you do?

--

~slg

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/0a16cfbe-4789-a939-796e-5f6f9da21626%40sagegerard.com.

Reply via email to