On Thu, Dec 20, 2018 at 1:08 AM Philip McGrath <phi...@philipmcgrath.com> wrote: > > I would also note that, if you expose the struct-ness of your datatype to > clients, adding a field creates a similar compatibility problem with the > constructor.
<self-promotion class="shameless"> ; version 1 of your file: (require struct-plus-plus) (struct++ dog (name age)) (dog 'fido 7) ; success. base Racket constructor functions as normal (dog++ #:name 'fido #:age 7) ; success. struct++ keyword constructor works ; version 2 of your file: (require struct-plus-plus) (struct++ dog (name age [(color 'brown)])) (dog 'fido 7) ; FAIL! missing field, base Racket constructor throws (dog++ #:name 'fido #:age 7) ; all good. the color field defaults to 'brown </self-promotion> > > -- > 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.