Philip McGrath writes:

> 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.

Yes... probably what I should do in the future.

> 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.

:O

-- 
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/87wo1ba8c1.fsf%40dustycloud.org.

Reply via email to