> Now that you've got me thinking about it, that brings up some interesting
> questions.
>
> $bar = $foo is my_prop = 0 is some_prop;
> ($bar = $foo is my_prop) = 0 is some_prop;
> $bar = ($foo is my_prop) = 0 is some_prop;
This is why I think that variable properties and value properties should be the
same thing - value properties.
$bar = $foo is my_prop = 0 is some_prop;
$foo has 'my_prop', 'some_prop', value 0
$bar has 'my_prop', 'some_prop', value 0
$bar = 0;
$bar has no properties, value 0
#### $bar isnt my_prop;
#### $bar has some_prop, not my_prop;
$bar = 0 is const;
#### $bar is now a constant.
For cases where you want properties to persist, you could have the keyword
'persistant'
$bar = 1 is my_prop, persistant;
$bar = 0; # still my_prop.
$bar = 1 is persistant;
$bar is whatever;
$bar = 2; # still has property 'whatever'.
Anyways, defining this this way his allows for some cool things with hashes,
if properties are inherited -
%hash is true;
$hash{0} = 0; # still true.
$hash{0} = 0 isnt true; # this value is false, even though the others are
With both variable properties and value properties, things are WAY TOO CONFUSING
I've given some time for it to settle in my brain, and I still think they are
WAY TO CONFUSING. The examples just given:
> $bar = $foo is my_prop = 0 is some_prop;
> ($bar = $foo is my_prop) = 0 is some_prop;
> $bar = ($foo is my_prop) = 0 is some_prop;
just prove it.
I'm willing to debate any and all up-and-comers on the topic..
Ed
Thread Previous
|
Thread Next