[Israel.pm] Perl 5.14: changing push and pop

Shmuel Fomberg owner at semuel.co.il
Mon Nov 29 17:59:36 PST 2010


Hi All.

I just read this blog post:
http://www.modernperlbooks.com/mt/2010/11/when-do-you-report-semantics-errors.html

And I think that they are going in the very wrong path.
instead of changing pop and push to accept references,
change the dereferencing syntax so it will be more pretty.

In my view, it should be something like that:
$a->{bbb}->@;
which means, in $a there is a hash ref, from that hash take the value
under bbb, and this is an array ref. deref it.
Or maybe:
$a->{bbb}->[];
$a->{bbb}->[..];

Of course, the same can be done to hashs:
$a->{bbb}->%;
$a->{bbb}->{};
$a->{bbb}->{..};

and even scalar refs:
$a->{bbb}->$;
$a->{bbb}->$->[5];
$a->{bbb}->$@; #can you figure out what I mean here?

Well, the last could be a problem, as $@ is a variable, and it might 
collide with the ability to
run runtime selected functions of an object, so we might have to put 
arrows between each two,
but it sure looks nice.

So, if any of you know who make such decisions, please forward him this 
email.

Shmuel.







More information about the Perl mailing list