Hi,
my ($key, $value) = <key val>;
my $pair = ($key => $value);
$pair.key = "new";
# Should this fail ("cannot modify a constant")?
# Should this update $pair.key, but leave $key untouched?
# Should this update $pair.key, implicitly updating $key as well?
$pair.value = "new";
# Should this fail ("cannot modify a constant")?
# Should this update $pair.value, but leave $value untouched?
# Should this update $pair.value, implicitly updating $value
# as well?
If setting $pair.value changes $value, should rebinding $pair.value
cause the binding to get destroyed:
$pair.value := $some_other_var;
$pair.value = "new";
# $value unchanged, $some_other_var set to "new"
If setting $pair.value does not change $value, should binding
$pair.value to $value do what I mean:
$pair.value := $value;
$pair.value = "new";
# $value changed
--Ingo