[EMAIL PROTECTED] wrote: > > > @arr3 = @arr1[^i] + @arr2[^i] # also @arr[^i] = @arr1[^i] + @arr2[^i] > > > > Hyper-operators do this just fine. > > > Oh yes they do. The point is that the ^i-loop way is better (more powerful and simpler at the same time). > > Maybe the examples where not good enough. > Your examples were good enough. But they are not a replacement for the RFC, so please, anyone who wants to argue that array-threading notation is not useful, read the RFC first. Here's a direct link to it: http://dev.perl.org/rfc/207.html
Hyper-operators (i.e. element-wise array ops) and explicit array threading are not incompatible. In fact, I wrote RFC 82 (element-wise array ops) and was heavily involved in RFC 207 (Buddha Buck and I wrote most of RFCs 202-207 together, but we had to put one of our names on the individual RFCs). RFC 207 explicitly discusses the relationship with RFC 82. As well as providing compact syntax for commonly-used tensor operations, array-threading notation can make life easier for the optimiser when it comes to generating tight loops (which is absolutely required for useful data crunching). Examples of the syntax are abundent in the RFC. Examples of the optimisation improvements can be seen in NumPy's ufunc/fromfunc: http://starship.python.net/~da/numtut/array.html#SEC8 http://starship.python.net/~da/numtut/array.html#SEC13 ...and in Perl Data Language's thread-aware functions: http://pdl.sourceforge.net/PDLdocs/Indexing.html#Threading ...amongst many other examples.