develooper Front page | perl.perl5.porters | Postings from May 2023

Re: Limitations of Attributes

Thread Previous | Thread Next
From:
Ovid
Date:
May 7, 2023 10:16
Subject:
Re: Limitations of Attributes
Message ID:
CA+M4CHuE=n5au5kz24FVzyewt0GjFh8rkpY=wMZpdcs9zwOF2g@mail.gmail.com
On Sat, May 6, 2023 at 7:41 AM Branislav Zahradník <happy.barney@gmail.com>
wrote:

> A quick note on that part - the newly-added `method` keyword doesn't
>> allow you to rename the invocant variable at all. You just get `$self`,
>> so there's no such syntax ambiguity here to worry about.
>>
>
> If ever supported, it should be part of `class` syntax and not method
> Every method of same class should use same name for `$self`
>

That's how it is implemented. method is part of the class/Corinna syntax
and the invocant name is always $self. I'm very happy to see that pain
point go away.

Best,
Ovid

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About