The assignment p.age = 3 could be replaced by p.age_=(3). When Scala encounters an assignment like x = e, it checks whether there’s any method defined like x_= and if so, it invokes the method. The assignment interpretation is interesting in Scala, and it can mean different things based on context. For example, assignment to a function application like f(args) = e is interpreted as f.update(args)
This makes the language so dense! Difficult to get the hang of but I think It'll allow for declarative power.
Share this highlighthttp://www.safaribooksonline.com/a/scala-in-action/61/