develooper Front page | perl.perl5.porters | Postings from May 2015

Re: [perl #123475] Bleadperl v5.21.6-51-ge41e986 breaks BDB

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
May 8, 2015 14:37
Subject:
Re: [perl #123475] Bleadperl v5.21.6-51-ge41e986 breaks BDB
Message ID:
20150508143722.GW4035@iabyn.com
On Wed, May 06, 2015 at 09:26:47AM -0400, Ricardo Signes wrote:
> I wrote many, many long responses to this, each one different than the
> previous, as I reached logical dead ends.  The behavior and intent of
> prototypes is, in my opinion, so incoherent as to make any reasoning from first
> principles unlikely to bear fruit.
> 
> So, instead, I think we have a really simple choice.  Here's what the docs say
> about (&):
> 
>   An "&" requires an anonymous subroutine, which, if passed as the first
>   argument, does not require the "sub" keyword or a subsequent comma.
> 
> The old behavior allows:
> 
>   sub takes_sub (&) { ... }
>   takes_sub(undef);
> 
> ...which contradicts the documentation.  We should change the behavior or we
> should change the documentation.
> 
> Changing the documentation and leaving the code alone (relative to v5.20) will
> let things like BDB continue to work, where a literal undef is passed to reset
> a stored subroutine.
> 
> Changing the code and leaving the documentation alone (again, relative to
> v5.20) will break anything that had relied on this behavior, but will expose
> bugs where a literal undef had been passed to a subroutine with a (&)
> prototype in effect.  It will now issue a compile-time error.  Presumably,
> these situations are bugs iff later something attempts $arg->(), which would
> currently be a runtime error.  That doesn't mean that this wouldn't expose
> existing bugs, but I think it does cut down on what we'd expect to see fixed.
> Also, we should consider the prevention of future bugs, which won't ever need
> to be detected at runtime.
> 
> Nonetheless, it is with heavy heart that I think I agree with the suggested
> course of action:  go back to the old, worse behavior.  If we were starting
> from scratch, I would hold my ground, but I don't think the breakage is
> justified here.

Now merged with v5.21.11-77-g8283f70

-- 
The warp engines start playing up a bit, but seem to sort themselves out
after a while without any intervention from boy genius Wesley Crusher.
    -- Things That Never Happen in "Star Trek" #17

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About