@AviF.S. just tested, the file i named definitely affects the Dyalog version of launching RIDE, can't really help other than try tracing where else could the configs be stored
@Adám Am curious in general if there are any other more APL-esque constructs for while/for structures without using the ∇WHILE-type constructs. They always struck me as not in the spirit...
I've often tried abusing the ⍣ operator, but as it's not meant for it, it usually doesn't work. Sometimes it does, but even then it's obscenely obfuscated
Of course, you don't have to write everything inline. You could use a separate function for the main processing.
In your left operand, you can of course place your done-condition at the top or at the bottom, or anywhere else.
But let's say instead that we don't want the condition to be based on the data processed. Rather, we want to periodically read an outside value to decide whether to continue or not.
You can try this in your local APL: done←0 ⋄ {⎕←⍵⊣⎕dl 5}⍣{done}&'work'
It will run in the background, printing "work" every 5 seconds.
Wait, the solution given before of {⊃⍣(1<|≡⍵)⊢⍵}⍣≡⊂⊂⊂⊂2 2⍴'ok' was a general case fix because ⊂ might not always have an inverse, you said. But in the end, it uses ⊃ anyway...
Other than this, it is actually much the same as with ⍣: Establish the stop condition with a guard (or a control structure in a tradfn), and do the work otherwise.
@RGS Dyalog looks ahead if the result will be used. This is also in effect for "shy" functions and assignments. Sometimes it will not even compute something if the result won't be used.
@AviF.S. should be under ~/.config/Ride-4.3/ or similar. you can find out the exact path by pressing f12 and typing D.el.app.getPath('userData') in the js console
No problem. Let's finish with an exercise: I assume you're all familiar with the Fibonacci sequence. Try implementing Fib n (which returns the nth Fibonacci number) using ⍣ and recursion.
If I wanted to recurse on a function that takes a left and a right argument, how could I do this "trick" of carrying the calculations down the recursion..?
Is there a better way to do that, aside from the closed form, which sort of ruins the recursive point? And aside from the matrix version, which is more APL-esque but less... well, maybe I'm just being lazy
@Adám But that is because you took the example to be the Lucas numbers, which follow the same "add the previous two" pattern of Fibonacci and you abstracted away the seed