A word about operators
- You may have the impression that Perl 6 is operator crazy
- If so, you are right
- Part of the Perl 6 philosophy is to have a very rich set of operators
- It's up to programmers not to abuse this
- eg As an infix,
+
(by itself) should always refer to mathematical addition
-
prefix:<+>
is just sugar for calling an object's Numeric
conversion method
- Operators which start with
+
are numeric operators
- For instance,
+&
converts both its arguments to Int
and does bitwise AND on them
-
prefix:<?>
is sugar for .Bool
, and ?|
converts its arguments to Bool
and ORs them
-
prefix:<~>
is sugar for .Str
, conversion to a string
« first
< prev
(40 / 41)
next >
last »