Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 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