Note the time I sent this out. My mind may not be thinking quite straight
at this point, so bear with me.
First of all, the dot dispute. If we want a way to absolutely make sure
we're checking a scalar's properties, why not reuse our keywords?
$foo is constant; #sets $foo's constant property to true
is $foo constant; #returns value of $foo's constant property
This avoids the possible ambiguity of C<$foo.constant> without adding any
new keywords or requiring the absence of a C<.prop> member. This also reads
like English:
Foo is constant.
Is foo constant?
Second, the values vs. variables problem. I'm sorry, but
C<(+$foo).whatever> is just way too ugly. Plus, it's really hacky and
inexpressive. Perl is supposed to be an expressive language, right?
This issue can be avoided altogether if we just say, "properties must
declare whether they attach to variables or values." This makes some
sense--what does C<constant> mean attached to a value? Is attaching C<true>
to a variable a good idea?
This could also probably be done with minimal keyword impact. I'm not sure
if anyone has said how properties are implemented, but for the sake of
argument I'll assume they're somehow implemented as subs. If so, we could
just do:
sub foo is property(value) { #property that attaches to the value
...
}
sub bar is property(variable) { #property that attaches to the variable
...
}
Even if it was actually implemented some other way, all we'd need to do is
make sure that we can attach properties to it somehow. (The C<property>
property would itself attach to a variable, not a value.)
--Brent Dax
[EMAIL PROTECTED]