Element-wise operations: Difference between revisions

m
→‎{{header|Raku}}: Fix comment: Perl 6 --> Raku
(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
m (→‎{{header|Raku}}: Fix comment: Perl 6 --> Raku)
Line 1,950:
(formerly Perl 6)
{{Works with|rakudo|2016.05}}
Perl 6Raku already implements this and other metaoperators as higher-order functions (cross, zip, reduce, triangle, etc.) that are usually accessed through a meta-operator syntactic sugar that is productive over all appropriate operators, including user-defined ones. In this case, a dwimmy element-wise operator (generically known as a "hyper") is indicated by surrounding the operator with double angle quotes. Hypers dwim on the pointy end with cyclic APL semantics as necessary. You can turn the quote the other way to suppress dwimmery on that end. In this case we could have used <tt>»op»</tt> instead of <tt>«op»</tt> since the short side is always on the right.<lang perl6>my @a =
<lang perl6>my @a =
[1,2,3],
[4,5,6],
2,392

edits