📘 Prefix operators ? and so in Perl 6

📘 Prefix operators ? and so in Raku

N. B. Perl 6 has been renamed to Raku. Click to read more.


? is a unary operator casting the context to a Boolean one by calling the Bool method on an object.

say ?42; # True

The second form, so, is a unary operator with lower precedence.

say so 42;   # True
say so True; # True
say so 0.0;  # False