Graham wrote:
> > > my $a is true = 0; # variable property
> > > my $a = 0 is true; # variable property
> > > my ($a) = 0 is true; # value property
> >
> > Wow. Totally ETOOCONFUSING.
>
> That has been exactly my thought as I have been reading this thread.
Actually I think the original is wrong. I would have said:
my $a is true = 0; # variable property
my $a = 0 is true; # value property
my ($a) = 0 is true; # value property
> So far all I can think of for variable properties are actually
> compile time properties like constant etc.
This is so for the built-in properties, but one can also envisage many
user-defined variable properties:
my $var1 is Persistent;
my $var2 is Computed(&var_comp);
my $var3 is Logged($fh);
my $var4 is Traced;
my $var5 is Write_Once;
my $var6 is Read_Once;
my $var7 is Autoincremental;
my $var8 is Error_bounded;
my $var9 is Ranged(0..99);
my $var10 is Rewindable;
my $var11 is Concatenative;
my $var12 is Cyclic('a'..'z');
my %var13 is Secure;
my %var14 is DBM($fatabase);
my %var15 is RegexpKeyed;
my @var16 is Alias(@var17);
my @var18 is BitVector;
# etc. etc.
See:
http://search.cpan.org/doc/MARCEL/Attribute-TieClasses-0.01/TieClasses.pm
for even more ideas.
Damian