[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

Re: possible ":method" bug/misfeature



On Wed, 19 Jan 2000 08:32:16 -0700, Tom Christiansen wrote (in part):

tc> The documentation for `use attributes' specifies that include
tc> "method" in the list of properties supresses that warning;
tc> and that, it does:

tc> Here's the issue: I fail to see *why* it suppresses that
tc> warning, as it still applies.

No, it doesn't.  You said, "I'm only planning to use this as a
method.  I know it's not necessarily available as a first-class
sub name.  Shut up about that."  You got what you asked for.

This warning suppression per-subroutine is specifically so that
modules can have methods named after builtins, and yet still
invoke the builtins internally without having to replace all
instances of (e.g.) send() with CORE::send(), which looks ugly,
just to shut up that warning for known subroutines which we never
intended to have supplant the builtin.  The warning and the
renaming are a real pain in the ass, and an affront to module
writers who never considered the usage just described to be
ambiguous (since it never was).

[Adding attributes just to shup up the warning is obnoxious, too.
However, there are usually more instances of the use of
'conflicting' builtins than method definitions, so the edit
usually gets to hit fewer places.  Besides which, if the module
author had been attempting to make things work with the (former)
thread model, some sprinkling of attributes was going to be
required for that anyway.  Making the edits in support of a new
feature, rather than of a new mis-feature, is often more
palatable to people.]

However, you also questioned the general utility of the 'method'
attribute, when not used with 'locked'.  Despite my own position
on Chip's damned warning (which I obviously despise), the
attribute is otherwise (as I understand it) mainly to allow
future optimizations with regard to static analysis (especially
for the compiler) regarding method calls and method inheritance.

	--spider


Follow-Ups from:
Chip Salzenberg <chip@valinux.com>
References to:
Tom Christiansen <tchrist@chthon.perl.com>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]