Re: Array Holes

2006-01-14 Thread Austin Hastings
Larry Wall wrote: Whatever the answer, it probably has to apply to my @a; @a[0] = '1'; @a[2] = '3'; print exists $a[1]; as well as the explicit delete case. Are we going to pitch an exception for writing beyond the end of an array? That seems a bit anti-Perlish. What's

Array Holes

2006-01-13 Thread Luke Palmer
In perl 5: my @a = (1,2,3); delete $a[1]; print exists $a[1]; This is false, whereas $a[0] and $a[2] do exist. This is creepy. Not only is it creepy, it raises a whole bunch of questions with nontrivial answers: * does [EMAIL PROTECTED] include nonexistent elements? * does

Re: Array Holes

2006-01-13 Thread Nicholas Clark
On Fri, Jan 13, 2006 at 10:33:23PM +, Luke Palmer wrote: In perl 5: my @a = (1,2,3); delete $a[1]; print exists $a[1]; This is false, whereas $a[0] and $a[2] do exist. This is creepy. Not only is it creepy, it raises a whole bunch of questions with nontrivial answers:

Re: Array Holes

2006-01-13 Thread Larry Wall
On Fri, Jan 13, 2006 at 10:33:23PM +, Luke Palmer wrote: : In perl 5: : : my @a = (1,2,3); : delete $a[1]; : print exists $a[1]; : : This is false, whereas $a[0] and $a[2] do exist. This is creepy. Not : only is it creepy, it raises a whole bunch of questions with : nontrivial