On Thu, Oct 11, 2001 at 08:06:15PM +0200, Angel Faus wrote:
> 
> Maybe i should better explain myself with an example.
> 

> @arr3 = @arr1[^i] + @arr2[^i]   # also @arr[^i] = @arr1[^i] + @arr2[^i]

Hyper-operators do this just fine.

> @arr4 = $v * @arr1[^i]
> $sum =+ @arr1[^i]
> @lengths_array = @arr1[^i].length()

These can be done in Perl 5 easily enough with map or foreach:

        @arr4 = map {$v * $_} @arr1
        $sum += $_ foreach (@arr1)
        @lengths_array = map { length } @arr1

> I turns out also that RFC's semantics allows much more powerful things 
> like:
> 
> @mat3 = @mat1[^i,^j] * @mat2[^j,^i]

That's more complicated, but doable. I'd personally be happier reading
the code if it used nested for loops....

I don't *dislike* the idea, I'm just pointing out that there's a lot
of it already in the language. Perhaps making map/foreach/grep more
flexible with some kind of adverbial modification would be more
effective (e.g. having a way to specify an incrementor variable or
the temporary variable for map would allow nested maps to be more
useful).

-- 
Aaron Sherman
[EMAIL PROTECTED]             finger [EMAIL PROTECTED] for GPG info. Fingerprint:
www.ajs.com/~ajs        6DC1 F67A B9FB 2FBA D04C  619E FC35 5713 2676 CEAF
  "Write your letters in the sand for the day I'll take your hand
   In the land that our grandchildren knew." -Queen/_'39_

Reply via email to