RosettaCodeData/Task/Collections/Perl-6/collections-4.pl6

4 lines
150 B
Raku
Raw Permalink Normal View History

2018-06-22 20:57:24 +00:00
class Something { has $.foo; has $.bar };
2013-10-27 22:24:23 +00:00
my $obj = Something.new: foo => 1, bar => 2;
my $newobj = $obj but role { has $.baz = 3 } # anonymous mixin