On Thu, Jul 5, 2012 at 3:03 PM, Jesse Luehrs via RT
<perlbug-followup@perl.org> wrote:
> The examples given in the original post no longer cause that warning,
> but tying
> stashes still doesn't work. Also, this slight modification of the initial
> example segfaults:
>
> BEGIN {
> require Tie::Hash;
> tie %Foo:: => "Tie::StdHash";
> }
> package Foo;
> *baz = sub { };
1. To tie a stash should either fail (best compile-time), or we need
to make it work.
Making it work will cause a slow-down, adding magic checks for each
stash access.
My vote would be no. Nobody is using it, it will make the implementation
complicated and it will hurt general performance, for the benefit of
weird corner cases nobody is needing.
2. The whole readonly-stash discussion in 2003 was a bit odd.
Allowing readonly stashes allows perfectly fine compile-time optimizations,
esp. to short-cut method calls, but also for the MOP and general class
optimizations.
The analogy to Moose make_immutable(), just in core.
There is just no sanctioned syntax for it. Damian thought of
package NAME :const,
I am more leaning to
const package NAME {}
as most attributes have no compile-time hook, only run-time, and are as such
unusable as type-qualifiers to allow compile-time optimizations.
--
Reini Urban
http://cpanel.net/ http://www.perl-compiler.org/
Thread Previous
|
Thread Next