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. On Sat, Mar 16, 2019 at 8:24 AM Luis Sanjuán <luisj.sanj...@gmail.com> wrote: > Maybe #:auto/#:auto-value is what you want: > > ``` > (struct fish (name [size #:auto]) > #:auto-value 'big > #:transparent) > (struct shark fish (scares-people?) #:transparent) > > (define white-shark (shark "The big white" #t)) > ``` > > -- > You received this message because you are subscribed to a topic in the > Google Groups "Racket Users" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/racket-users/TthsE0FZDB0/unsubscribe. > To unsubscribe from this group and all its topics, 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.