April 2017
Intermediate to advanced
316 pages
9h 33m
English
We can define custom operators using the following syntax:
operatorType operator operatorName { }
Here, operatorType can be one of the following:
Custom infix operators can also specify a precedence and an associativity:
infix operator operatorName { associativity left/right/none precedence}
The possible values for associativity are left, right, and none. Left-associative operators associate to the left if written next to other left-associative operators of the same precedence. Similarly, right-associative operators associate to the right if written next to other right-associative operators of the same precedence. Non-associative operators cannot be written next to other operators with ...
Read now
Unlock full access