At 01:34 PM 05-18-2001 -0700, Nathan Wiger wrote:
>Dammit, I got the example exactly backwards. Try this:
>
> > $Foo is true;
> > $Foo = 0;
> > print "Stuff" if $Foo; # *WOULD* print - "is" assigns a
> > # permanent "true" property
> >
> > $Foo as true = "";
> > $Foo = 0;
> > print "Stuff" if $Foo; # *WOULD NOT* print - "as" is reset by
> > # value assignment since is temporary
I tend to think of the "temporary"/"permanant" distinction being a
"rvalue/lvalue" distinction.
Perhaps the rvalue/lvalue context of the property assignment could be used
to determine whether it's temporary or permanant?
$Foo = 0 is true; # $Foo has a true value
print "$Foo is true" if $Foo; # prints "0 is true"
$Foo = 0; # $Foo has a false value
print "$Foo is true" if $Foo; # does not print.
$Foo is true = 0; #$Foo is true regardless of value
print "$Foo is true" if $Foo; # prints "0 is true"
$Foo = 0; #$Foo is still true, despite false value
print "$Foo is true" if $Foo; # prints "0 is true"
$Foo = 0 is false; # Hmm, lvalue $Foo is true, but assigned -declared-
false value... who wins?
print "$Foo is true" if $Foo; # ??????
We'd also need to come up with better syntax for:
$Foo is true = $Foo;
for changing the lvalue properties of $Foo without changing the rvalue
contexts...
Later,
Buddha