title: Scala automatic getter and setter overwriting with custom _=
body: <p>In scala there is no difference for the user of a class between calling a method or accessing some field/member directly using val x = myclass.myproperty. To be able to control e.g. setting or getting a field, scala let us override the _= method. But is = really a method? I am confused.</p>
  
  <p>Let's take the following code:</p>
  
  <pre><code>class Car(var miles: Int)
  
  var myCar = new Car(10)
  println(myCar.miles) //prints 10
  myCar.miles = 50
  println(myCar.miles) //prints 50
  </code></pre>
  
  <p>Same goes for this code (notice the double space in <code>myCar.miles  = 50</code>):</p>
  
  <pre><code>class Car(var miles: Int)
  
  var myCar = new Car(10)
  println(myCar.miles) //prints 10
  myCar.miles  = 50
  println(myCar.miles) //still prints 50
  </code></pre>
  
  <p>Now i want to change the way how the <code>miles</code> can be set or read, e.g. always printing something on the screen. How can i do this so that the users of my class are not affected and also so that it does not make any difference if whitespaces are used before the = sign?</p>