On 03/20/2015 03:40 AM, Brandon Allbery wrote:
>
> On Thu, Mar 19, 2015 at 10:33 PM, Tom Browder <tom.brow...@gmail.com
> <mailto:tom.brow...@gmail.com>> wrote:
>
>     Why do you say that is not a method?  The first line says
>
>
> Sorry, somehow I managed to misread that.
>
> So you want what I have already said twice: the accessor `self.elem`.
> If you want to access the variable directly for some reason, you use
> the form `$.elem`. (By the way, that shadowing is generally bad form,
> and not just in Perl 6. It makes code confusing to read)

Actually, $.elem is just short for $(self.elem); if you want direct
access to the variable you'd write $!elem. Also, an "indirect method
call" would be self."$elem", self.$elem is basically equivalent to
$elem(self), which is why you get the "cannot find method
postcircumfix:<( )> error, as whatever's in $elem is probably not
callable like that

Regards
  - Timo

Reply via email to