@Ven Depends what you're doing. If it is part of a larger function, having it be dyadic (my version) is possibly better. However, if you're doing just this task, then ngn's is better.
Dyalog APL, 31 19 13 12 bytes
Almost a transliteration (31 bytes) of @Zgarb's solution.
An anonymous function. Left argument is wrapping, right argument is gift.
⊣h⍤1⊣h⍤2(h←⍪⍪⊣)
⊣h⍤1 h applied, with the anonymous function's left argument, to the columns of
⊣h⍤2 h applied, with the anonymo...
@Ven I'm down to 25 in Extended. I have a feeling 24 is possible.
I should be getting home, but here's an interesting challenge: Is there an easy way unravel a matrix by its diagonals? Or a 3D-array by its diagonal planes
@dzaima There's also a performance question. Linked lists are expensive. The operators can take shortcuts by analysing their operands and avoiding unnecessary intermediate representation.
@dzaima Then even a reductions would fall prey, no?
@ngn If I was, I'd probably make everything left-to-right. My only problem with it is that whenever I try it in my head, I end up with I, which is not pleasant to use.
@dzaima I'm not sure +/is better than /+ for LPA. Seeing the / tells you immediately that we're now going to reduce by something, whereas you otherwise might be confounded why (#$%) is being applied, only to then notice the trailing /
Maybe it should be called ⅃ꟼA.
@dzaima You might want to swap the / and \ symbols etc.
@Adám um... i wonder how universal this is: at school, when the teachers wanted to sum over several lines, they used to draw a big } on the right and write /+ next to it
@ngn Wow, I've never seen that or heard of it before, but if it wasn't just a local custom, then that settles it, I think. Wonder if we can find a reference for it online.
@dzaima But on the other hand, monadic ! becomes nice. It is a tradeoff, but I think you should rather be consistent. You could make √ an exception for legacy reasons, like APL treats dyadic ÷.
it was usually equations, for instance a system of linear equations
to express that you want to multiple each side by, say -2, you wrote / . (-2) on the right of the corresponding equation (the dot should be a middle dot)
A Bulgarian friend of mine told me that at school, when the teachers wanted to sum over several lines, they wrote
$
\left.
\begin{array}{l}
a-b\\c-d\\e-f\\g-h
\end{array}
\right\}
/+
$ meaning what we would write as $
\begin{array}{l}
(a-b)+\\(c-d)+\\(e-f)+\\(g-h)
\end{array}
$.
I would appreci...
@Ven i mean, to both sides of each equation. if they just wrote +C without a /, it would look like it's part of only one side of the equation, wouldn't it?