-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Abort when" vs "abort these steps" #258
Comments
No solutions, but... See #255 for my attempt at clarifying when "abort these steps" makes sense, although it's a bit stalled. "Break when" might be confusing if used inside an actual loop where "break" is defined by Infra to mean something already. |
"Break" could be redefined: Within an iteration, "break" will skip over any remaining steps in an iteration, and skip over any remaining items as well, stopping the iteration. Within any other block of steps, "break" will skip the remaining steps. This feels similar to how it behaves in JavaScript. Maybe we have a better definition of "block of steps". I mean the direct children of the |
Isn't an "abort when" block really just a hidden loop wherein you're evaluating whether the abort condition is met in between the steps of the algorithm you're executing? (The comment suggests that the check needn't be between steps, but it has a caveat that the abort cannot happen when a value is mutated; in the example, the calculation and the mutation are really two separate steps artificially combined by "and", so I call shenanigans on that.) Separately, throwing some more possible terms out there to get the juices flowing: |
Yep. But if the condition becomes true, it only skips the rest of its inner steps, which is different to "abort these steps", which cancels the whole synchronously executing algorithm. |
Since Domenic closed PR #255, let me copy my comment here:
|
Yeah, like a block vs a function in JS. |
Hmm, another term that just came to mind: |
It feels like these definitions clash.
"Abort these steps" is more like
return
, but can be used when in parallel."Abort when" is more like
break
.I'm not sure what the best solution is here. Either:
Replace "abort these steps" with "return". This might be confusing when in parallel. Will it be clear that "return" only ends the in parallel steps?
Replace "abort when" with "break when". This feels like it fits the behavior more accurately, as steps following the "abort when" block will run after breaking.
The text was updated successfully, but these errors were encountered: