in reply to Re^2: Perl 6 - Operator renaming
in thread Perl 6 - Operator renaming
Furthermore, it can be applied to operators that are neither left nor right-associative, such as the various list-associative operators, which in Perl 6 includes the comparison operators. So you can write
to mean[<] @array
which will tell you if the array is monotonically increasing without having to do strange semantic contortions to separate value from success (see Icon).@array[0] < @array[1] < @array[2] ...
There will still be need for underlying foldl and foldr equivalents to force folding "against the grain", but for most purposes (including educational and visual), the [op] form is more accessible, I think.
|
|---|