« first day (1086 days earlier)      last day (1865 days later) » 

05:26
And here comes the tenth 200 bounty.
 
4 hours later…
09:05
0
Q: Alexa APL input using built-in keyboard

Veck HsiaoI have an Echo Spot and I'm using Alexa Presentation Language (APL) to implement the user interface. I want to have user input by using the built-in keyboard. Is it possible to invoke the built-in keyboard in Node.js SDK?

No Alexa please...
09:22
Proposal for the "mixed with" primitive ¦
P.S. I read an article by the inventor of Scheme (will paste link if I remember / find it) and he mentioned that APL was close to being a really really good language all round, except that the language could not be extended by the user in a way which matched the core primitives (i.e. a user could not assign a function to a symbol) so there is a barrier to extension and possibly therefore adoption. I love that I could do this mock up in ngn/apl.
The argument against users extending the language arbitrarily in this way are obvious (how could anyone read code) but maybe I hope that if enough users tried things out then sensible extensions would evolve naturally (wishful thinking)
09:38
@RichardPark i feel like ({⍺⍵}) would be an (imo) more useful primitive, still giving a relatively simple ¦←↑⍮
@RichardPark on the contrary i'd say the separation of text for user-defined & special chars for builtins is a beautiful way to allow for future extensions. There's not much of (aply) unicode to redefine left either way.
@dzaima I agree, but ¦ isn't a bad symbol for {⍺⍵} either. In any case, 18.0 has ,⍥⊂ which is not terrible, so an what @RichardPark is proposing will then be ↑⍤,⍥⊂
@dzaima I think you're probably right. I'm currently in a "make it all flat" phase. {⍺⍵} is more useful, but I think ⍮ is a risky symbol - not distinct enough imo ¦ is pushing it tbh
@dzaima I agree, but it'd be nice to have "language designer mode" that allowed assignment to symbols for experimentation purposes. Maybe we should allow users to use more alphabets/accents, though.
@RichardPark and i'm in a very "make it all nested if there's a constant anount of it" phase :p
@RichardPark Good point. If ¦ was {↑⍺⍵}, then {⍺⍵} could be written ¦⍥⊂ similarly to and require explicit to avoid mixing.
09:52
@Adám a completely utterly crazy and horrible, but still fun idea would be that certain names get interpreted as & shown as images :D
@dzaima I don't even see how that'd be useful. Though, I might be interested in the IDE showing strings without quotes,and making inner quotes single, but e.g. in reverse video.
@dzaima Actually some VS Code plugins offer Unicode math symbol rendering for selected English words, like ¬ for not and for forall.
That could be interesting if the symbols are selected wisely.
@Bubbler that's just regular ligatures, the "crazy and horrible" part is allowing the user to draw their own symbols for whatever domain they please
@dzaima For a compromise, we have Unicode combining characters that allow overstrikes of |/-\○←~¨ over any character, just that we need a new font that supports actually overstriking on any symbol.
(Actually there are more than that)
10:07
@Bubbler Even more!
Is it possible to include Conga from a .dyalog file?
Or does one have to do it in the workspace?
@rcabaco ⎕CY'Conga'
@Adám I assumed that only worked in the workspace. Was looking at :Require. thank you
10:20
I have a vector of character vectors, and I want to search each for a prefix. Assuming that if there is a match it is a single one I want to extract it.
I've reached this:
(lines⊃⍨⍸)(⊂'* STATUS')(∧/∘⊣∊∘⊢↑⍨∘≢⊣)¨lines
Is this well written? (for any interpretation of well)
I couldn't managed to place ⍸ after ∧/, so i extracted that part from the train
 
1 hour later…
11:52
@rcabaco I don't think it does what you want.
Let's analyse what (⊂'* STATUS')(∧/∘⊣∊∘⊢↑⍨∘≢⊣)¨lines is doing.
First, let's remove the post-processing ∧/∘⊣, that gives us (⊂'* STATUS')(∊∘⊢↑⍨∘≢⊣)¨lines
Now ∊∘⊢ is the same thing as because A f∘g B is A f g B so A f ⊢ B is A f B
(⊂'* STATUS')(∊↑⍨∘≢⊣)¨lines
Let's not actually apply the middle function, just inspect what the middle function sees:
⎕←(⊂'* STATUS')(∊{⍺'↑⍨∘≢'⍵}⊣)¨'STATUS bar' 'drink bar' 'STATUS field' 'corn field'
@Adám
┌───────────────────────────────┬───────────────────────────────┬───────────────────────────────┬───────────────────────────────┐
│┌───────────────┬────┬────────┐│┌───────────────┬────┬────────┐│┌───────────────┬────┬────────┐│┌───────────────┬────┬────────┐│
││0 1 1 1 1 1 1 1│↑⍨∘≢│* STATUS│││0 1 0 0 0 0 0 0│↑⍨∘≢│* STATUS│││0 1 1 1 1 1 1 1│↑⍨∘≢│* STATUS│││0 1 0 0 0 0 0 0│↑⍨∘≢│* STATUS││
│└───────────────┴────┴────────┘│└───────────────┴────┴────────┘│└───────────────┴────┴────────┘│└───────────────┴────┴────────┘│
Hm, that's a bit hard to read.
⎕←(⊂'* STATUS')(∊{⍺'↑⍨∘≢'⍵}⊣)¨'STATUS bar' 'drink bar' 'STATUS field'
@Adám
┌───────────────────────────────┬───────────────────────────────┬───────────────────────────────┐
│┌───────────────┬────┬────────┐│┌───────────────┬────┬────────┐│┌───────────────┬────┬────────┐│
││0 1 1 1 1 1 1 1│↑⍨∘≢│* STATUS│││0 1 0 0 0 0 0 0│↑⍨∘≢│* STATUS│││0 1 1 1 1 1 1 1│↑⍨∘≢│* STATUS││
│└───────────────┴────┴────────┘│└───────────────┴────┴────────┘│└───────────────┴────┴────────┘│
└───────────────────────────────┴───────────────────────────────┴───────────────────────────────┘
Since ≢'* STATUS' is 8, we get:
⎕←(⊂'* STATUS')(8↑∊)¨'STATUS bar' 'drink bar' 'STATUS field'
@Adám
┌───────────────┬───────────────┬───────────────┐
│0 1 1 1 1 1 1 1│0 1 0 0 0 0 0 0│0 1 1 1 1 1 1 1│
└───────────────┴───────────────┴───────────────┘
11:59
Which, as you can see, isn't really relevant.
What you want to work with instead is which finds where its left argument begins in its right argument:
⍞←'bra'⍷'abracadabra'
@Adám 0 1 0 0 0 0 0 0 1 0 0
And thus, testing for prefix is simply the first of those values:
@RichardPark i had a similar thought while learning lisp recently, should we have some specialised syntax for extending the language, or stick make everything constructible with some normal core primitives?
⍞←(⊂'bra')(⊃⍷)¨'abracadabra' 'brat'
@Adám 0 1
12:02
@dzaima yes but what if the user disagrees with the function of a glyph? the user should be able to construct it to fit the wanted needs
@KritixiLithos In the following text, the letters "x" and "y" represent what is traditionally denoted "e" and "n": Oycx upoy a timx…
@KritixiLithos writing a name (and potentially adding spaces around it) isn't that hard. imo the pros outweigh the cons a lot
@KritixiLithos also, alternate meanings of the same thing is just plain bad - see ⎕IO
@dzaima but spaces around the names is annoying
@dzaima And even more so ⎕ML!
@Adám afaik most people have settled on ⎕ML←1, or at least there's an expected setting
12:07
@dzaima Then ⎕IO←1 too, no?
@Adám I'm more ⎕IO←0 :p
Any fixed ⎕IO value is better than a settable one, imho.
Oh, there's ⎕CT too.
@Adám same goes for built-ins.
@dzaima Absolutely.
although yes I agree that is a weak argument, let me come up with a better one
12:10
Average as &→∕$: Try it online!
12:33
@Adám i just got back, will read. thank you
okay i haven't been able to come up with a better counter example
@Adám but a j programmer can use $←⍴⋄%←÷ to write j in apl
@Adám i made the assumption that if there was a '* STATUS' in one of the lines it would be at the beginning. It's how IMAP works.
⎕←(⊂'* STATUS')(8↑∊)¨'* STATUS bar' 'drink bar' 'STATUS field'
@rcabaco
┌───────────────┬───────────────┬───────────────┐
│1 1 1 1 1 1 1 1│0 1 0 0 0 0 0 0│0 1 1 1 1 1 1 1│
└───────────────┴───────────────┴───────────────┘
⎕←(⊂'* STATUS')(∧/8↑∊)¨'* STATUS bar' 'drink bar' 'STATUS field'
@rcabaco
1 0 0
12:36
that's why it worked for me.
@rcabaco is membership. You don't want membership.
@Adám i didn't even think about ⍷. SO MANY PRIMITIVES :)
@rcabaco That's abusing when = is the proper function.
@rcabaco But yes, you could write:
⍞←(⊂'* STATUS')(∧/⊣=⊢↑⍨∘≢⊣)¨'* STATUS bar' 'drink bar' 'STATUS field'
@Adám is there anything special about using a function after ∧/ ?
@Adám 1 0 0
12:38
i just couldn't get ⍸ to work after it
related question: how do you define something like / that can act as a function or as an operator
@rcabaco Not really, but you want both and ∧/ to be used monadically. Think about how (f g h) trains work.
@Adám i still mangle the meaning of = and ∊ a lot.
@KritixiLithos You can't. (One of the issues in my Extended APL is that I can't write covers for those).
@rcabaco = is simply equality. Many people are scared of = because they are used to it being assignment in C-inspired languages.
@Adám would you also agree that this is an opportunity for extension to apl?
12:43
@KritixiLithos No! Nope! NOOO!
⎕←(⊂'abc')='abb' 'acb' 'abc'
@rcabaco
┌─────┬─────┬─────┐
│1 1 0│1 0 0│1 1 1│
└─────┴─────┴─────┘
⎕←(⊂'abc')∊⍨'abb' 'acb' 'abc'
@rcabaco
0 0 1
there is also this difference, which in my head is easier to work with afterwards
12:44
@rcabaco Sure, but you're using a "set" of a single element. It is clearer what's going on in:
⎕←(⊂'abc')≡¨'abb' 'acb' 'abc'
@Adám
0 0 1
So you can write:
⍞←(⊂'* STATUS')(⊣≡⊢↑⍨∘≢⊣)¨'* STATUS bar' 'drink bar' 'STATUS field'
@Adám 1 0 0
@Adám yes it is.
@Adám why do you think? i've thought more about what about the extensibility of lisps i want from apl, and function arrays as in dfns solve most of them
12:46
@Adám and "matches" makes more sense than "is a member of" in that case. My head is still not thinking in all the primitives
@KritixiLithos The strange nature of the slashes cause all kinds of crazy parsing problems, and irregularities like messing with ability to add more code on the far left to post-process existing code that works. Instead, the slashes should be split into pure functions and pure operators, like dzaima/APL has it.
@rcabaco It will come with time.
huh J's got monad-dyad jsoftware.com/help/dictionary/d310v.htm, but doesn't appear to have function-operator
@KritixiLithos No, of course not. This was one of the warts of APL that Iverson removed in J. J also takes more care to distinguish dyadic operators (conjunctions) as a separate syntactic class (part of speech) from monadic operators (adverbs), while APLers use the same work operator for these two syntactically distinct entities.
@Adám understandable
i have switched my opinion to that of yours
 
2 hours later…
14:30
Hello. Anyone here for APL Cultivation?
@rcabaco Are you familiar with basic usage of the Rank Operator ?
Very basic
OK. So this lesson is intending to move from basic knowledge onto advanced knowledge.
Sounds good
14:33
Simple usage of is specifying which rank subcells we want a function to apply to, and for dyadic usage, which subcells of the left argument should be paired up with which subcells of the right argument.
Let's say we have the vector 'ab' and the matrix 3 4⍴⍳12
We want to prepend 'ab' only the beginning of every row in the matrix:
⎕←(3 2⍴'ab'),(3 4⍴⍳12)
@Adám
ab 1  2  3  4
ab 5  6  7  8
ab 9 10 11 12
But here, we did so by reshaping 'ab' until it became big enough to cover all rows.
Quiz: How do we do this without reshaping 'ab', just using ?
If you need to, refresh your memory with the previous lesson.
⎕←'ab',⍤1⊢3 4⍴⍳12
@rcabaco
ab 1  2  3  4
ab 5  6  7  8
ab 9 10 11 12
Perfect!
14:38
treat 'ab' as a cell, and every row of 3 4⍴⍳12
Exactly.
Let's say instead we have a 3D array:
⎕←2 2 4⍴⍳16
@Adám
 1  2  3  4
 5  6  7  8

 9 10 11 12
13 14 15 16
And we want to put a single character from 'ab' on each row:
⎕←(2 2⍴'ab'),(2 2 4⍴⍳16)
@Adám
a  1  2  3  4
b  5  6  7  8

a  9 10 11 12
b 13 14 15 16
Quiz: How do we do this with instead of ?
14:40
⎕←'ab',⍤1 2⊢2 2 4⍴⍳16
@rcabaco
a  1  2  3  4
b  5  6  7  8

a  9 10 11 12
b 13 14 15 16
a single cell, each plane
@rcabaco What do you mean by "a single cell"?
'ab' as a single cell
Ah, ok, yes.
14:42
'ab' with rank 0 would mean each character, i think.
Right.
In fact, you could have used ⍤2 because will only grab as big a cell as there is.
2 2 4 with rank 2 gives us two planes
⎕←'ab',⍤2⊢2 2 4⍴⍳16
@rcabaco
a  1  2  3  4
b  5  6  7  8

a  9 10 11 12
b 13 14 15 16
question: why does , split 'ab' for each row when in the initial example it repeated 'ab' for each row?
ahhh... it is repeating 'ab', but now we don't have rows, we have matrices
@rcabaco Yes, exactly. Because we paired up 'ab' with a matrix, not a row. so when we concatenate a vector with a matrix, the vector becomes a new column.
OK, now consider 'ABCD' and the matrix:
⎕←2 4⍴⍳8
14:45
@Adám
1 2 3 4
5 6 7 8
I want:
⎕←2 4 2⍴'A'1'B'2'C'3'D'4'A'5'B'6'C'7'D'8
@Adám
A 1
B 2
C 3
D 4

A 5
B 6
C 7
D 8
Any ideas how we would do this? (You don't have to have a full solution, just ideas stated in English!)
We want 'abcd' as a vector joined column-wise with each row of the matrix
OK, that's good. But what does "joined column-wise" actually mean? What type of arguments do we want , to operate on?
14:49
rank 1 is row-wise
Yes, but give me an example of two things being concatenated in the above.
⎕←'abcd',⍤1 0⊢2 4⍴⍳8
@rcabaco
abcd 1
abcd 2
abcd 3
abcd 4

abcd 5
abcd 6
abcd 7
abcd 8
Like if we used {⎕←⍺ ⋄ ⎕←⍵ ⋄ ⍺,⍵} instead of , what would be the first thing it would print as a side-effect?
I did not understand the question, sorry.
14:52
To make our result , will be called multiple times by each time with different arguments. What would be the first arguments , would see?
'abcd' / 1 2 3 4
But that wouldn't work:
in which case it would need further operation
⎕←'abcd',1 2 3 4
@Adám
abcd 1 2 3 4
14:54
@rcabaco Yes. Those arguments are too "big". We need , to operate on a more fine-grained level.
⎕←'abcd'{⍺,⍵}¨1 2 3 4
@rcabaco
┌───┬───┬───┬───┐
│a 1│b 2│c 3│d 4│
└───┴───┴───┴───┘
Very good, so now, what is , seeing each time around the loop?
'a' 1 // 'b' 2 ...
Exactly. Or, in other words ⍤0
14:55
yes
So, for the first row of the matrix, we want:
⎕←'ABCD'(,⍤0)1 2 3 4
@Adám
A 1
B 2
C 3
D 4
⎕←'abcd',⍤0⊢2 4⍴⍳8
@rcabaco
RANK ERROR
can we rank on rank?
14:56
We can! You got it!
meaning, ⍤1 ⍤0
Absolutely. Try it!
⎕←'abcd',⍤1⍤0⊢2 4⍴⍳8
@rcabaco
RANK ERROR
Remember how operators bind?
,⍤1⍤0 is the same thing as (,⍤1)⍤0
But look back. We found that , has to work on scalars, that is, we need ,⍤0 in there.
Only that function needs to be applied between the entire 'ABCD' on one side and the rows of the matrix on the other, i.e. ⍤1
14:59
so it's the other way around
Yes.
⎕←'abcd'(,⍤0)⍤1⊢2 4⍴⍳8
@rcabaco
a 1
b 2
c 3
d 4

a 5
b 6
c 7
d 8
Bravo! You don't the inner parenthesis due to the binding rules.
right-to-left execution, @rcabaco... right-to-left execution
15:01
@rcabaco True, but here it is really operator long-left-scope in action. There's only one function.
I was reading ,⍤1⍤0 as , on rank 1 and afterwards on rank 0
I see, but the s don't interact. The right-hand has no idea about which function it has on its left.
Ready for the next one?
Lets go
OK. I'm constructing my lunch menu card. We have three "fillings" and four "containers". I want to pair up all combinations of fillings and containers, thereby adding a trailing axis of length 2, so we get a rank 3 result:
So I should think of rank as only a data selector, independent of the function it is binding to?
15:06
@rcabaco Completely. That's what makes it superior to bracket-axis, which has to be ad-hoc implemented for each primitive, and can never work on user functions.
⎕←↑'beef' 'fish' 'veggie'∘.{⍺⍵}'sandwich' 'patties' 'platter' 'wrap'
@Adám
┌──────┬────────┐
│beef  │sandwich│
├──────┼────────┤
│beef  │patties │
├──────┼────────┤
│beef  │platter │
├──────┼────────┤
│beef  │wrap    │
└──────┴────────┘
┌──────┬────────┐
│fish  │sandwich│
├──────┼────────┤
│fish  │patties │
├──────┼────────┤
│fish  │platter │
├──────┼────────┤
│fish  │wrap    │
└──────┴────────┘
┌──────┬────────┐
│veggie│sandwich│
├──────┼────────┤
│veggie│patties │
├──────┼────────┤
│veggie│platter │
├──────┼────────┤
│veggie│wrap    │
└──────┴────────┘
How can we get this result using just , and ?
For each filling we want to pair it with each container
Yes.
single item from the left argument, whole right argument → single left, single right
15:10
Yes.
⎕←'beef' 'fish' 'veggie',⍤0 1⊢'sandwich' 'patties' 'platter' 'wrap'
@rcabaco
┌──────┬────────┬───────┬───────┬────┐
│beef  │sandwich│patties│platter│wrap│
├──────┼────────┼───────┼───────┼────┤
│fish  │sandwich│patties│platter│wrap│
├──────┼────────┼───────┼───────┼────┤
│veggie│sandwich│patties│platter│wrap│
└──────┴────────┴───────┴───────┴────┘
Clearly, that's not enough ing…
⎕←'beef' 'fish' 'veggie',⍤0⍤0 1⊢'sandwich' 'patties' 'platter' 'wrap'
@rcabaco
┌──────┬────────┐
│beef  │sandwich│
├──────┼────────┤
│beef  │patties │
├──────┼────────┤
│beef  │platter │
├──────┼────────┤
│beef  │wrap    │
└──────┴────────┘
┌──────┬────────┐
│fish  │sandwich│
├──────┼────────┤
│fish  │patties │
├──────┼────────┤
│fish  │platter │
├──────┼────────┤
│fish  │wrap    │
└──────┴────────┘
┌──────┬────────┐
│veggie│sandwich│
├──────┼────────┤
│veggie│patties │
├──────┼────────┤
│veggie│platter │
├──────┼────────┤
│veggie│wrap    │
└──────┴────────┘
15:13
Perfect. You're getting a hang of it now, are you not?
I was stuck in the order of ⍤ again
had to use your {⎕←⍺⋄⎕←⍵⋄⍺,⍵} function
That's fine. Use whichever tools are available. But I think it would have been possible to translate your English:
single item from the left argument, whole right argument ⍤0 1 → single left, single right ⍤0 0 (or ⍤0)
The inner application is the single-single, so it needs to be closest to the function ,
The mapping process from English to APL is not as easy as it sounds over on this side :)
And I was in doubt if ⍤0 on the left would mean character or word
It comes with a bit of exercise. really isn't very complicated. And experimentation is perfectly valid. That's why coding APL is traditionally done in an interactive session.
But since it is a vector of items, ⍤0 is an element of the vector
15:17
Exactly. Also always remember that will not open your enclosures. it always operates on the elements of your arrays.
it may be worth noting that ∘.f is always the same as f⍤0 ∞
Each element of the left with each item of the right?
Yes, but that's a pretty ambiguous English.
true
not very useful
Now, how might we swap the arguments of an outer product?
15:20
⎕←1 2 3(×⍤0 99)1 2 3 4 5
@Adám
1 2 3  4  5
2 4 6  8 10
3 6 9 12 15
Can you, without or or actually swapping arguments make:
⎕←1 2 3 4 5∘.×1 2 3
@Adám
1  2  3
2  4  6
3  6  9
4  8 12
5 10 15
Don't think of it as an outer product. Think of it as a problem like those we started with.
each of the left with whole right → left with each of right
15:23
I'm not sure I follow the English. Can you translate it to APL?
⍤0 99 → ⍤0
i have to try
Go for it. Feel free to experiment with the bot.
⎕←1 2 3 4 5(×⍤0 99)⊢1 2 3
@rcabaco
1  2  3
2  4  6
3  6  9
4  8 12
5 10 15
@rcabaco You swapped the arguments.
15:25
it's only one data selection, because × extends the left
ah, sorry
isn't it just swapping the ranks?
⎕←1 2 3(×⍤99 0)1 2 3 4 5
@rcabaco
1  2  3
2  4  6
3  6  9
4  8 12
5 10 15
@rcabaco It is indeed. I just wanted to make that point.
and it works here with a single data selection (a single ⍤) because we are using ×, which will extend the right argument.
with , we would need another ⍤ selection, right?
Right. A non-scalar function would need an inner ⍤0.
So, all clear so far?
Yes
Using the ⍤99 in the previous example is a form of generalization of the operation?
we could have used ⍤1
15:30
Correct. It is highly unlikely that you'd meet a 99D array.
Or, as I like to say: ∞=99 for small values of ∞
A really useful function (I call it "sane indexing" or "select") is to select the major cells of the right argument as indexed by the left argument.
can you give an example, please?
E.g. 2 3 1 2 Select 'abcdef' would give 'bcab'
However, only lets you choose a single major cell. How would you define Select in terms of ?
⎕←(⊂2 3 1 2)⌷'abcdef'
15:33
@rcabaco
bcab
what does "major cell" mean?
A sub-array of one lesser rank than the whole array. Matrices have vectors as major cells. Vectors have scalars as major cells.
@rcabaco That's a correct expression. But we want a function (and not {(⊂⍺)⌷⍵})
Thinking of ⌷ with ⍤ one less than the rank of the right argument
15:36
Use just and as we've done before.
@rcabaco That won't work, because each scalar on the left needs "access" to the entire array on the right, so it can select its target from it.
⎕←(⊂1 2){⍺⌷⍤0 (¯1+≢⍵)⊢⍵}3 4⍴⍳12
@rcabaco
1 2 3 4
5 6 7 8
on the right track?
Hm. Firstly, you forgot to remove
15:39
Secondly, you don't want to pair up indices with individual major cells, but rather with the whole array.
@rcabaco Think about how we addressed "the whole array" for the outer product.
⍤99
Right, so put it all together.
⎕←1 3{⍺⌷⍤0 99⊢⍵}3 4⍴⍳12
@rcabaco
1  2  3  4
9 10 11 12
⎕←2 3 1 2{⍺⌷⍤0 99⊢⍵}'abcdef'
15:43
@DyalogAPL Yoho!
@rcabaco That's correct. But you don't need to wrap it in a dfn.
i don't quite understand the difference between (¯1+≢) and 99 for the rank of the right argument
@rcabaco Firstly, you surely mean (¯1+≢⍴⍵).
Ah, does ⌷ work on major-cells?
Yes, i did.
@rcabaco It does, but (without nesting) only lets you get one cell at a time.
So (¯1+≢⍴⍵) would mean one less than the rank of the right argument.
What you want (and achieve with 99) is the full rank of
Yes, for the major-cell, which would cause ⌷ to go to the major-cell of that
15:46
Yes, but you don't want to index into each major cell.
Correct, hence the ⍤99
You could have used ⍺⌷⍤0(≢⍴⍵)⊢⍵ but ⍤0 99 is easier.
I was not thinking of how ⌷ accesses the right argument.
That said. It is actually fairly common to want the target rank to be dependent on the argument rank.
For that purpose, allows you to specify a negative number, which means that the target rank is that number subtracted from the argument rank.
So f⍤¯1 ¯2 is the same as {⍺ f⍤(¯1+≢⍴⍺)(¯2+≢⍴⍵)⊢⍵}
You can also mix-and-match positive and negative ranks.
Unfortunately, 0=¯0 so you can't select the entire array with ⍤¯0
I wouldn't even think of it!
15:51
Instead, we have to use ⍤99 until gets added to the language.
@Adám - Good to hear, concerning Linux "exe" generation. A question to relay back to your CTO: Is cross-generation going to be considered, as well (e.g., use WinDyalog to generate Linux "exe", or use LinuxDyalog to generate WinEXE)?
@JeffZeitlin I can ask, but I don't even know if that's technically doable. Doesn't compilation usually have to happen on the target platform?
@Adám Thank you for the lesson!
@rcabaco No problem. If that last part about negative ranks is clear, then I guess we're done.
@Adám - Not at all - the key is that the compiler needs to know the relevant instruction set, calling conventions, et cetera of the target system - quite often, the first compiler or assembler for a new system architecture is done on a different system.
15:56
@Adám In theory I think it is.
@Adám I've been lurking but not following (unfortunately too busy with work this week). I plan to reread this, though, as it looks super useful- I don't have a great understanding of rank. Thanks for covering this.
 
6 hours later…
22:17
@Adám lesson being applied:
ls←#lines resp ⋄ ls/⍨⍤1⊢(⊂'LOGIN')(⊂'*')(⊃⍷)¨⍤0 99⊢ls
Would never have thought of using rank without the lesson. Thank you.
 
1 hour later…
23:30
Somehow, apparently someone else was also working on that 3-year-5-month-old challenge and posted a new winning solution just before I did, but I win anyway.

« first day (1086 days earlier)      last day (1865 days later) »