diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2013-04-03 22:25:53 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2016-11-10 18:03:22 +0100 |
commit | 95d1672c121f15c64b616124f778554ab9a85b77 (patch) | |
tree | e9f8de5f0394f3ed6785eb9d145cb18cbbff00f6 | |
parent | d5a5fec4802f98ccb93a692285112382fd6f34cb (diff) | |
download | coursera-95d1672c121f15c64b616124f778554ab9a85b77.zip coursera-95d1672c121f15c64b616124f778554ab9a85b77.tar.gz |
Scala : curry and explicite call
-rw-r--r-- | Scala/sandbox/curry.scala | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Scala/sandbox/curry.scala b/Scala/sandbox/curry.scala index 21f287a..84b00ee 100644 --- a/Scala/sandbox/curry.scala +++ b/Scala/sandbox/curry.scala @@ -17,12 +17,15 @@ object Curry { sumF } + def cube (x: Int): Int = x * x * x + def sumInts = sumCurry(x => x) def sumCubes = sumCurry(x => x * x * x) def run = { println("Curry") println(sum(x => x * x, 3, 5)) + println(sumCurry(cube)(3, 5)) println(sumInts(3, 5)) println(sumCubes(3, 5)) } |