Created
March 24, 2018 17:33
-
-
Save ronaldxs/c4a992739642824cf7da97509ddf9b58 to your computer and use it in GitHub Desktop.
Shouldn't there be an auto-generated accessor here
This file contains hidden or 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
use v6; | |
class C { has $.a = 3; | |
multi method a(Int $i) { | |
$!a = $i * 2 | |
} | |
} | |
my $o = C.new; | |
$o.a(4); | |
say 'mutated attribute'; | |
say $o.a; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment