One of the design goals of the generics system is to avoid relying on global state, which would lead to CLOS-style spooky-action-at-a-distance.
For that reason, you can only define methods for a given struct type and interface if you're either (1) defining the struct type (via #:methods) or (2) defining the interface (via default methods). Methods can't be added post-facto by aribitrary third parties. I don't know how to do multiple dispatch while preserving this property. If we knew how to do that, I have no argument against introducing multiple dispatch to the generics library. As for GLS, I'm not familiar with that package. Maybe Roman can chime in? Vincent On Mon, 15 Feb 2016 03:35:01 -0600, Alexey Cherkaev wrote: > > Hi all, > > I have seen (and used) generic interfaces for structures in Racket. However, > they are limited to the same degree as message-passing OOP is limited: the > dispatch is based on one argument only. > > I know there is Swindle (is it still active?) and I could find GLS in > packages for DrRacket. Is GLS a preferred way for building generic (multiple) > dispatch? > > Are there arguments against using multi-methods or other ways of building > generic (and extensible) dispatch? > > Thanks, > Alexey > > -- > 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. -- 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.