Scala's implicit setter and getter example from book yields compile error
scala
Solution
The code in book actually contains no space character between `_` and `=`:
Problem
``` class Thermometer{ var celsius: Float = _ def fahrenheit = celsius * 9/5 + 32 def fahrenheit_ = (f: Float) { celsius = (f-32)*5/9 } override def toString = fahrenheit + "F/"+ celsius + "C" } ``` The quoted code is an example from the book `Programming in Scala 2nd edition`. When I try compiling, I get the following error: ``` scalac Thermometer.scala Thermometer.scala:6: error: not found: value f def fahrenheit_ = (f: Float) { ^ ``` Does scala no longer support implicitly defined getters and setters? Is there an error in the code? Or is there a new way of doing this?