What is the motivation for Scala assignment evaluating to Unit rather than the value assigned?

I advocated for having assignments return the value assigned rather than unit. Martin and I went back and forth on it, but his argument was that putting a value on the stack just to pop it off 95% of the time was a waste of byte-codes and have a negative impact on performance.

Leave a Comment