On Jan 6, 2004, at 9:25 AM, Leopold Toetsch wrote:

Arthur Bergman <[EMAIL PROTECTED]> wrote:
Hi,

I am wondering how the references to hash elements are planned to be
done? The call to set_ must somehow be delayed until the time is right.

$foo = \$hash{key};

$$foo = "bar";

$has{key} is now "bar"

There was some discussion WRT that issue months ago. Currently the implementation is wrong IMHO. When $hash{key} doesn't exist a new PerlUndef is returned (which is fine) but it should be stored in the hash too, so that assigning to $foo does The Rigth Thing. (Parrot aggregates have reference semantics, so ...)

This may have been discussed previously, but I would think that reading a hash should never auto-vivify elements. (That would be contrary to the Perl5 semantics, at least.) You may need to return a special reference-style PMC which knows how to get back to the original hash if you assign to it, but the hash itself shouldn't grow entries.


JEff



Reply via email to