HaloO, Darren Duncan wrote:
For other operators, non-assoc etc, the work will probably all have to be linear. Eg difference|quotient|exponentiation.
That's why I would rename the left and right operator associativity to left and right sequentiality. Note that there's a fundamental difference between difference and quotient on the one hand and exponentiation on the other. The former are defined as inverses of associative operations. The right inverse of exponentiation is logarithm which is not available as an operator for good reasons. In other words exponentiation as a binary operator is a bit dubious. Well, or we should spec 8 log 2 == 3 and bewail the fact that // is already taken for much more useful things.
Something I'm wondering, though, realistically how often would one actually be reducing on an operator that is not associative? What practical use is there for [-] (3,4,5) for example?
I see it as a convenient notation for 3 - ([+] 4,5) just as $x - $y means $x + -$y. Practical example is [-] $money, @bills which stresses the payment of the bills whereas in $money - [EMAIL PROTECTED] the summing-up of the bills visually outweighs the subtraction. Perl 6 might actually develop the idiom that [EMAIL PROTECTED] implies a special role of @array[0]. Regards, TSa. -- The Angel of Geometry and the Devil of Algebra fight for the soul of any mathematical being. -- Attributed to Hermann Weyl