Add example of struct subtype inheritance of supertype. Clarify struct subtype inherits the prefix of the struct supertype.
This commit is contained in:
parent
ed0e98b305
commit
c44cffe5a8
|
@ -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)
|
||||
]
|
||||
|
||||
@; ------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue
Block a user