New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PUSH on tied arrays #10433
Comments
From @nwc10Effectively this is 2 bugs in one ticket, but I can't find a practical way to $ cat push.pl my @array :shared; sub hammer { my @t; print join('', @array), "\n"; __END__ The return value of push is documented to be the number of elements in the Note that 1: Sometimes the script gets an odd number returns from push The problem seems to be twofold 1: threads::shared doesn't hold a lock for the duration of push. (It does for I can fix this. However, fixing it would hide the second bug: 2: For push and unshift, the PP code ignores the return value of PUSH and That feels wrong to me. I have a patch to fix that. (Which is how I stumbled I believe that fixing all of this is the right thing to do, as currently the However, it does mean changing the exact behaviour of tied arrays from the http://perl5.git.perl.org/perl.git/commit/a60c0954410db87b # revision 424 [which amends the first attempt here Nicholas Clark |
From @iabynOn Fri, Jun 11, 2010 at 06:37:56AM -0700, Nicholas Clark wrote:
Er, where does this happen? I can't see it, which means I'm probably -- |
The RT System itself - Status changed from 'new' to 'open' |
From @nwc10On Sat, Jun 12, 2010 at 12:54:05PM +0100, Dave Mitchell wrote:
No, it means that my description was inadequate. I'd forgotten that I'd also if (OP_GIMME(PL_op, 0) != G_VOID) { AvFILL expands to: #define AvFILL(av) ((SvRMAGICAL((const SV *) (av))) \ and for a tied array, SvRMAGICAL() is true, hence a call to mg_size() is made, Nicholas Clark |
From @iabynOn Fri, Jun 11, 2010 at 06:37:56AM -0700, Nicholas Clark wrote:
Hmm, looking at the various docs: Camel 2nd Ed says PUSH not done yet Camel 3rd Ed (2000) doesn't say what PUSH should return, but its example perltie.pod, since 2000 (4ae8561) documents PUSH, but doesn't say what Tie::Array's PUSH implementation looks to be explicitly wrong in its My feeling is that the combination of ambiguous documentation, broken -- |
@iabyn should we close this then? |
Migrated from rt.perl.org#75676 (status was 'open')
Searchable as RT75676$
The text was updated successfully, but these errors were encountered: