Oo for fp
- 4. (extend-‐type
CartesianCoordinate
Moveable
(move-‐north
[{x
:x
y
:y}
ammount]
(CartesianCoordinate.
(+
x
ammount)
y))
(move-‐east
[{x
:x
y
:y}
ammount]
(CartesianCoordinate.
x
(+
y
ammount))))
- 7. (extend-‐type
CenterPointRectangle
Moveable
(move-‐north
[self
ammount]
(update-‐in
self
[:center-‐point]
#(move-‐x
%
ammount)))
(move-‐east
[self
ammount]
(update-‐in
self
[:center-‐point]
#(move-‐y
%
ammount))))