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

Replace step_1.rkt

parent 8f21c65e
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -3,8 +3,8 @@
(define (point x y)
(define (setx value)
(set! x value))
(define (add point)
(list (+ x (point 'getx)) (+ y (point 'gety))))
(define (add p)
(point (+ x (p 'getx)) (+ y (p 'gety))))
(define (self m)
(cond ((eq? m 'getx) x)
((eq? m 'gety) y)
......@@ -12,7 +12,7 @@
((eq? m 'info) (list (self 'type) (self 'getx) (self 'gety)) )
((eq? m 'setx!) setx )
((eq? m 'add) add)
(else (display "ERROR"))))
(else (display "Message not understood")))) ; error ?
self)
(display "coucou")
......@@ -31,3 +31,5 @@
(display (p1 'getx))
(newline)
(display ((p1 'add) p2))
(newline)
(display (p1 'foo))
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