Skip to content

Commit

Permalink
Again! EOM
Browse files Browse the repository at this point in the history
  • Loading branch information
timvisher committed Apr 12, 2012
1 parent 2e3e1db commit 309178e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion ft3/product-currying/src/product_currying/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,18 @@
;; def incrementer = adder.curry(1)

;; println "increment 7: ${incrementer(7)}"
(def increment (partial + 1))
(def increment (partial + 1))

;; object CurryTest extends Application {

;; def filter(xs: List[Int], p: Int => Boolean): List[Int] =
;; if (xs.isEmpty) xs
;; else if (p(xs.head)) xs.head :: filter(xs.tail, p)
;; else filter(xs.tail, p)

;; def dividesBy(n: Int)(x: Int) = ((x % n) == 0)

;; val nums = List(1, 2, 3, 4, 5, 6, 7, 8)
;; println(filter(nums, dividesBy(2)))
;; println(filter(nums, dividesBy(3)))
;; }

0 comments on commit 309178e

Please sign in to comment.