Re: How to get indirect access to a class attribute?

2015-03-25 Thread Bruce Gray
On Mar 25, 2015, at 7:44 AM, Tom Browder tom.brow...@gmail.com wrote: —snip-- 1. How can I indirectly refer to the attributes in a method? The above doesn't work (with or without the '()’). —snip— use v6; our %attrs = ( age = 1, # wgt = 2, # Need to handle No such method before

Re: How to get indirect access to a class attribute?

2015-03-25 Thread Tom Browder
On Wed, Mar 25, 2015 at 8:47 AM, Tom Browder tom.brow...@gmail.com wrote: On Wed, Mar 25, 2015 at 8:29 AM, Moritz Lenz mor...@faui2k3.org wrote: the indirect method call syntax is the right approach, you just got too many other details wrong to make it work. This syntax works in a method as

How to get indirect access to a class attribute?

2015-03-25 Thread Tom Browder
Given a class like: our %attrs = (age=1,wgt=2); class foo { has $.age = rw;} method a { for %attrs.kv - $k, $v { my $aval = self.$k(); # supposed to work for a method name say attr { $k } has value '{ $aval }'; } } Question: 1. How can I indirectly refer to the attributes in a

Re: Re-installation of Perl 6 (Rakudo Star) via rakudobrew on Linux

2015-03-25 Thread Steve Mynott
Although it usually works I've seen some oddities (maybe as minor as one test spec test failure) recently with rakudobrew where it doesn't cleanly rebuild (i assume there are traces of a previous build confusing it). The easiest thing is to delete everything and start again. S On 24 March 2015

Re: How to get indirect access to a class attribute?

2015-03-25 Thread Moritz Lenz
Hi, On 25.03.2015 13:44, Tom Browder wrote: Given a class like: our %attrs = (age=1,wgt=2); class foo { has $.age = rw;} should be 'has $.age is rw'. The is indicates a trait (not an assignment). method a { for %attrs.kv - $k, $v { my $aval = self.$k(); #