On Wed, Sep 2, 2020 at 3:41 PM Christopher Lemmer Webber <
cweb...@dustycloud.org> wrote:

> Unfortunately I can't use #:methods with struct/contract so I'm stuck
> with the slow one if I want a contract on the struct?
>

For another option (though you may already know this), I'd advocate for
using the `struct` sub-form of `contract-out` and drawing the module
boundary as tightly as needed to make it a sensible boundary for trust,
potentially by using submodules.

Since you mention `#:methods` in particular, you should be aware of some
subtle corners that make it tricky (and potentially expensive at runtime)
to protect  `racket/generic` methods comprehensively with contracts. (Here's
a pointer to some discussions.
<https://github.com/racket/racket/issues/1710>) I think just working with
struct-type properties can make sense when you don't really need most of
the features `racket/generic` gives you.

-Philip

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/0100017450ed66ea-e1b5b7a3-11cf-416b-bcab-dc314bc692b2-000000%40email.amazonses.com.

Reply via email to