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
[documentation] Hash::Util::FieldHash #9134
Comments
From A_M_C@bigpond.net.auThis is a bug report for perl from Michael Cartmell, In the documentation for Hash::Util::FieldHash, the section Assuming MJD is correct and the implementation of hashes in 5.10.0 Flags: Site configuration information for perl 5.10.0: Configured by michael at Tue Nov 27 17:34:32 EST 2007. Summary of my perl5 (revision 5 version 10 subversion 0) configuration: Locally applied patches: @INC for perl 5.10.0: Environment for perl 5.10.0: PATH=/net/perl/5.10.0-rc2/bin:/opt/kde3/bin:/net/perl/5.8.8/bin:/home/michael/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/lib/qt3/bin |
From @jkeenanOn Thu Nov 29 02:44:21 2007, A_M_C@bigpond.net.au wrote:
I am attaching the relevant section of the POD for Hash::Util::FieldHash p5p list: Does the OP's contention about the documentation have merit? Thank you very much. |
The RT System itself - Status changed from 'new' to 'open' |
From @xdgOn Thu, Jan 12, 2012 at 8:05 PM, James E Keenan via RT
MJD only states that deleting the current hash entry while iterating In other words, "not only do you have to not add/delete keys during -- David |
From @cpansproutOn Thu Jan 12 17:26:42 2012, xdaveg@gmail.com wrote:
My question is: Why is it unsafe at all to create or delete things from There have been at least three fixes to the deletion code since 5.14. -- Father Chrysostomos |
From @LeontOn Fri, Jan 13, 2012 at 3:08 AM, Father Chrysostomos via RT
One obvious problem would be reallocation. It can reorder the buckets, Leon |
From @xdgOn Thu, Jan 12, 2012 at 9:08 PM, Father Chrysostomos via RT
Here is the relevant MJD post, I think:
MJD looks like it was legacy Larry code that had the problem. I think it's all to avoid requiring two passes. Should it be (now or in the future) safe to delete arbitrary keys -- David |
From @cpansproutOn Thu Jan 12 18:38:38 2012, xdaveg@gmail.com wrote:
It has been safe, for as long as I’ve been familiar with the code, Now (and previously, most of the time), deleting an element will just -- Father Chrysostomos |
From @ikegamiOn Fri, Jan 13, 2012 at 5:10 PM, Father Chrysostomos via RT <
A bit of black box testing (attached) finds no problem getting the right - Eric |
From @ikegamiuse strict; use Test::More tests => 2*26; for ('a'..'z') { my @k; is( join('', sort @k), join('', 'a'..'z') ); for ('a'..'z') { my @k; push @k, $k; is( join('', sort @k), join('', 'a'..'z') ); 1; |
From @rjbsThe docs on `each` were revisited during the hash overhaul in 5.17. The The docs for FieldHash say:
This matches the assertion in the `each` docs. Unless perlfunc's entry for each is wrong, there is no contradiction. I believe Yves said that he did work to keep deleting the current key safe. I think the docs are correct. Perhaps someone -- Yves? -- could confirm. -- |
From @demerphqOn 10 July 2013 03:56, Ricardo Signes <perl.p5p@rjbs.manxome.org> wrote:
My understanding of the rules regarding native perl hashes is that we Which means that deleting an arbitrary key is allowed to change the order. The current implementation as far as I know actually results in *all* But I believe that the documentation in question is about field cheers, -- |
From @cpansproutOn Wed Jul 10 13:15:12 2013, demerphq wrote:
Field hashes are actually quite different from tied hashes. They are In fact, the field hash magic is orthogonal to ties, so you can actually -- Father Chrysostomos |
From @demerphqOn 11 July 2013 02:51, Father Chrysostomos via RT
Be that as it may field hashes aren't normal hashes, and until someone Clearly there is *some* form of magic involved, the magic could do I stand by my claim that field hashes aren't normal hashes, and should So IMO field hashes can do whatever they like and all the commentary Yves -- |
From @rjbsRe-reading the original bug report, I believe we have been totally sidetracked Maybe I'll look at testing this behavior, but I expect it will be just the same -- |
Migrated from rt.perl.org#47948 (status was 'open')
Searchable as RT47948$
The text was updated successfully, but these errors were encountered: