From c44cffe5a88c1221697cffe23dacaec42e976c4d Mon Sep 17 00:00:00 2001 From: Mark Lee Date: Thu, 30 Apr 2015 14:22:37 -0400 Subject: [PATCH] Add example of struct subtype inheritance of supertype. Clarify struct subtype inherits the prefix of the struct supertype. --- pkgs/racket-doc/scribblings/guide/define-struct.scrbl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/racket-doc/scribblings/guide/define-struct.scrbl b/pkgs/racket-doc/scribblings/guide/define-struct.scrbl index eda5d94bec..b5481a95fc 100644 --- a/pkgs/racket-doc/scribblings/guide/define-struct.scrbl +++ b/pkgs/racket-doc/scribblings/guide/define-struct.scrbl @@ -136,8 +136,11 @@ supertype. (define p (3d-posn 1 2 3)) p (posn? p) -(posn-x p) (3d-posn-z p) +(code:comment "a 3d-posn has an x field, but there is no 3d-posn-x selector:") +(3d-posn-x p) +(code:comment "use the supertype's posn-x selector to access the x field:") +(posn-x p) ] @; ------------------------------------------------------------