1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
Type in expressions to have them evaluated.
Type :help for more information.
scala> (2)
res0: Int = 2
scala> (2 + 2)
res1: Int = 4
scala> ((2 + 2))
res2: Int = 4
scala> ((2 + 2))
res3: Int = 4
scala> ( (2 + 2))
res4: Int = 4
scala> ( (2 + 2 ) )
res5: Int = 4
scala> 5 ; ( (2 + 2 ) ) ; ((5))
res6: Int = 5
scala> (((2 + 2)), ((2 + 2)))
res7: (Int, Int) = (4,4)
scala> (((2 + 2)), ((2 + 2)), 2)
res8: (Int, Int, Int) = (4,4,2)
scala> ((((2 + 2)), ((2 + 2)), 2).productIterator ++ Iterator(3) mkString)
res9: String = 4423
scala>
scala> 55 ; ((2 + 2)) ; (1, 2, 3)
res10: (Int, Int, Int) = (1,2,3)
scala>
scala> () => 5
res11: () => Int = <function0>
scala> 55 ; () => 5
res12: () => Int = <function0>
scala> () => { class X ; new X }
res13: () => java.lang.Object with ScalaObject = <function0>
scala>
scala> def foo(x: Int)(y: Int)(z: Int) = x+y+z
foo: (x: Int)(y: Int)(z: Int)Int
scala> foo(5)(10)(15)+foo(5)(10)(15)
res14: Int = 60
scala>
|