t/spec/S29-array/delete.t currently has:

  my @array = <a b c d>;
  is [EMAIL PROTECTED], "a b c d", "basic sanity (1)";
  is [EMAIL PROTECTED](2), "c",
    "deletion of an array element returned the right thing";
  # Note: The double space here is correct (it's the stringification of undef).
  is [EMAIL PROTECTED], "a b  d", "deletion of an array element";

  is [EMAIL PROTECTED](0, 3), "a d",
    "deletion of array elements returned the right things";
  is [EMAIL PROTECTED], " b ", "deletion of array elements (1)";
  is [EMAIL PROTECTED], 3,     "deletion of array elements (2)";

I believe that the last two tests are wrong -- that after
deleting elements 0 and 3 from the array we should be
left with a 2-element array that stringifies to " b".

In particular, I think that the following sequence should
result in a 0-length array:

    my @array;
    @array[8] = 'eight';            # array has elements 0..8
    @array.delete(8);               # now it's empty again
    say [EMAIL PROTECTED];                    # "0\n"

Pugs (evalbot) disagrees with me on this:

    06:16 <pmichaud> pugs:  my @array; @array[8]='eight'; @array.delete(8); say 
[EMAIL PROTECTED];
    06:16 <exp_evalbot> OUTPUT[8␤]

Perl 5 agrees with my interpretation, though:

    $ cat x
      my @array;
      $array[8] = 'eight';
      delete $array[8];
      print [EMAIL PROTECTED], "\n";
    $ perl x
    0
    $

Comments?

Pm

Reply via email to