A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
13
Task/Inheritance-Single/Racket/inheritance-single.rkt
Normal file
13
Task/Inheritance-Single/Racket/inheritance-single.rkt
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#lang racket
|
||||
|
||||
(define animal% (class object% (super-new)))
|
||||
(define dog% (class animal% (super-new)))
|
||||
(define cat% (class animal% (super-new)))
|
||||
(define lab% (class dog% (super-new)))
|
||||
(define collie% (class dog% (super-new)))
|
||||
|
||||
;; unit tests
|
||||
(require rackunit)
|
||||
|
||||
(check-true (is-a? (new dog%) animal%))
|
||||
(check-false (is-a? (new collie%) cat%))
|
||||
Loading…
Add table
Add a link
Reference in a new issue