O'Reilly logo

Pragmatic Scala by Venkat Subramaniam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Method Name Convention

The feature you’re going to look at in this section is pretty cool (I really think so), but it’s also something that can be a bit hard to grasp. If an oxygen mask appears in front of you as you read these pages, secure your mask first before assisting your fellow programmers.

In Operator Overloading, you saw how Scala supports operator overloading even though it doesn’t have operators. Operators are methods with a crafty method naming convention. You saw that the first character of a method decides the precedence. Here we see that the last character of their names also has an effect—it determines the target of the method call.

The convention of : may be surprising at first, but as you get used to it (or as you “develop ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required