Overloaded operators: Difference between revisions

m
m (→‎{{header|Raku}}: Add some verbiage about precedence and symbol reuse)
Line 670:
 
 
Base Raku has 27 different operator precedence levels for built-ins. You could theoretically give a new operator aan absolute numeric precedence but it would be difficult to predict exactly what the relative precedence would be. Instead, precedence is set by setting a relative precedence; either equivalent to an existing operator, or, by setting it tighter(higher) or looser(lower) precedence than an existing operator. When tighter or looser precedence is specified, a whole new precedence level is created squeezed in between the named level and its immediate successor (predecessor). The task [[Exponentiation_with_infix_operators_in_(or_operating_on)_the_base#Raku|Exponentiation with infix operators in (or operating on) the base]] demonstrates three different operators that nominally do the same thing, but may yield different results due to differing precedence levels.
 
 
10,327

edits