« first day (922 days earlier)      last day (1740 days later) » 

4:17 AM
I'm struggling to define a lambda to work over n-wise reduce. I'm looking to have a window of 3 elements which reduces over an input array and return the minimum of (left - middle),(right-middle). Something like 3{(⍺-⊃⍵)⌊((⊃⌽⍵)-⊃⍵)}/0,a,0
I can't seem to figure out how to work with n-wise reduce with 3 elements.
 
@eyepatch 3 f/arrOf3Elements is always gonna be equal to f/arr, so i don't quite understand what you want to do
 
⎕←3,/0 9 6 1 6 2 0
Returns the window, instead of a window, I want to apply a lambda. I suppose I can always apply afterwards.
 
@eyepatch
SYNTAX ERROR
 
@eyepatch yeah, n-wise reduce reduces the window by f, at no point do you see an n-element list unless you specifically make it
⎕←3⊢/1 2 3 4 5 6
 
@dzaima
3 4 5 6
 
4:32 AM
⎕←3⊣/1 2 3 4 5 6
 
@eyepatch
1 2 3 4
 
Where did my 2 3 4 5 go?
 
to explain in another way, 3 f/A B C D E is equal to (A f B f C) (B f C f D) (C f D f E)
 
in any case: {x y z←⍵⋄(x-y)⌊(z-y)}¨3,/0 9 6 1 6 2 0 works, but seems a little unnecessary.
Oh. That's helpful.
I didn't get that before.
 
@eyepatch yeah, i've wanted some built-in for f¨N,/ many times before
 
4:35 AM
That seems the natural definition of 3 f/A B C D E
Also tremendously useful in the domain.
 
agreed
hmm, i could make n f\ be f¨n,/ in my APL
@eyepatch oh, {x y z←⍵⋄(x-y)⌊(z-y)} ↓⍉↑3,/ A is like 20x faster and more APLy
now i want n f\ to be ↓⍉↑n f/ :|
 
4:57 AM
Sure. That makes sense.
I was playing around with solving HackerRank problems in APL and then translating to C++.
 
@dzaima actually no, that doesn't make sense, what I want is to have n someSymbol A to be ↓⍉↑ n,/ - no operator
 
@eyepatch If you want to access the actual windows, use f⌺3 but beware that the first and last application of f will have "shards" (the first/last 2 elements padded to 3)
 
I was doing padding myself. :)
 
⎕←{⊂⍵}⌺3⊢1 2 3 4 5 6
 
@Adám
┌─────┬─────┬─────┬─────┬─────┬─────┐
│0 1 2│1 2 3│2 3 4│3 4 5│4 5 6│5 6 0│
└─────┴─────┴─────┴─────┴─────┴─────┘
 
5:07 AM
@Adám and also beware that even with padding allowing the following to work just fine, f⌺3 ⊢ 1 2 errors.
 
@dzaima That was a bug that has been fixed in 17.1, due very soon.
(I still think that an even shorter should be allowed, and that it should just error if trying to access in such a case.)
 
@Adám so e.g. ({⊂⍵}⌺3) ,1 would be ⊂0 1 0?
 
@dzaima Yes. And {⊂⍵}⌺3⊢⍬ would be 0⍴⊂0 0 0
 
ngn
@eyepatch that's 2⌊∘-/2-/
 
@ngn slower than my faster one though
 
5:15 AM
@Quintec Welcome back! I guess APL is just very mnemonic.
 
ngn
@dzaima but simpler
 
Not sure it's quite right since it's the min(x-y,z-y)
 
@ngn i'd agree with "shorter", but imo it's overly complex & less understandable
 
Or rather, it's supposed to be that, but appears to be min(x-y,y-z) instead
 
@eyepatch the ∘- fixes that
 
 
4 hours later…
8:52 AM
@dzaima ∘- kind of looks like an eyepatch ○.∘-
 
 
5 hours later…
1:55 PM
@dzaima and why not an extra 9x faster
 
@dzaima using an extra ¨, even!
 
and why not another 40% less :D
 
Nice!
Cut them ¨s down
 
and why not a bit more, though now the texting starts to wary a lot
 
2:35 PM
{x y z←⍵⋄(x-y)⌊(z-y)}¨3,/ A is the Haskell version.
 
it's also the slowest.
 
@TorstenGrust Just for comparison, how does that look in Haskell?
 
and 3 {x y z←⍵⋄(x-y)⌊(z-y)}\ is the in-dev dzaima/APL version
 
@Adám map (\[x,y,z] -> min (x-y) (y-z)) . chunksOf 3
 
@TorstenGrust I see, yes, that looks similar. What does \ do?
 
2:46 PM
`\` is the lambda
 
@TorstenGrust haha, markdown is "awesome"
 
Urgh ;-)
 
@TorstenGrust \
 
Thanks, I'll make copies of this for future uses.
 
@TorstenGrust Uh, can you see my markdown? It is ``\``
 
2:49 PM
Thanks, I should know better. I create all of my lecture material and notes in Markdown. For years now.
In Markdeep, to be precise.
I can highly recommend taking a look at it.
 
@Adám another SE quirk is that the message history is available in the transcript (quickly openable with a shift-middle-click om the arrow on a message), which easily allows seeing markdown without even abusing the links!
 
This is practically all we use in my group to create written material.
 
@dzaima Ah, cool.
 
I also like the comprehension style: [ min (x-y) (y-z) | [x,y,z] <- chunksOf 3 A ]
 
@dzaima I don't seem to need Shift. However, I can click>"history" on other peoples msgs, but not on my own.
 
2:56 PM
{ e(x) | x ∊ X, p(x) } ≡ [ e x | x <- X, p x]
 
@Adám for me on chrome the shift immediately focuses the opened tab, whereas just middle-click makes me scroll to it
 
@dzaima Ah, for me too on FF.
 
@Adám about the 2nd part, what do you mean? unedited messages don't show history in live chat, and i can see history for every message in the transcript
 
@dzaima Oh, you're right. Never mind.
 
3:28 PM
Oh, looks like I'll travel to Denmark in September?!
 
@TorstenGrust You won?
 
It says "Phase II – Winning Professional Entrant" on the web page. I haven't heard anything yet, though.
 
@TorstenGrust I just asked the supreme judge. It is indeed so. Congratulations. See you there!
 
I am floored, really.
Thanks, @Adam.
 
@TorstenGrust ⌊Torsten! Congratulations!
 
3:34 PM
:-)
 
@J.Sallé ?
APL Riddle: 1+@3+⌊/¨2⍬⍬
 
@Adám He did say he was floor ed
 
@J.Sallé Oh, I totally missed that msg.
 
@Adám it was a bad joke anyways hahahahahahah
 
@J.Sallé Can you solve my riddle?
 
3:42 PM
@Adám I don't think so? All I can say is that ⌊/⍬ seems to yield the largest integer?
 
@J.Sallé Yes, "infinity".
 
"To infinity and beyond"
 
@TorstenGrust Yes. Nice.
 
Ah, I see now
That's very clever
 
@J.Sallé Wait, what? You only see now, after you figured it out‽
 
3:47 PM
@Adám I hadn't figured it out >.>
Delphi is currently consuming most of my ~soul~ attention
Ah I seem to have forgotten how markdown works, too
I blame Delphi
 
ngn
4:08 PM
@TorstenGrust grats! are you going to publish your solutions?
 
@ngn Are you going to publish yours? Btw, you could easily have won if you had not gotten so many minus points for readability and quality of comments ;-)
 
ngn
@Adám minus?! :P
 
@Adám Did he golf the comments as well? heheheheheh
 
ngn
@Adám well, a losing solution isn't as interesting for publishing, so no
@J.Sallé what is a comment? :)
 
@J.Sallé what comments?
 
4:17 PM
Comments were 0 bytes then, I guess >.>
 
@J.Sallé Do comments byte count include the s?
 
@Adám I don't know; are s considered comments by the interpreter?
 
@J.Sallé It has its own token type:
⎕←(3⌷⍤1⊢201⌶⍬)⌷⍨⊂(2⌷⍤1⊢201⌶⍬)⍳⊃200⌶,⊂'⍝c'
 
@Adám
┌─────────┬────────────┐
│SCOL_LAMP│MINI_COMMENT│
└─────────┴────────────┘
 
@J.Sallé in dzaima/APL comments weren't even a token, but now i've got a boolean to enable extra tokens so that it could be used for syntax highlighting too, in which case ⍝abc is a single token
 
4:29 PM
@dzaima Oh, I just asked the interpreter, and it also says ⍝abc is a single token. I guess it is only for syntax colouring purposes that it distinguishes the lamp and the text. CC:@J.Sallé Fair enough, I think.
 
@Adám Then I think lamps should be counted towards comment byte counts
 
@J.Sallé In either case, ngn's comment byte count is 0.
 
Hah
 
ngn
@Adám 0 comments, all of excellent quality :)
 
@ngn At least you had no typos in your comments and no descriptions of the code were wrong.
 
 
6 hours later…
11:02 PM
finally decided that dzaima/APL should be pulled so fancy stuff yay
 
@dzaima I think I get all but the last one. Dyadic is "apply"? And ` arrayifies a function?
 
May 24 at 9:03, by Adám
@Ven @dzaima Wouldn't it be neater to have `f mean the arrayified f and extend to allow an arrayified function as left argument (and in that case allow any right argument) so you can say (2⊃`f`g`h)⍎Y to do g Y
 
@dzaima Oh wow, that's a while ago.
 
was indeed. i had completely forgotten about it until i looked at the commit history :p
 
What am I going to do about APLcart when 18.0 comes out? I'll need to revise everything to consider using Over, Atop, and Constant…
@dzaima is not a synonym of .
 
11:10 PM
@Adám yeah, i'm lazy
@Adám huh, didn't know about A⍨, but it does seem pretty useful in trains
@dzaima introduces problems in SBCS too, as i don't want to waste a char for having 2 equal things, but that'd mean needing to complicate my encoding
 
@dzaima But you can handle Unicode, so only one edition needs to be in the SBCS.
@dzaima Absolutely. ⌈/*2⍨ is much easier on the eye than 2*⍨⌈/
 
@Adám this is my current encoder, and that doesn't support multiple chars mapping to the same thing
 
@dzaima So? Just don't handle one of them. Or maybe I'm not understanding the issue. Are you using SBCS internally?
 
@Adám does that mean that is gonna have to wait?
 
@dzaima Yes, and are probably for 19.0 as they have rather large internal implications.
 
11:16 PM
@Adám i could just make it error on encoding , but that's just not nice
 
@dzaima But hey, maybe if we do three at a time, we can get too. It makes tacit so much nicer too.
Maybe when we add ⍥k for Depth, we'll go all the way and add and A⍤k and A⍥k
I even think A⍢ should be allowed, so you can do A⍢⊃ instead of A@1
 
I think having over A⍨¨ isn't worth it. Although probably coudn't stand for much else
 
@H.PWiz For me, it is mostly a matter of consistency. I like the idea of arrays acting like functions that return themselves.
I intrigues me.
 
@H.PWiz stuff like instead of 0⍴⍨⍴ is cool though, and 0⍨¨ is way less obvious
 
Not to mention that if you have to write 0⍨¨ you might almost just write 0⊣¨ now.
 

« first day (922 days earlier)      last day (1740 days later) »