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

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



Mark Mielke <markm@nortelnetworks.com> writes:
>On Thu, Jan 13, 2000 at 11:54:35AM -0800, "Gurusamy Sarathy" wrote:
>> On Thu, 13 Jan 2000 12:36:51 MST, Tom Christiansen wrote:
>> >>>Will delete allow for
>> >>>    delete $a[100];
>> >>>    print scalar @a;    # prints 0 ???
>> >>Yes, that's what it does.
>> >So, delete on an array doesn't actually do the same thing as
>> >pop/splice/shift would.  I don't think that this won't confuse
>> >people.  Do you not not think not either? :-)
>> I think it would confuse people who are willingly/easily confused,
>> yes.
>
>Which is really true for almost anything perl. No point in looking back now.

Surprisingly that is _not_ true. In general perl is very intuitive
even to hardware engineers and manager types - providing they don't
get in too deep. Thus my biggest worry about this topic is not 
exists() but delete() - "they" a going to guess it does the splice.

I am also bothered by the asymetry that we can now delete elements
from a psuedo-hash but cannot add them - unless the 

my @array = ({});
$array{'foo'} = 3;

restriction has been lifted too.

-- 
Nick Ing-Simmons


References to:
Tom Christiansen <tchrist@chthon.perl.com>
Gurusamy Sarathy <gsar@ActiveState.com>
"Mark Mielke" <markm@nortelnetworks.com>

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