As title says, I don't understand why f^:proposition^:_ y is a while loop. I have actually used it a couple times, but I don't understand how it works. I get that ^: repeats functions, but I'm confused by its double use in that statement.
I also can't understand why f^:proposition^:a: y works. This is the same as the previous one but returns the values from all the iterations, instead of only the last one as did the one above.
a: is an empty box and I get that has a special meaning used with ^: but even after having looked into the dictionary I couldn't understand it.
Thanks.
f^:proposition^:_is not a while loop. It's (almost) a while loop whenpropositionreturns1or0. It's some strange kind of while loop whenpropositionreturns other results.Let's take a simple monadic case.
This is what's happening: every time that
v yis1,(f^:1) yis executed. The result of(f^:1) yis the newyand so on.ystays the same for two times in a row → outputyand stop.v yis0→ outputyand stop.So
f^:v^:_here, works likedouble while less than 20 (or until the result doesn't change)Let's see what happens when
vreturns2/0instead of1/0.You can have many kinds of "strange" loops by playing with
v. (It can even return negative integers, to use the inverse off).