Jonathan Scott Duff wrote:
> 
> With the exact same semantics?  I.e.,
> 
>         my $hash{$key} : private = $val;
> 
> makes %hash non-autovivifying, thus forcing the programmer to
> "declare" all of the hash keys he intends to use?

If you wanted to declare you lexical scope separate from your data
access properties, you could do so in this way:

   my %hash;
   {
      $hash{$key} : private = $val;
      $hash{$key} : public = $val2;
   }

Here's my concern: Are "private" and "public" scopes? They don't appear
to be. They appear to be access modifiers, changing properties of the
variable they're attached to.

In this case, they're attributes, and belong after the variable, just
like ":64bit" or ":long". Regardless of their importance, if they're not
scope modifiers, it's inconsistent to put some before and some after
variables.

So,

   my int $x :64bit = get_huge_value();
   my string $self->{NAME} :private = shift;

See what I'm getting at? 'string' and 'int' are types. ':64bit' and
':private' are modifiers.

-Nate

Reply via email to