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 08:19
Subject:
Re: [perl #108286] Wishlist: Overridable keywords
Message ID:
20120424151927.GE4502@tozt.net
On Tue, Apr 24, 2012 at 10:10:16AM +0200, Johan Vromans wrote:
> "Father Chrysostomos via RT" <perlbug-followup@perl.org> writes:
> > Anyone who overrides if() is probably asking for trouble.
> > But it would be nice to override length() and vec().  Where do we draw
> > the line?
> 
> Precisely <-- HERE.
> Functions like vec() and length() can be overridden, but control
> keywords like if and when and while can not.
> 
> Writing it as if() doesn't make it similar to vec() or length().

The issue is that with the parser changes that have been happening
recently (call_checker, call_parser, etc), there is getting to be less
and less of a difference between these two cases (and ideally, at some
point in the future, there won't be any difference at all). What about
overriding something like map? The distinction isn't quite as clear as
you seem to be implying.

-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