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

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

Thread Previous | Thread Next
From:
Paul LeoNerd Evans
Date:
July 10, 2012 06:41
Subject:
Re: What would having a & prototype after the first position break?
Message ID:
20120710134118.GU11370@cel.leo
On Fri, Jul 06, 2012 at 12:13:51PM +0200, Paul Johnson wrote:
> On Wed, Jul 04, 2012 at 12:58:21AM -0400, Chris Nehren wrote:
> > 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;

*grin*

> > 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?

Needless to say, I'd be quite keen to get this ability...

> My recent rjbs induced trip down memory lane unearthed the following
> message from a certain larry@wall.org:
> 
>   http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/1999-08/msg01111.html

I don't see anything there that specifically says it can't be done, or
that it shouldn't. Only that it's not easy...

> Summary:
> 
>   - "I'm not saying it's impossible, just that it's difficult."
>   - "I also suspect that this could be generalized into a macro capability"

So, aren't we all about making difficult things possible?

-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk
ICQ# 4135350       |  Registered Linux# 179460
http://www.leonerd.org.uk/

Thread Previous | 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