in reply to Re^10: Why does each() always re-evaluate its argument? ("for_list" )
in thread Why does each() always re-evaluate its argument?
Interestingly that topic came up on perl-porters a while ago and the conclusion is that it would be possible to make standalone iterator objects for hashes in several ways, but with different costs for different modes of failure. For instance, do you throw an error if the hash gets modified during iteration? or just warn and resume the iteration as best as possible? or not even warn? or (for a performance hit) implement a fully intuitive handling of deletions and insertions?
Several ways are possible right now using XS, without changing any core data structures. But, using the iterator would involve an XS function call, and be less performant than native iteration.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^12: Why does each() always re-evaluate its argument? ("for_list" )
by ikegami (Patriarch) on Dec 08, 2023 at 17:21 UTC | |
by NERDVANA (Priest) on Dec 09, 2023 at 21:21 UTC | |
|
Re^12: Why does each() always re-evaluate its argument? ("for_list" inconsistent)
by LanX (Saint) on Dec 08, 2023 at 17:13 UTC |