Tom Christiansen wrote:
> 
> And what about $$x?
> 
> Dang, are we back to this incredible confusion about what it is to be
> defined in Perl.?
> 
>     undef $a;
> 
> That is now UNINITIALIZED.  So is this:
> 
>     $a = undef;
> 
> You have initialized it to undef.  There is no reasonable difference.
> 
> Solution:
> 
>     Remove all references from the language to defined and undef.
>     People just aren't smart enough to understand them.  Change
>     defined() to read has_a_valid_initialized_scalar_value().  Change
>     undef() to "operator_to_uninitialize_a_variable".  Touch luck
>     on the chumps who can't type well.  They pay for their brothers'
>     idiocy.
> 
> repeat until blue:
> 
>       INITIALIZED ==   DEFINED
>     UNINITIALIZED == UNDEFINED

Thank you, that's a better way of describing part of the intent of this
RFC. I want to distinguish between variables that are uninitialized, and
expressions whose values are undefined.

my $x; # $x is uninitialized. Also, the value of $x is undefined.
undef $x; # $x has now been initialized. The value of $x is still
undefined.

This is *not* adding a new sort of value to perl. It is adding a
different state for the compiler to think of a variable as being in.
Initialization of a variable means you've done something that influenced
the value of that variable -- either by setting it, or blowing it away
and making it undefined.

You aren't interpreting the last part of the DESCRIPTION section ("you
need to do my $x= undef") as meaning that

my $x;
and
my $x = undef;

have a runtime difference, are you? I think this is confusing some
people, and I really shouldn't say "you would need to" do anything
different; I meant "you would need to say my $x = undef if you have this
warning turned on and you don't want to see it."

Reply via email to