Skip to content
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

Add and explain usage of "abort these steps" #255

Closed
wants to merge 1 commit into from

Conversation

domenic
Copy link
Member

@domenic domenic commented Jun 14, 2019

Related to #206. Stems from WICG/portals#138 (comment).

/cc @jeremyroman


Preview | Diff

@annevk
Copy link
Member

annevk commented Jun 16, 2019

The example is a bit unclear to me as none of the terms are defined. Is "ask your partner" an algorithm? Could you use this inline, e.g., "Run these steps:" and then "abort these steps" would not terminate the outer set of steps? I'm not sure that matches all existing usage.

@GPHemsley
Copy link
Member

GPHemsley commented Jun 26, 2019

Indeed, "ask your partner" implies passing information in one direction, but there is no subsequent step passing information back in the other direction. How do you know when your partner is done? Or whether they were even successful in completing the steps? (That is, what happens if they abort the steps, as requested?)

And then later on, the main list of steps mentions batter, but that is undefined. Was the partner making the batter? Should we check to make sure the batter is ready before we pour it into the pan?

And as this is the algorithm to "bake a cake", if at any point we "return" or "abort these steps", we have not baked a cake, which seems like a Bad Thing™.

More broadly, an algorithm is a set of steps. Just because you sometimes pass a set of steps into another set of steps doesn't make either set of steps any less of an algorithm. So you might want to differentiate between an intentionally-incomplete set of steps (like some sort of mix-in or partial function) from a nested-but-complete set of steps (like a direct function call or a callback argument), and then the language of how to exit the set of steps (either prematurely or at the end) might fall out from that (I hope).

@domenic
Copy link
Member Author

domenic commented Jun 27, 2019

I'm discouraged by how this example isn't as clear as I thought, and will not really have time to pursue this further. (It was supposed to be "I have a couple hours free and I'd like to work on something simple"). As such I'll close this PR and let others who have stronger opinions about baking cakes and partners and such work on this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants