@Bubbler I'm confused about what it means in J for an array to have only one axis that is 0 length. Does that mean it's just a single scalar in that axis and has the same shape in the others? When I type 0$i.2 3 4 it doesn't give me any data even though the shape is shown as 0 3 4
@dukereg If any axis has length 0, the whole array has zero elements. For example, i.2 3 4 has 2*3*4 = 24 elements. 0$i.2 3 4 has shape 0 3 4, so it has 0*3*4 = 0 elements.
But it is still an array that represents zero layers of 3x4 matrices, so you can concatenate 3x4 matrices on top of it (and no other sized matrices).
Is it not possible to run code producing side effects in a defn? I suppose most meaningful side effects will involve assigning part of another object, does calling a function that performs assignment somewhere else count as a statement with an assignment?
@phantomics If the side-effecting code returns a value, you can put _← on its left to continue execution inside the dfn. Otherwise, you need to use dfns.do or apply the hack yourself
Regarding the Linux "SuperKey", all the relevant code changes have been made & committed to Dyalog APL source code for v18.0 and 18.1 + RIDE 4.4. I cannot yet predict exactly when the changes will make it as far as a new non-commercial distribution, I'll keep you posted.
Presented in honor of APL as an interactive tool turning 50 this year
Background
Ken [Iverson] presented his paper Formalism in Programming Languages in August 1963 at a Working Conference on Mechanical Language Structures, Princeton, N.J. The list of conferees is full of famous and soon-to-be f...
It started with me trying to understand the expression and getting nowhere. Then I decided to write my own simply based on the requirements and came up with this: {+/(,⍵=+/¨⍳⍴⍵)/,⍵}
@user965986 Hi สายใหม สีชมพู. If you want to participate here, just email access@apl.chat
@dzaima Though it isn't clear how Iverson would have treated a 2D left argument and 3D right argument. I think the natural thing is to return an argument of rank 1+-⍥(≢⍴)⍨
@Adám well, here is one. this contains another. And I have used it plenty of other times (though admittedly i've pretty much never used actual leading axis stuff besides for scalar primitives sometimes)
(by "much less useful" i didn't mean i have any alternate model, just that the full leading axis definition is much less often needed than the equal dimensions case)
@Adám you either store as a row/column vector (i'd estimate either the row or column count would be constant in the vast majority of cases), or get sad and cry in a corner :)
@Adám i'd rather define mine as "the useful subset" of the generalization. how often are you gonna have a 3D+ array and want to filter it by a 2D+ boolean array?
In the Dyalog (pdf) docs for user commands, to load the SAMPLES group, it says to issue the command ` ]Settings cmddir ,[SALT]/study`. Is that verbatim, or is the [SALT] something that should be substituted? It's not clear to me.