Skip to content
Extraits de code Groupes Projets
Valider a363dcd2 rédigé par Nicolas Verbois's avatar Nicolas Verbois
Parcourir les fichiers

Update step_3b.rkt

parent d91ea09e
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -4,7 +4,7 @@
; Group F
; In this step, we will introduce a form of inheritance, and to do so
; we have created two new classes : objects and color-points.
; we have created two new classes : object and color-point.
; Each class will now have in its state a reference, named super, which
; will be pointing to its (unique) parent class.
......@@ -20,6 +20,8 @@
; it is in this class that we will eventually display if a message
; is not understood.
(define (object)
; Since object is the root of the hierarchy, it has no super value, here represented as a 'nil value.
(define super 'nil)
(define (gettype) 'object)
(define (self m)
(cond ((eq? m 'type) (gettype))
......@@ -110,7 +112,7 @@
(display '----------)
(newline)
; We then test thee creation of two standard points, and verify that
; We then test the creation of two standard points, and verify that
; the different methods from previous steps still work as intended.
(define p1 (point 1 2))
(define p2 (point 3 4))
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter