in reply to Re^3: Golf: overtone calculator
in thread Golf: overtone calculator

Nice rant, tadman; well-explained... except for one minor point: in your example, the prototype doesn't apply, because the function is being called as a method... I think. I remember reading that, somewhere, but rereading the relevant part of perlsub it only mentions functions called with a & or via a subref.


Confession: It does an Immortal Body good.

Replies are listed 'Best First'.
Re: Re: Re^3: Golf: overtone calculator
by BrowserUk (Patriarch) on Sep 03, 2002 at 00:17 UTC

    Your memory is good theorbtwo++ for spotting that.

    The second paragraph of perlsub docs for 5.6.1 reads...

    Method calls are not influenced by prototypes either, because the function to be called is indeterminate at compile time, since the exact code called depends on inheritance.

    I wonder if this means things have changed for 5.8 (your link points there)?


    Well It's better than the Abottoire, but Yorkshire!
Re^5: Golf: overtone calculator
by tadman (Prior) on Sep 03, 2002 at 05:35 UTC
    You know, that could explain why, with the code I'm working on, I keep finding invalid prototype definitions for things and yet there's no associated warnings. Things like this:
    # Five in prototype... sub foo($$$$$) { my ($self, $foo, $bar, $baz, $bim, $bam) = @_; # Six in list # ... }
    Things like this are routinely called, and yet, never and warnings. Thanks for the heads up.

    It's good to know that prototypes are useless in that context.