Re: reshape() (was Re: Fw: Wrapup time)
[email protected] ("Jeremy Howard") Thu, 14 Sep 2000 17:30:43 +1100
| Newsgroups | perl.perl6.language.data |
|---|---|
| Message-ID | <001101c01e15$5150a500$c1252ccb@SAMANTHA> |
Nathan Wiger wrote: > 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 > OK, I'm convinced. I'll change :bounds. I agree with Christian that it should be renamed :shape in that case.