March 2014 update
This commit is contained in:
parent
09687c4926
commit
a25938f123
1846 changed files with 21876 additions and 5203 deletions
16
Task/Polymorphic-copy/Racket/polymorphic-copy-3.rkt
Normal file
16
Task/Polymorphic-copy/Racket/polymorphic-copy-3.rkt
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
;#lang racket
|
||||
|
||||
(define point%
|
||||
(class object%
|
||||
(super-new)
|
||||
(init-field x y)
|
||||
(define/public (clone) (new this% [x x] [y y]))
|
||||
(define/public (to-list) (list this% x y))))
|
||||
|
||||
(define point/color%
|
||||
(class point%
|
||||
(super-new)
|
||||
(inherit-field x y)
|
||||
(init-field color)
|
||||
(define/override (clone) (new this% [x x] [y y] [color color]))
|
||||
(define/override (to-list) (list this% x y color))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue