Permalink
Browse files

Working though chapter 3

  • Loading branch information...
1 parent 39a190f commit 9c53c2dfb11526b963c0d930655b5fc478edfe26 @aubreyrhodes committed Nov 27, 2012
Showing with 20 additions and 0 deletions.
  1. +20 −0 my-solutions/3.4.clj
View
@@ -0,0 +1,20 @@
+(def add
+ (fn [point1, point2]
+ (Point (+ (x point1) (x point2))
+ (+ (y point1) (y point2)))))
+
+(def shift_add
+ (fn [this, point]
+ (shift this (x point) (y point))))
+
+(def make
+ (fn [class, & args]
+ (apply class args)))
+
+(def equal-triangles?
+ (fn [& triangles]
+ (apply = triangles)))
+
+(def valid-triangle?
+ (fn [& points]
+ (= points (distinct points))))

0 comments on commit 9c53c2d

Please sign in to comment.