develooper Front page | perl.perl5.porters | Postings from February 2012

Stealing stackable modifiers from Perl 6

Thread Next
From:
Aristotle Pagaltzis
Date:
February 6, 2012 02:11
Subject:
Stealing stackable modifiers from Perl 6
Message ID:
20120206101052.GA20508@fernweh.plasmasturm.org
Hello porters,

if memory serves, it has always been the case that Perl 5 could easily
allow arbitrarily stacked statement modifiers, but Larry consciously
chose to forbid this, with an eye toward the readability of code.

For Perl 6, he has recanted very slightly.

Arbitrary stacking is still forbidden in Perl 6, but two modifiers can
be stacked as long as one is a conditional (if, unless, when) and the
other a loop (while, until, for/-each).

I like this solution a lot. It covers all of the cases in which I’ve
ever had a reasonable (to me!) hankering for stackable modifiers, while
preventing almost all the abuse caught by the stricter, older rule.

Would it be hard to steal this for Perl 5? Would it cause any problems?

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

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