develooper Front page | perl.perl5.porters | Postings from July 2020

Re: So are refaliasing and declared_refs stable?

Thread Previous
From:
Alexander Hartmaier
Date:
July 24, 2020 11:37
Subject:
Re: So are refaliasing and declared_refs stable?
Message ID:
CAB49QrYifx_+veUMnE0iEVQE2rV5frBGw3A0m+G7g+bWbu=nSQ@mail.gmail.com
On Fri, Jul 24, 2020 at 1:49 AM Eric Brine <ikegami@adaelis.com> wrote:

> On Tue, Jul 21, 2020 at 3:41 PM Alexander Hartmaier <
> alex.hartmaier@gmail.com> wrote:
>
>> I wonder why the postfix dereferencing syntax isn't used for a new
>> features as that's newer and thus preferred way of dereferencing: my @a->@*
>> = [];
>> Is this even allowed? I guess not.
>>
>
> @a->@* means @{ @a }, which makes no sense.
>
> 1) It would be a strict refs error as you attempt to dereference a number,
> except it doesn't even get that far.
>
> 2) Even if you used something legal on the LHS of the ->@*, this could
> never work. Assigning to an array,  whether using @a = ... or $ref->@* =
> ..., already has a different meaning.
>
> Dereferencing is the opposite of what's appropriate here. So it's not a
> question which dereferencing syntax is or should be supported.
>
> You're right, I mixed it up: my @a = []->@*; makes more sense.

Thread Previous


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