develooper Front page | perl.perl5.porters | Postings from February 2018

Re: [perl #132810] Blead Breaks CPAN:KYZ/Test-MockCommand-0.03.tar.gz

Thread Previous | Thread Next
From:
Leon Timmermans
Date:
February 5, 2018 13:33
Subject:
Re: [perl #132810] Blead Breaks CPAN:KYZ/Test-MockCommand-0.03.tar.gz
Message ID:
CAHhgV8ier=dWdiL60tqbYseETmb+EHggng54iO6_-s9+veipBQ@mail.gmail.com
On Mon, Feb 5, 2018 at 1:50 AM, Father Chrysostomos via RT
<perlbug-followup@perl.org> wrote:
> On Sun, 04 Feb 2018 13:14:09 -0800, LeonT wrote:
>> This essentially changed the prototype of a keyword. I don't think
>> that sort of breaking change should happen without a proper discussion
>> about it.
>
> But the previous behaviour would mess up the stack.  And readpipe’s own arguments would be evaluated in one context one time and another context another time.  That’s clearly a bug.

It is clearly a bug. I wasn't arguing for a revert, I'm arguing for a
different fix.

>> I don't mind breaking broken code, but I see to reason to break code
>> that had been working fine for 20+ years. It seems to me we can fix
>> this in less painful ways.
>
> Do you have a better suggestion?

Making it a scalar op is clearly not the only way to restore stack
sanity (even if it may be the easiest one). It wouldn't have been
different if this had been done in 1993 when readpipe was added, but
we're a generation beyond that point.

* Any solution where passing more or less than one argument doesn't
cause a warning is not as helpful as it could be.
* Evaluating to the number of arguments is never useful.
* Any solution where code that has worked for a generation is suddenly
no longer working is harmful. Such harm needs to be justified by a
direct need for that breakage.

That need doesn't exist, because this can be fixed by making it a
well-behaved listop. So:
* if arguments > 1 we should use the last value (as is currently done) and warn.
* if arguments == 0 we should not run anything and warn about it.
* if arguments == 1, everybody gets pizza.

> If it is only one module that is affected, I think we should leave the fix in, as there is no logical, consistent way to make a core function that takes exactly one argument put that argument in list context.

The argument "the breakage isn't too large" (whether that's true or
not) isn't convincing to me when the breakage isn't necessary.

Leon

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