On Thursday 02 August 2001 08:47 pm, Dan Sugalski wrote:
> At 06:57 PM 8/2/2001 -0400, Bryan C. Warnock wrote:
> >Here's how I'm documenting it. Corrections requested.
> >
> >Properties are by Perl thingy. (scalar, array, hash, reference, blessed
> >reference?, file handle, etc)
>
> I think they're supposed to be both by perl thingie and by value. So:
>
I was generally classifying literals as scalars (even though I realize
they're not scalars, they're literals - the specific properties overlapped).
It seems the only consistent interpretation is that the differentiation
between a variable property and a value property is what side of the
assignent operator you're on.
(Which is wrong, as I'll explore below. I'm leaving my misconceptions in
place for whomever to examine, as a case study for further misconceptions.)
> my $foo is const = 0 is true;
my $bar is const = $foo is true;
I'm assuming here that (assume $foo is mutable) that it's the value of $foo
that is being tagged as true, and not $foo itself. (Not that it would make
a lot of sense as a variable property.) But is that value tagged before or
after the value itself has been retrieved? Is the value inside $foo above
tagged as true or not?
> the trueness of 0 is copied (since the value is copied, along with
> properties on the value) while the constness of $foo is *not* copied, as
> it's a variable property and those stick with the variables.
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;
Who's what when this is all done?
How about void or boolean contexts? Damian uses this a lot in E2.
$foo is chomped;
$foo prompts;
bar while ($foo is greedy);
Hmmm. Actually, what makes *more* sense than that is the property itself.
I think a property will need to tell Perl (or maybe handle it itself)
whether it is a value property or a variable property.
$bar is constant = $foo is true;
# constant is a variable property, true is a value property. Therefore,
# $bar is constant, and the constant isn't clonable. $bar is also true, and
# that *is* clonable.
But wait, what it we want to make $foo true? Or, actually, the value in
$foo true?
$foo is true;
$foo = $foo is true?
(And could that be shortened to '$foo is= true;'?)
$foo is now true;?
(Allow 'now' to refer to the thing holding the current value?)
$bar is constant = $foo is now true;
(And speaking of trueness, how do you turn it off if you want? You
can't say '$bar is false', cause then the value is always false.)
$foo is true = $bar is constant;
# The value in $foo (gotten from $bar) is true. $bar is made constant.
--
Bryan C. Warnock
[EMAIL PROTECTED]