In message <[EMAIL PROTECTED]>
Dan Sugalski <[EMAIL PROTECTED]> wrote:
> We punt. If the programmer wants consistent data in a multithreaded
> program, he or she needs to lock the hash down. I'm all up for the
> iterators looking at the hash as it exists--if the programmer wants
> a snapshot of the hash keys or values, they can flatten them down to
> a list or not mess with the hash in ways that'll geek the
> iterator. I don't see any real reason that multiple iterators should
> behave any differently than the single one we have now in that
> respect.
It will certainly make life a lot easier if we're prepared to make
changes like that - the problem is that it will likely break existing
code.
I guess we can translate all uses of keys and values when doing
the p52p6 conversion - so that this:
foreach my $x (keys %y)
{
$y{$x+1} = 1;
}
becomes:
foreach my $x (@temp = keys %y)
{
$y{$x+1} = 1;
}
Of course we'd have to make sure the optimised realised that the
assignment caused the list to be flattened so it didn't try and
elide the 'useless' assignment ;-)
Tom
--
Tom Hughes ([EMAIL PROTECTED])
http://www.compton.nu