On Tue, Nov 06, 2007 at 10:10:40AM -0800, chromatic wrote:
} On Tuesday 06 November 2007 07:38:32 Josh Jore wrote:
} package Stubs;
}
} BEGIN { my $stub = &foo }
Your demo behaves the same way if the block reads BEGIN {
&foo }. You
took a copy of the reference but it didn't matter. Just
having done
the reference once is enough to install a method-killing
stub.
} I don't think the bug is in method resolution. I don't
think the bug is in
} can(). I also don't think there's a good general
heuristic that can support
I am picking of method resolution because I think can() is a
client of
method resolution. I am also picking on it because it's the
part that
would at runtime need to know that &foo isn't a a
stubbed function -
it is a forward reference.
Right now I think stubs and forward references are merely
root and
xsubless. I suppose with a flag, the forward references that
are not
also stubs could be detected and ignored during method
resolution. If
not a flag, attaching a piece of magic. It is reasonable to
attach new
magic because I expect these types of references to rare. If
they were
common then a bit in flags could be stolen. There's a
handful free for
SVt_PVCV.
Or is it also important to throw the undefined exception if
the
forward reference still exists? Right now the reference
remains in the
symbol table even if the user-side was reaped immediately.
Mostly I just responded to this thread because I didn't like
the tone
of the "No! You're wrong!" messages from
p5p-at-large to Linda.
--
Josh
|