-
-
Save zoffixznet/55c8198c63177a9729be75ec7c61afde to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Point { | |
has $!x; | |
has $!y; | |
} | |
my int $total := 0; | |
my int $i; | |
while ++$i <= 1_000_000 { | |
my $p := Point.new(x => 2, y => 3); | |
$total := $total + nqp::getattr($p, Point, '$!x') + nqp::getattr($p, Point, '$!y'); | |
} | |
say($total); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment