πŸ“˜ Method postfix operator .^ in Perl 6

πŸ“˜ Method postfix operator .^ in Raku

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


.^method calls a method on the object’s metaobject. A metaobject is an instance of the HOW class and contains some additional information about the object. The following two operations, applied to the $i variable, are equivalent and print the list of the methods available for the Int variables.

my Int $i;
say $i.^methods();
say $i.HOW.methods($i);

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