[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 09:41:26 -0700, Tom Christiansen wrote (in part):
tc> There's something very strange here, then. I believe that
tc> the warning in question *never* triggers on method calls that
tc> conflict with built-ins, irrespective of a ":method"
tc> attribute. Witness:
[snipped]
tc> One or both of us seem to be missing something here.
I think it's you. ;=}
The point of the warning suppression isn't for method calls.
Consider this (almost-real-world) example:
package Net::Gen;
...
sub send : method {
...
if (!defined $whither) {
return send($fh, $buf, $flags);
}
return send($fh, $buf, $flags, $whither);
}
Note there's one instance of adding a 'method' attribute to shut
up the warnings about two uses of the builtin. The point is that
the method will ONLY be invoked as a method, so the ambiguity
warning would not be appropriate for this subroutine, even though
it *might* be appropriate for other subroutines.
I'd almost like to see a warning if an imported sub is found to
override a builtin but the sub was marked with the 'method'
attribute, actually. Of course, trying to push for it might get
me (virtually) shot.
--spider
- References to:
-
Tom Christiansen <tchrist@chthon.perl.com>
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]