I had a quick look at APL2 on the mainframe several years ago, and remember that solutions to the problem of adding a vector to the matrix were shown.
Given a←4 4 ⍴ ⍳16 and ⎕io←1
The old way of adding a vector to strings was something like
a+(⍴a)⍴10 20 30 40
as a result
11 22 33 44 15 26 37 48 19 30 41 52 23 34 45 56
and adding a vector to the columns of the matrix was
a+(4 1⍴10 20 30 40)[;1 1 1 1]
or if you want
a+4/4 1⍴10 20 30 40
as a result
11 12 13 14 25 26 27 28 39 40 41 42 53 54 55 56
Fortunately, I was able to call the guy who showed me APL2 that day (he resigned, but still answers his phone) and asks about this second solution, which immediately remembered what I was talking about.
The new APL2 method was much more concise, concise and consistent, these examples would be solved with a+[2] 10 20 30 40 and a+[1] 10 20 30 40 . Cool. And he worked at Dyalog.
Speed up ten or more years, and I see that this new thing is called the Rank Operator. The first example can be solved with a(+⍤1) 10 20 30 40 (I'm still trying to figure out how to use parentheses, I think I actually restored some brain cells as soon as I thought I understood it)
Be that as it may, there is no direct (at least for me) analogue of the second example a+[1] 10 20 30 40 using the rank of the operator. I can’t say that I understand this at all, but it seems to me that the rank operator "throws" its left argument, folding its dimensions, leaving the contents intact. For too many years, C ++ and Java have influenced my way of thinking about things.
Is there a simple solution for a+[1] 10 20 30 40 using the rank of the operator? The only thing I have found so far is ⍉(⍉a)(+⍤1) 10 20 30 40 , which skips the point and defeats the entire target.
Why would a rank operator be preferable to axial notation? Which is better? ”(Of course, the term is loaded). At first glance, the axial designation was very easy for me, a guy with an IQ size for shoes, to understand. I could not say the same for the operator’s rank.