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

[perl #108286] Wishlist: Overridable keywords

Thread Next
From:
Father Chrysostomos via RT
Date:
April 28, 2012 00:42
Subject:
[perl #108286] Wishlist: Overridable keywords
Message ID:
rt-3.6.HEAD-4610-1335598914-1231.108286-15-0@perl.org
On Sun Jan 15 12:51:08 2012, sprout wrote:
> The keywords do, require and glob are currently not overridable as
>    keywords.  Overrides cannot change their syntax, but only their
>    behaviour.  In other words, overrides of these keywords are
>    actually callbacks, rather than overrides.
> 
> I propose that whether overrides of those three keywords are actual
>    keyword overrides depend on whether the ‘overrides’ feature is
>    enabled in the scope where the subroutine is defined, not where it
>    is used.

This poses a slight problem in the default case (outside the scope of
the overrides feature).

If require is always a keyword (and it is, because the prototype cannot
be overridden), then we have a keyword that behaves differently
depending on whether there is a CORE:: prefix.

So, which behaviour should \&CORE::require have?  It should probably be
the same as CORE::require.  And require’s fixed prototype should be
treated as a special case.

I was trying to come up with a model that would encompass all special
cases, such that there wouldn’t be any special cases any more (they all
being CV-specific parsing rules), but I have failed in this particular case.

Does anyone else (particularly Zefram, since a lot of this is based on
his ideas) have ideas?

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=108286

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