πŸ“˜ 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

Leave a Reply

Your email address will not be published. Required fields are marked *

Retype the CAPTCHA code from the image
Change the CAPTCHA codeSpeak the CAPTCHA code