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

Re: [perl #108286] Wishlist: Overridable keywords

Thread Previous | Thread Next
From:
Jesse Luehrs
Date:
April 24, 2012 13:15
Subject:
Re: [perl #108286] Wishlist: Overridable keywords
Message ID:
20120424201541.GJ4502@tozt.net
On Tue, Apr 24, 2012 at 12:57:12PM -0700, Father Chrysostomos via RT wrote:
> On Tue Apr 24 11:59:36 2012, jv wrote:
> > [Quoting Jesse Luehrs, on April 24 2012, 13:49, in "Re: [perl #108286] W"]
> > > > I cannot imagine a sensible purpose to override else. Can you?
> > > 
> > > No, I think that if() should be the overridable part, with 'else' and
> > > 'elsif' just as much a part of the syntax as '{' or '}'.
> > 
> > Precisely.
> 
> I’m having trouble understanding what you disagree with.
> 
> What I am proposing would allow
> 
>     use subs "if";
>     sub if { ... }
> 
> plus magic attached to \&if via Devel::Declare or Devel::CallParser to
> parse if/elsif/else however it wants, maybe even allowing elsunless.

I have no issues with this. But if the \&if is responsible for parsing
the entire if/elsif/else construct (which I think it should be), how
does the idea of overriding elsif/else independently work at all?

-doy

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