« first day (1609 days earlier)      last day (1046 days later) » 
00:00 - 21:0021:00 - 22:00

9:00 PM
i'm still having trouble understanding this
i'll try to explain how i think it works first
so if it's called monadically, {⍵ ⋄ ⍺⍺} mentions ⍺⍺ which forces it to become monadic, and so (⍵⍵ {⍵ ⋄ ⍺⍺}) ⍺⍺ (⍵⍵ ⍵) calls ⍵⍵ ⍵ and then ⍺⍺ on that, and then calls (⍵⍵ {⍵ ⋄ ⍺⍺}) on that?
 
@hyper-neutrino Yes, that's entirely correct. And (⍵⍵ {⍵ ⋄ ⍺⍺}) is a derived function that is 100% equivalent to
 
ah, okay. i think that's where i'm confused - it looks like it'd call {⍵ ⋄ ⍺⍺} (which from what i understand, since the first statement isn't an assignment/guard/error guard, is like {⍵} or ), and then call ⍵⍵ on the result of that, but that's not what's happening
ah wait, no, that's not how it works
 
No, because the mention of ⍵⍵ inside that brace causes the entity it represents to be a monadic operator, which then "consumes" ⍵⍵ as its operand.
 
(⍵⍵ {⍵ ⋄ ⍺⍺}) has ⍵⍵ as the left function to the operator {⍵ ⋄ ⍺⍺}, which ignores the left function and just returns ?
 
Yes.
 
9:07 PM
ooh, okay, this all makes sense now. thank you very much :)
 
No problem. Note that this is a very extreme usage of the system. You rarely see code like that.
Setting to or a default value is more common.
 
ah, okay
 
You could write monadic power operator which uses its left argument as iteration count instead of the right operand, and then defaults to "fixpoint" (f⍣≡) if used monadically:
{⍺←≡ ⋄ ⍺⍺⍣⍺⊢⍵}
 
oh cool, that makes sense
why does ⍣≡ do fixed point, by the way? is that a special case?
 
No, the definition of f⍣g is "apply f until two successive iterations give try when their results are given as arguments to g
So sometimes, the main body of the code is in g, checking if we've iterated enough.
 
9:15 PM
wait, so is ⍣x for some number the special case then?
 
It can even be interactive:
      2×⍣{⍞←'New value is ',(⍕⍺),'. Enough? ' ⋄ 'y'∊⍞}3
New value is 6. Enough? n
New value is 12. Enough? n
New value is 24. Enough? n
New value is 48. Enough? y
48
@hyper-neutrino No, f⍣n is "apply f n times".
You could look at f⍣g and f⍣n as two unrelated operators sharing a symbol if you wanted.
 
oh, okay
 
Any operand can be either a function or an array, but not all cases are necessarily defined.
(In fact, I think @ is the only one where all 4 combos are defined.)
 
oh, i see.
 
And then the derived function can in turn be used either monadically or dyadically.
 
9:18 PM
@Adám sorry, just realized this - is "try" a typo, or am i reading it toally incorrectly? i'm not sure i understand the explanation for this part
 
@hyper-neutrino Should say "give true"
@AndyAquino Welcome back.
So every monadic operator in principle can derive 4 functions, while every dyadic operator can derive 8.
 
okay thanks. so, it's basically call f on x until f(x) ≡ x?
 
Yes.
 
okay. this makes a lot more sense now - the first time I looked at that, I thought meant depth, and forgot to consider the dyadic case :p
 
      +∘÷⍣=⍨1
1.618033989
This is 1+∘÷1+∘÷1+∘÷1… which is 1+(1÷(1+1÷(1+1÷(1+… which is φ
 
9:24 PM
how does work; f∘g x is f g x and x f∘g y is x f (g y) ?
 
Yes, that's it. That's why it is called "beside" because it acts as if f and g where simply written besides each other.
x f (g y) is the same as x f g y
 
makes sense :p okay thanks
I wish i'd discovered ( / gotten interested in) APL earlier like in high school when i'd have more time to learn it lol
 
:-)
So allows the TMN (Traditional Mathematical Notation) construct (f∘g)(x) which is f(g(x)) to be written as… wait for it… (f∘g)(x)
I really like the symmetry of this with how trains allow the TMN construct (f+g)(x) which is f(x)+g(x) to be written as… well… (f+g)(x)
 
yeah one thing i like about APL is that a lot of its notation seems to be very understandable if you know the math notation for the same thing :P
 
Iverson was a mathematician, not a computer scientist.
 
9:30 PM
i'm not too familiar/comfortable with it yet because... well, my experience with tacit coding is Jelly which of course has a drastically different design philosophy
 
Well, this almost all there is to trains.
The only things missing are 1) if a train is used dyadically, then where you'd have f and g applied on the single argument before, you now gain a left argument. 2) if there's an even number of functions in the train, the leftmost one is applied monadically on the result of the rest of the train.
 
this reminds me of Risky, but actually practical :P
 
(Oh, and then everything groups from the right, but that's pretty obvious in an APL context.)
 
(yeah, realizing that APL is RTL made everything make a lot more sense)
 
So (f×g+h)(x) is f(x)×(g(x)+h(x))
In hind sight, I'm not sure if RTL was the best choice, but it does generally allow a syntax that is closer to TMN.
 
9:36 PM
what is x (f×g+h) y then - (x f y) × ((x g y) + (x h y)) would be my guess but i'm not convinced that makes any sense
 
@hyper-neutrino That is exactly right.
 
huh \o/ cool
 
And x (-f×g+h) y would be - ((x f y) × ((x g y) + (x h y)))
So you can see that the even-length trains are kind of like having ⍺←⊢
 
okay. so basically, if the train is even length, apply the first one monadically to the result of the rest, if it's a single element, apply it to the argument(s), and otherwise, apply the second-to-left function on the result of the first function applied to the argument(s) and the result of the remainder?
 
"second-to-left"?
 
9:39 PM
sorry that should be second from left shouldn't it
 
Oh.
"single element"?
 
i guess it would be clearer to say - x (f + g...) y (where g... also has odd length of course) is the same as (x f y) + (result of g... on x and y) and (f + g...) y is (f y) + (result of g... on y)
 
Yes, much clearer.
 
@Adám sorry i think i picked that terminology up from vyxal, lol. meant to say if the train just has a single function, but then it isn't really much of a train anymore, is it
 
There's no difference between a 1-train and the function it consists of. Call it a train if you like :-)
 
9:41 PM
lol, okay :D
anyway, thanks for all the help :) i think this all more or less makes sense to me now. i've gotta go for now, thanks
 
No worries. I love teaching APL. And perfect timing for me to head to bed. ○/
 
00:00 - 21:0021:00 - 22:00

« first day (1609 days earlier)      last day (1046 days later) »