> I think they're supposed to be both by perl thingie and by value. So:
> 
>    my $foo is const = 0 is true;
> 
> $foo has the property const, while the value 0 in $foo has 
> the property true. 

So, if I do

my $foo is constant = new Counter(0);
$foo->increment # OK

my $bar = new Counter(0) is constant;
$bar->increment; #error

However, if I do

%foo is constant = (a=>1, b=>$foo);

are only the keys contant; or both the keys and values.
i.e. which of these is illegal

%foo{c} = 1; # error
%foo{a} = 2; # probably error, but it would be nice
             # to have a form of hash-constness that 
             # locks only the keys
$foo{b}->increment; # OK


Dave.

Reply via email to