On 03/20/2015 11:00 AM, Timo Paulssen wrote:
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",

small correction: self."$elem"().
self."$elem" is an error, which is useful to catch p5 programmers who use . for string concatenation.

Cheers,
Moritz

Reply via email to