From 95d1672c121f15c64b616124f778554ab9a85b77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 3 Apr 2013 22:25:53 +0200 Subject: Scala : curry and explicite call --- Scala/sandbox/curry.scala | 3 +++ 1 file changed, 3 insertions(+) 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)) } -- cgit v1.1-2-g2b99