in reply to What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
I would barter all of these improvements for a less noisy but performant elemement accessor syntax:
i.e.
$it->{$key}->[$idx]->{section}->[$i]->{'some.doc'}->method1()->[sub1 +(5)]->method2($x); # or $it->{$key}[$idx]{section}[$i]{'some.doc'}->method1()->[sub1(5)]->me +thod2($x);
becomes something like:
or something smarter...$it->@( $key $idx section $i some.doc method1() sub1(5) method2($x) +);
Disambiguation: If the actual element is blessed and can('method1'), it is invoked. Otherwise it is treated as a function call (:: might be used for further disambiguation).
I.e. similar to Data::Diver, just more efficient together with a pragma or other method to control auto-vivification. Yes, I am aware, that I could build something similar as a module, but it would be pure Perl.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
by tobyink (Canon) on Sep 11, 2020 at 08:44 UTC | |
by Perlbotics (Bishop) on Sep 11, 2020 at 17:12 UTC |
In Section
Meditations