Hi all,

suppose I have a struct `(struct fish (size name) #:transparent)` and a 
sub-type `(struct shark fish (scares-people?) #:transparent)`. What if I 
want all sharks to have size 'large by default whenever I create one, so 
that I create them via:

(define white-shark (shark "The big white" #t))

rather than 

(define white-shark (shark 'big "The big white" #t))

Is that possible to do, other than defining my own wrapper? If it is not 
possible with the current structures, I guess it would be bad practice to 
overwrite the `shark` constructor, and rather create a `my-shark` 
constructor to avoid (hypothetical) reader of my code wouldn't get confused.

Best,
Marc

-- 
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.

Reply via email to