I would like to write a contract requiring that a class can be instantiated without any initialization arguments.
I can express this as a flat contract that tries to create an object, e.g.: > (flat-named-contract > 'class-without-required-initialization-args/c > (and/c class? > (λ (%) > (with-handlers ([exn:fail? (λ (e) #f)]) > (new %))))) However, in my intended use case, instantiating the class may be expensive, so I need to avoid doing it when the contract is applied: either by inspecting information about the class, if that is somehow available, or by delaying checking until initialization is attempted. Is there currently a way to do this? -- 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.