jc zulian
Posts: 1
Nickname: jc24
Registered: Dec, 2007
|
|
Error in chapter 8 p.158
|
Posted: Jan 3, 2008 5:35 AM
|
|
|
Advertisement
|
In section 8.5 towards the end of the page you write :
scala> def twice(op: Double => Double, x: Double) = op(op(x)) twice: ((Double) => Double,Double)Double scala> twice(_ + 1, 5) res24: Double = 7.0
The type of op in this example is double => double, which means it is a closure that takes one double as an argument and returns another closure.
Unless I am mistaken it should be : [..], which means it is a closure that takes one double as an argument and returns another double.
|
|