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

What would having a & prototype after the first position break?

Thread Next
From:
Chris Nehren
Date:
July 3, 2012 21:58
Subject:
What would having a & prototype after the first position break?
Message ID:
20120704045820.GB6569@isuckatdomains.isuckatdomains.net
Recently I've been working on a DSL of sorts that would be more
succinctly expressed if I could have a prototype like ($&&). What would
break if we allowed the & prototype after the first position? To make
the proposed feature concrete, it would enable us to have syntax like
(courtesy of LeoNerd):

generic_sort { $a <=> $b } { length $_ } @strings;

or (from my own code):

loop host 'shadowcat' => { do_stuff; };

I'm fine with doing the work to add this feature. I would just like to
be sure I don't break half of CPAN with my efforts.

Thoughts? Comments? Rallying praise? Rotten tomatoes?

-- 
Chris Nehren           | Coder, Sysadmin, Masochist
Shadowcat Systems Ltd. | http://shadowcat.co.uk/

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