@Adám Thank you... "expert" meaning "old and tired" ;-) I am afraid I won't be able to hang around much here, though. Nowhere near as much as I'd like to... Real life calling...
@ngn Michele's Key solution works with the assumption that ⍺⍺ is a pure function (has no side-effects and is not affected by outside conditions): {↑∪⍵⍺⍺¨⍸¨⍵=⊂⍵}
In mathematics, an injective function or injection or one-to-one function is a function that preserves distinctness: it never maps distinct elements of its domain to the same element of its codomain. In other words, every element of the function's codomain is the image of at most one element of its domain. The term one-to-one function must not be confused with one-to-one correspondence (a.k.a. bijective function), which uniquely maps all elements in both domain and codomain to each other (see figures).
Occasionally, an injective function from X to Y is denoted f : X ↣ Y, using an arrow with a barbed...
@dzaima Not really. Windows reports them as digits, and then our scanner would look them up in its digit table. Not finding them, they would remain 0 (unset).
I find that the most valuable trick for golfing APL in the session (REPL) is holding the APL key and Shift down, then pressing '[ which makes ≢⍞. Then press Enter and paste your solution and press Enter again. Voilà; char count.
@J.Salle No, it begins a new partition when an element of ⍺ is larger than its predecessor. (There is an imagined 0 to the left of the beginning.) 0s indicate elements to omit entirely.
@EriktheOutgolfer Basically ⌷ is for selecting in high rank, and ⊃ for selecting in deep depth. Each successive element of ⍺ will reduce the rank/depth of the result by 1.
@EriktheOutgolfer It does. 1⌷ selects the first layer of a 3D array. 1 2⌷ selects the second row of the first layer. 1 2 3⌷ selects the third element of the second row of the first layer.
1⊃ selects the first element of a vector. 1 2⌷ selects the second element of the first element. 1 2 3⊃ selects the third element of the second element of the first element.
It has depth 2 because even if you extracted one of its 6 elements, you'd not get a simple scalar, but would have extract again to get a simple scalar. The two needed extractions = depth 2.
It has depth 3 because even if you extracted one of its 2 elements, you'd not get a simple scalar, but would have extract another two times to get a simple scalar. The three needed extractions = depth 3.
@EriktheOutgolfer Last one? Yes. (Helps if you use the reply feature.)
An informal APL learning session has been scheduled by Adam for Wednesday 17:30 UTC (18:30 UK, 19:30 DK) at https://chat.stackexchange.com/rooms/52405/apl
well, I'm afraid that won't be welcome in our house, greece has financial crisis and, even though it doesn't cost anything, who knows if it's thieves or something these days, sorry but we're not in a position to open the door to people we don't know
@EriktheOutgolfer I know. You're not the first. For some reason, managment/media dept thinks that printed/printable materials are the right thing. I think accessible HTML is.
> Listen to me very carefully. You must modernize yourself, sir! Nowadays, there exists a thing called internet, a thing called download and a thing called view whatever you want on-screen, and you still insist on printing ‽ You have understood something very wrongly, and you better fix that or you go!
(possible way to make stuff more, well, accessible without cussing :p I imagine their boss rightfully shouting to him like that lol)
@EriktheOutgolfer pehaps use these as a substitute for a cheat sheet? http://help.dyalog.com/16.0/Content/Language/Primitive%20Functions/Scalar%20Functions.htm http://help.dyalog.com/16.0/Content/Language/Primitive%20Functions/Mixed%20Functions.htm
so, if I do 250⊤number I'll be encoding the number to base-250 right? How do I encode it back to base 10 assuming the base-250 number is also a base 10 number?
@EriktheOutgolfer ⊤ is really mixed-base. For every position (from the right) in your number system, you need another base on the left of ⊤, e.g. 24 60 60 ⊤ converts seconds to HMS. If you give too few bases (e.g. just one), any overflow will be chopped. ⊥ is the inverse, but there, if you give it just one base but multiple values on the right, it will assume you mean that all positions are the same.
@EriktheOutgolfer This slight difference between ⊥ and ⊤ means that their inverses ⍣¯1 are slightly different too. ⊥⍣¯1 will "assume they are all the same" and use as many positions as needed.