Re: [racket-users] Creating struct types that default parent type fields

2017-06-02 Thread Tony Garnock-Jones
On 06/02/2017 02:05 PM, David Storrs wrote: > Suppose I have the following: > [...] One possible option is http://pkgs.racket-lang.org/package/struct-defaults: ~$ racket Welcome to Racket v6.6.0.4. > (require struct-defaults) > (struct my-exn exn:fail ()) > (define-struct-defaults mk-my-exn my-ex

[racket-users] Creating struct types that default parent type fields

2017-06-02 Thread David Storrs
Suppose I have the following: In the REPL: > (struct exn:fail:db exn:fail ()) > (struct exn:fail:db:num-rows exn:fail:db ()) > (struct exn:fail:db:num-rows:zero exn:fail:db:num-rows <...something...>) > (define failed (exn:fail:db:num-rows:zero)) > (exn? failed) #t > (exn:fail:db? failed) #t > (ex