This code:
new P0, .OrderedHash
set P0["foo"], "Foo"
delete P0["foo"]
exists I0, P0[0]
print I0
exists I0, P0["foo"]
print I0
end
prints '10', while this:
new P0, .OrderedHash
set P0["foo"], "Foo"
delete P0[0]
exists I0, P0[0]
print I0
exists I0, P0["foo"]
print I0
end
prints '01'. In both cases, I would expect to get '00', since the hash
should be empty. Is this a bug in the code, or is an OrderedHash supposed
to work this way (in which case a note to this effect in the
documentation might be a good idea)?
Simon
> ... In both cases, I would expect to get '00', since the hash
> should be empty. Is this a bug in the code, or is an OrderedHash supposed
> to work this way (in which case a note to this effect in the
> documentation might be a good idea)?
Mixing keyed and indexed access in OrderedHash isn't working. So unless
the implementation is fixed a note WRT that is really in order.
We could also throw an exeception in delete_keyed for now.
> Simon
leo