Luke Palmer skribis 2005-12-23 16:42 (+0000):
> > I'd want something that clones this, somewhere between shallow and deep.
> > .<c> should be deep, but .<d> shallow. Perhaps this can be determined
> > using some attribute, that for a referenced hash defaults to the
> > opposite of what it defaults to for a literal anonymous hash.
> That's an interesting idea. A "deep reference". I imaging you're
> suggesting this because you had a situation in real life where it came
> up. Can you describe that?
Sure, abstracted:
my %foo
my $bar = Baz.new( foo => %foo );
my $quux = $bar.clone;
%foo<a> = 'b';
Depending much on the semantic value of .foo, I'd want only $bar.foo<a>
or both $bar.foo<a> and $quux.foo<a> to be set to 'b'.
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html