in reply to Re: Is auto-dereferencing worth forcing upgrades to newer versions of Perl?
in thread Is auto-dereferencing worth forcing upgrades to newer versions of Perl?
It may be superseded by more recent p5p discussions about a "postfix dereference" operator.
Which would be an even more useless, fad-driven, change-for-change's-sake, distraction to nowhere than auto-dereferencing.
The justifiction for this: @{ $ref } becoming: $ref->@* or $ref->[] (empty brackets) or dog-knows what else is: Blech
I ask you. The technical justifiction is "Blech".
Funnily enough, I agree that this: push @{ $x->{foo}->[0]->m }, $y; is a bit ugly.
But who writes code like that anyway? And what would it mean if they did?
Let's break that mother down:
Why would anyone invent an api that requires you to call a method to get a reference to an (internal) array onto which we are to push values; rather than just passing the values to be pushed to a method that does it for us?
Yes, I know it is an invented, over-the-top example to make a point.
And that's my point. If you have to use an invented, over-the-top example to justify something; you've failed.
Cos, $x{foo}[0]->push( $y ) is clean, simple and obvious. And it works right now.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Is auto-dereferencing worth forcing upgrades to newer versions of Perl?
by chromatic (Archbishop) on Aug 20, 2013 at 01:13 UTC | |
by BrowserUk (Patriarch) on Aug 20, 2013 at 01:57 UTC | |
Re^3: Is auto-dereferencing worth forcing upgrades to newer versions of Perl?
by xdg (Monsignor) on Aug 20, 2013 at 00:23 UTC | |
by BrowserUk (Patriarch) on Aug 20, 2013 at 00:49 UTC | |
by xdg (Monsignor) on Aug 20, 2013 at 19:54 UTC | |
by BrowserUk (Patriarch) on Aug 20, 2013 at 20:05 UTC |