Once you discover that the default constructor for a struct is just a simple procedure that was generated for you, it's not that big of deal to just make your own and export it like this:
(provide (except-out (struct-out fish) fish) (rename-out (make-fish fish))) All the code relying on it will still work. Except I guess if you pass through different phase levels, it becomes a bit more complicated because you have a syntax attached at compile-time to the identifier. But that's another issue. Correct me if I'm wrong. On Monday, March 18, 2019 at 2:11:46 PM UTC+1, Marc Kaufmann wrote: > > Yes, I saw that, the problem is that I want to be able to set a > (potentially different) default value for the sub-type shark than for the > sub-type guppy. So if I set the value to 'big for all `fish`, then I can't > do that. Essentially, I'd need an #:auto for every sub-type, but the #:auto > refers to a parent/super field. > > I'll just run with defining a custom constructor. > -- 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.