Jeremy Howard wrote:
> 
> RFC 203 defines a :bounds attribute that defines the maximum index of each
> dimension of an array. RFC 206 provides the syntax @#array which returns
> these maximum indexes. For consistancy, the arguments to reshape() should be
> the maximum index of each dimension. A maximum index of '0' would mean that
> that dimension is 1 element wide. Therefore '0' can not be special in
> reshape(). Therefore we should use '-1'.

I agree with Christian, if you're going to use bounds(), this should be
equal to the number of elements, NOT the number of the last element. So
you would say "3" for 3 elements, even though they're numbered 0..2.
This is the way other similar Perl ops work already:

   $size = @a;    # 3
   $last = $#a;   # 2

Having "bounds" be the last index, instead of the max size, is very
counterintuitive. Having "0" mean "1 element" doesn't make any sense.
"0" should mean 0 elements, and -1 should mean the last element.

-Nate

Reply via email to