Hi to all,

I have been thinking lately about hyperoperators, and particulary
about its similarity with RFC 207 (Arrays: Efficient Array Loops)

For the ones that don't have the RFC in mind, I copy its abstract:

   >This RFC proposes a notation for creating efficient implicit 
   >loops over multidimensional arrays. It introduces the notation 
   >|i for an index iterator for arrays, allowing temporary
   >multidimensional arrays to be created on the fly. 
   
My point is that what hyperoperators express (aplying operators and
methods elementwise) is just a subset of the functionality provided
by RFC 207, and that the former is both simpler and more powerful.

Maybe i should better explain myself with an example.

@arr3 = @arr1 ^+ @arr2
@arr4 = $v ^* @arr1
$sum ^=+ @arr1

Could become:

@arr3 = @arr1[|i] + @arr2[|i]    # also @arr3[|i] = @arr1[|i] + @arr2[|i]
@arr4 = $v + @arr1[|i]
$sum  =+ @arr1[|i]              

As an alternative and without real thought on it, i would suggest
maybe a different notation (more similar to Apocalypse's one)
for this RFC.

@arr3 = @arr1[^i] + @arr2[^i]   # also @arr[^i] = @arr1[^i] + @arr2[^i]
@arr4 = $v * @arr1[^i]
$sum =+ @arr1[^i]

@lengths_array = @arr1[^i].length()

I turns out also that RFC's semantics allows much more powerful things 
like:

@mat3 = @mat1[^i,^j] * @mat2[^j,^i]

It looks to me that hyperoperators are just a partial solution
to a bigger problem, and that the cost (a whole family of 
new operators) is way too big for its value. On the other hand,
a RFC 207-like notation adds a lot more power with a single
addition to the language.

Just my 5 cents ;-)


Angel Faus
[EMAIL PROTECTED]

Reply via email to