You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! Is it intended that continue (X.) goes to the next iteration without checking the stack?
The manual says "the loop proceeds with the next iteration, if any" - the "if any" part makes it sound like it should check the stack like the loop usually does, and go the next iteration only if it's truthy. That's the behaviour I'd expect from other languages too - continue means skip the rest of the loop, but do check the loop condition again. It seems like that's not the behaviour in MATL, from some testing:
Thank you for catching this! Yes, it should be fixed. I think I know what I need to change in the compiler to achieve the desired behaviour, but I don't have the time now. I'll do it within the next few days. This affects both "while" and "do while" loops
Hi! Is it intended that continue (
X.
) goes to the next iteration without checking the stack?The manual says "the loop proceeds with the next iteration, if any" - the "if any" part makes it sound like it should check the stack like the loop usually does, and go the next iteration only if it's truthy. That's the behaviour I'd expect from other languages too -
continue
means skip the rest of the loop, but do check the loop condition again. It seems like that's not the behaviour in MATL, from some testing:Without continue
With continue at the end of loop
(output goes on indefinitely, loop doesn't terminate)
The text was updated successfully, but these errors were encountered: