« first day (1837 days earlier)      last day (824 days later) » 

6:18 PM
anyone know why the 2nd expression isn't the train-ified version of the 1st expression?
```
(≠1 2 3 3 2 4) / 1 2 3 3 2 4
1 2 3 4
(≠/⊢) 1 2 3 3 2 4
0
```
ah, this works which gives a hint as to why...
```
(⊂∘≠/⊂∘⊢) 1 2 3 3 2 4
┌───────────┐
│1 2 3 3 2 4│
└───────────┘
```
 
@justin2004 because / there is interpreted as an operator, i.e. ((≠/)⊢), aka not-equals reduce
you want (≠⊢⍤/⊢) 1 2 3 3 2 4
 
6:35 PM
@dz
@dzaima thank you
"ah, this works which gives a hint as to why..." ops, that was wrong. ignore that plx.
 
@xpqz Would radii[i]←{r>i:radii[(2×c)-i]⌊r-i⋄0}⍬ work as radii[i]←(r>i)×radii[(2×c)-i]⌊r-i?
@BrianBED Notice the word "or". Either use a multiline blick as you've been doing, or use backticks. Not both.
 
@Adám ahhhhh ahhhhhhhh
 
@justin2004 Triple backticks don't work here. Pressing Ctrl+k (which adds four leading spaces to each line) works.
@justin2004 You can edit your messages for two minutes by pressing UpArrow.
 
6:57 PM
@Adám I believe it would. I’ll try it. It looks slightly less Algol now.
 
@xpqz Anything preventing S[(i-1)-i⊃radii]=S[i+1+i⊃radii] from becoming =/S[i(+,-)1+i⊃radii]?
Also, why do you need the trap?
 
Index errors. The trap saves me the two :AndIfs
 
-{⍺+⍳1+⍵-⍺}+ can be +(⊢+∘⍳1+-)-
@xpqz Then you should use 3, not 0, for clarity.
 
The :trap thing is so much more flexible than error guards in dfns
@Adám yes that was lazy
 
Someone is learning to appreciate tradfns…
 
7:08 PM
Doublethink :). Ignorance is strength, war is peace, tradfns are good...
 
No, really. It’s a nice way to get practical, boring stuff done.
Maybe I can be a proper APL programmer yet.
 
Well, control flow is important, and tradfns have more powerful features beyond usual imperative structures, anyway. Still, I prefer not to use them, otherwise we're saying APL isn't practical, no?
 
I find them visually a bit jarring, but Morten keeps saying that’s by design.
@FawnLocke I’ve rewritten some fairly complex python utility code I use daily as apl user commands, nothing algorithmically taxing, just a lot of if this then that. Doing that as dfns would have been a pain with little gain
 
Yes, I'll admit they're helpful and occasionally a better choice. I simply think they're a tad overused, historically and measurably most APL code is tradfns, and I can't help but think they could've been designed better
Perhaps my perspective is wrong though, imperative control structures with APL's brevity might be the preference for people wanting easy development cycles
 
I think that the by-far worst design mistake of tradfns, isn't even part of the actual tradfn syntax. APL\360 used to switch between immediate execution mode and function definition mode. If instead it had used to switch from immediate execution to definition mode, and for the reverse switch, it would have given an obvious way to nest functions.
 
7:27 PM
Continuing for my last message, to mean that people don't necessarily care about proving that APL as we think of it is practical, they simply want problems solved easily - and I can respect that
@Adám I see, well I'll trust your opinion
@xpqz I'm curious about this, does that mean tradfns are seen as "sinful", why else would separating tradfns from "apl as we think of it" be by design
 
@FawnLocke No, it is just thinking of "APL" as referring to the core language consisting of glyphs and user definition using those. The :keywords are "plumbing" to make sure execution goes to the right places. April aims at something similar, using CL for the overall structure, with core APL for computation.
 
@FawnLocke the way it was explained to me is that it gives a clean visual separation between flow and “array magic”
 
Thanks both
 
7:57 PM
@Adám Turns out it can't be done as a multiplication after all; the dfn I had relies on the body not being evaluated for the 0 case, thus avoiding an index error.
 
I see. But you're just (ab)using a dfn as an if statement, well, a ternary.
 
@LdBeth Very cool, mind if I use that code elsewhere?
 
@phantomics You can use that anywhere u like, I'll add a permissive license to that gist.
 
@LdBeth Appreciate it, also I could write an extension for making .pngs and .gifs to put in the chat if students would like that
There could be a system where you enter an RGB color palette, then build a matrix of indices of those colors that gets turned into an image
 
I have been working on that in APL :)
 
8:11 PM
@FawnLocke How are you outputting the images? Does Dyalog have an extension to handle those types or are you implementing the format in APL with direct file output?
 
I'm implementing it myself, although there are a few repositories that contain similar code, see: bmprenderer
I think APL is uniquely good at this, although it doesn't stop some formats from being quite complicated :)
 
@Adám so APL substitutes for a better numpy here?
 
I guess.
 
or matlab
 
@phantomics @FawnLocke You can throw image files straight at HTMLRenderer (for RIDE: and/or 3500⌶).
 
8:21 PM
Oh awesome!
 
Oh, yes, RIDE is just a web browser
 
@user92109 Hi jitzu76. If you want to participate here, please email access@apl.chat
 
@Adám Looking at the HTMLRenderer docs I don't see that, is there a mode where you input an array of RGB values and get an image back? The CL library I use takes a height×width×3 array of ints and produces a .png, or a vector of such to produce a .gif animation
 
@phantomics No, it is simply a Chromium browser. You could either give it a .png or a .gif etc, or give it raw image data embedded as HTML.
 
@Adám I see, I was asking about the way that those image formats are directly generated from APL, sounds like the bmprenderer will do it
 
8:31 PM
On Windows, the Bitmap GUI object has MakePNG and MakeGIF methods…
 
Or maybe with dotNET on non windows platforms
 
@Adám yeah I was just trying to get it as short as possible
 
@FawnLocke Maybe <canvas> could simplify matters.
 
Good idea
Random question, for a theoretical APL is getting rid of function/array operand overloads a bad idea. I.e f⍤g being atop and f⍤Y being rank. Stencil would probably need to change too
 
Not sure what's with Stencil, but yes, there could be value in having a function operand compute the corresponding array operand based on the argument(s). BQN does in fact do this.
 
8:46 PM
Stencil being special because it takes a function and an array as operands without being overloaded.

And I see, thanks
 
was like that until recently too.
You could also look at it conversely: array operands are treated as constant functions. I advocated for this to be the case in the left operand of Commute, Rank, Atop, Each, and Over. Only Commute was accepted.
 
Oh, interesting
I could see value in Atop being like that. Not so much Rank or Each though
 
for those it's useful for filling rows/cells/items with a constant element
a shorter (≢x)⍴⊂v
 
Yeah, s⍴⍨⍴A is fairly common and can now be written as s⍨¨A but not s¨A
 
Yeah, okay
 
8:53 PM
@dzaima (⍴x) even.
 
@Adám too used to not using :P
 
I figured.
@FawnLocke Atop and Over are special, as they'd process the argument(s) first, and then replace the entire result with a constant. How would you use that?
 
Nothing substantial comes to mind
What were your thoughts when you suggested them? X⍥g seems questionable if f⍥Y is intended to be depth
 
I might actually misremember. On further thought, I think I only suggested it for Commute, Each, Rank, and Depth.
 
Ah okay
 
9:07 PM
(Probably confused myself by the sharing of glyphs for Atop/Rank and Over/Depth)
 
Yeah, no worries
 

« first day (1837 days earlier)      last day (824 days later) »