Demonstrates value functions, anonymous functions, closures ...
Other specific applications, but also in the production of it.
This is over. Other Sam,curry, higher-order functions, sets, generics, implicit classes: These, or find a special book to get a deeper understanding of ...
C:\users\hengheng>scalawelcome to Scala version 2.11.6 (Java HotSpot (TM) 64-bit Server VM, Java 1.6.0_43). Type in expressions to has them evaluated. Type:help for more information.scala> def add (X:int, y:int): Int = (x + y) Add: (X:int, Y:int) intscala> var r Esult = Add _result: (int, int) + int = <function2>scala> result (1, 2) Res0:int = 3scala> (x:int) + = x + 3res1:int = int = <function1>scala> var fun = (X:int) + x + 3fun:int = int = <function1> ;scala> Fun (7) Res2:int = 10scala> var y = 1y:int = 1scala> val sum = (x:int) + x + ysum:int = Int = <function1>scala> sum (5) Res3:int = 6scala>
Functional programming in Scala