On Fri, Aug 17, 2018 at 9:20 PM, Christopher Lemmer Webber < cweb...@dustycloud.org> wrote:
> David Storrs writes: > > > I've been going through the docs on struct properties, both the Guide and > > the Reference. I can't see any way to add new properties to a struct at > > runtime (i.e., after the type is defined); is there a way? > > Not generally afaik. This is fairly intentional in Racket's design. > Good to know, thanks. > Though I wonder what your use cases are? Here are some routes you might > explore, depending on what it is: > - Use a "tagged hashmap" as a kind of cheap object structure > - Use Racket's classes system, which *does* support runtime composition > composition of classes (but not of extending an object already > instantiated with a class) > It wasn't essential. It just might have been easier to define the struct and then apply the add the properties after a few lines of processing. -- 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.