Add example of struct subtype inheritance of supertype. Clarify struct subtype inherits the prefix of the struct supertype.

This commit is contained in:
Mark Lee 2015-04-30 14:22:37 -04:00 committed by Matthew Flatt
parent ed0e98b305
commit c44cffe5a8

View File

@ -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)
]
@; ------------------------------------------------------------