#odersky-programming-in-scala-1ed #scala
Similarly, when an assignment is made to a variable to which parentheses and one or more arguments have
been applied, the compiler will transform that into an invocation of an update method that takes the
arguments in parentheses as well as the object to the right of the equals sign.
If you want to change selection, open document below and click on "Move attachment"
Next Steps in Scalaplication
of an object to some arguments in parentheses will be transformed to an apply
method call. Of
course this will compile only if that type of object actually defines an apply method.
So it's not a special case; it's a general rule.
<span>Similarly, when an assignment is made to a variable to which parentheses and one or more arguments have
been applied, the compiler will transform that into an invocation of an update method that takes the
arguments in parentheses as well as the object to the right of the equals sign.
For example:
greetStrings(0) = "Hello"
will be transformed into:
greetStrings.update(0, "Hello")
Thus, the following is semantically equivalent t Summary
status | not read | | reprioritisations | |
---|
last reprioritisation on | | | suggested re-reading day | |
---|
started reading on | | | finished reading on | |
---|
Details