Yes and no. The basic definition of [op] in Perl 6 is syntactic rather than semantic, so it will do either foldl or foldr depending on the syntactic associativity of the operator in question. But the syntactic definition goes a little beyond that, insofar as it can be applied to context-dependent syntactic operators that have no fixed run-time meaning, such as [;] or [,]. Since the meanings of ; and , depend on syntactic context, so do the meanings of [;] and [,].
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
[<] @array
to mean
@array[0] < @array[1] < @array[2] ...
which will tell you if the array is monotonically increasing without having to do strange semantic contortions to separate value from success (see Icon).
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. | [reply] [d/l] [select] |