Re: How to accomplish a method interpolation?
s repetition, maybe there are > other ways, for example: > > for %!items:kv { > say $^key.tc, ' ', $^value.amount; > } > > or if you want all items: > > for %!items { > say .key.tc, ' ', .value.amount; > } > > On 2017-12-30 05:1
How to accomplish a method interpolation?
I'm reading a book "Make your own python text adventure" and decided to give it a try with perl6. So this code works as expected. class Bag { has %.items; method show { say "ropa ", %!items.amount if %!items:exists; say "femur ", %!items.amount if %