[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

Re: exists $foo[7] and delete $foo[7]



>The semantics are such that there can never be any uninitialized elements
>at the end of the array.

Could you please define "uninitialized"?  Could you please distinguish
this from "undefined"?  Can only the scalar elements in an array
be uninitialized?  Is this all arrays, or only pseudo-hashes?  What
about the scalar elements in a hash?  Can they also be uninitialized?
How does this different from a nonexistent value (undef $h{K}) or
a nonexistent key (delete $h{K})?  Can we now delete any scalar,
or only elements of aggregates; and what about functions?  Can we
now say exists on any scalar, or only on elements of aggregates;
and again, what about functions?

The nature of truth is becoming very blurred in my own mind, at least.

1   False and uninitialized  
        (what is really?  is it like asking for an element of an
         array that's greater than the length of the array?)

2   False and undefined:
	result after undef $h{K})

3   False and nonexistent key:
	result after delete $h{K})

4   False and defined, but with a string length of 0:
	""

5   False and numerically 0, but without any warnings:
	0, 0.0, 0x00, "0"

6   True yet numerically 0, but without any warnings: 
	"0x00", "000", "0.0", "0 but true"

7   True yet numerically 0, but with numeric warnings: 
	"0 but wrong", "snaggleblech"

--tom


Follow-Ups from:
"Matthias Urlichs" <smurf@noris.net>
Gurusamy Sarathy <gsar@ActiveState.com>
JVromans@squirrel.nl (Johan Vromans)

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]