Chaim Frenkel wrote:
> 
> In a hash exists() is a valid concept. In an array (even a sparse one)
> exists() has no meaning. The data is always there. The sparsity is
> an implementational detail.

WADR, exists() could -- even if it doesn't currently -- have a defined
meaning for arrays:

        my @arr :low(10) :high(1000);
        exists $arr[100000] # false, of course.

or even

        my @arr = ( 0 .. 100 );
        exists $arr[100000] # false, if exists() is defined this way.


> A hash has symbols, names, things. An array has just numbers[*].

"Things"?  A hash is indexed by strings, an array is indexed by numbers.
They *both* have values distinct from (pointed to by) their indices.
Again, sounds to me like the difference between strings and numbers.

And to reiterate an earlier point: if @foo is declared to be an
associative array rather than a normal, numerically indexed array,
there's no need to support a distinct indexing syntax:

        my @foo :assoc;
        $foo['finger'] = 'plan';

-- 
John Porter

        Aus tiefem Traum bin ich erwacht.

Reply via email to