Re: RFC 148 (v1) Add reshape() for multi-dimensional array reshaping
[email protected] (Ariel Scolnicov)
| Newsgroups | perl.perl6.language.data |
|---|---|
| Organization | Compugen, Ltd. |
| Message-ID | <[email protected]> |
Nathan Wiger <[email protected]> writes: > > > > $a[$i][$j][$k] or $a[$i,$j,$k] > > > The second one has no useful meeting, "," is just an operator which > > does nothing much useful in this context. > > Not true, at least not in the Perl I know. :-) Here's a description of > what these do in Perl just to clarify: > > $a[0][1][2]; # get a single multidimensional element > $a[0,1,2]; # get elements 0, 1, and 2 of @a Ahem. We've been arguing about getting rid of $@%, but haven't yet! $a[0,1,2] returns exactly $a[2], since it is a $calar context. Perhaps you were thinking of @a[0,1,2]? In any case, having good multi-dimensional syntax for scalar access but not for list access is not very orthogonal. Also, C<,> inside (scalar) square brackets is B<not> useless! Consider e.g. print $line[do_something_for_side_effect, $a+$b] [...] -- Ariel Scolnicov |"GCAAGAATTGAACTGTAG" | [email protected] Compugen Ltd. |Tel: +972-2-6795059 (Jerusalem) \ We recycle all our Hz 72 Pinhas Rosen St. |Tel: +972-3-7658514 (Main office)`--------------------- Tel-Aviv 69512, ISRAEL |Fax: +972-3-7658555 http://3w.compugen.co.il/~ariels