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

Re: Limitations of Attributes

Thread Previous | Thread Next
From:
Branislav Zahradník
Date:
May 7, 2023 13:15
Subject:
Re: Limitations of Attributes
Message ID:
CAB=rbOnXLGuxCtvw3GRrEfgX3970XUR8+huyCGuYnPr2YPKiXw@mail.gmail.com
On Sun, 7 May 2023 at 12:16, Ovid <curtis.poe@gmail.com> wrote:

> 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.
>
>
OK, maybe bad wording again. I meant, when there will be possibility to
change `$self` into something else,
it should be same for every method in class. eg:

class :self($foo) FOO

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