Maybe I’m being nit-picky, but I’m going to play devil’s advocate. My stated intention is to ensure we’re not bloating the language.
As far as I can tell you can already do this W script:
W LT P.L 44: P.PUSH 7
with this one using L:
L 44 P.L: P.PUSH 7
or this IF centered script. Using recursion
IF LT P.L 44: P.PUSH 7
IF LT P.L 44: SCRIPT THIS
furthermore, you can do it as a Do…While as well:
P.PUSH 7
IF LT P.L 44: SCRIPT THIS
//
Ok, here’s another example. We want to do an action on the falling edge of a trigger:
W NZ STATE THIS: 1 // just waiting
<cmd> // happens on trigger low
Problem here is that we don’t really know how long 10,000 cycles will take, so you have to hope / assume your trigger is high for relatively short amount of time. This isn’t a multi-threaded system, so it will stop anything else in teletype from happening too.
Thus we’re still better off putting a condition check in the M script if we care about falling edges of triggers.
//
I’ve lost track of where I was going (Sorry, I’m under the weather rn), but I’d love to see examples where W is better than what we’ve already got. Sure the first example might be shorter, but if it’s only a rare use-case, I’d prefer to keep the language simpler. Obviously I’m just one person, but feel the need to throw this critique into the ring.
//
PS.
THIS is fantastic! Particularly great for example scripts & copy-paste-ing scripts.
I know there’s a limit to script recursion right now. Why is this? Are we really going to stack overflow with more than 8(?) recursive calls? If it’s more a don’t-let-the-user-do-something-silly protection, then should we consider setting the same limit for W!?