Created
July 31, 2020 16:30
-
-
Save gfldex/f577d9816af2b6b2dc2e84e92a3ace10 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
use v6.d; | |
class C { | |
has $.foo; | |
has $.bar; | |
method m { | |
my %h = foo => 1, bar => 2; | |
for self.^attributes { | |
.set_value(self, %h{.name.subst(/^'$!'/, '')}) | |
} | |
self | |
} | |
} | |
dd C.new.m; | |
# LEAVE slurp($*PROGRAM).say; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment