-
Notifications
You must be signed in to change notification settings - Fork 101
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
"do while" loops #567
Comments
We could certainly add them. In the meantime I think you should feel free to use them in specs: the intent is pretty clear to any reader, and in general Infra is not meant to be a restriction on what you write, just a standard library so that if multiple people are writing the same thing, they do so the same way. The spec-ese wording is a bit unclear to me: if you just wrote:
the nature of English makes me think that this might just be a fancy way of writing
So maybe something like
would be sufficiently clear. I should also mention you can replace any do-while loop with a while loop, using a construct like
which may be why languages like Python and Ruby don't have them. |
https://stackoverflow.com/q/994905 is somewhat relevant. |
I find "do while" loops a bit confusing so I'd prefer the explicit construct around "while", but I guess I could get used to them if they are defined and "Do" is xref'd. |
@annevk , what'd you think of my more verbose phrasing ("...at least once... And keep performing them...") |
Yeah, fair. Nit: s/the following/these/ and s/perform/run/ unless we want to switch everything from run to perform... |
The current infra spec says you can have "while" and "for each" loops, but there are no "do while" loops: https://infra.spec.whatwg.org/#algorithm-iteration
I am trying to spec something that uses a "do while" loop, can we add do while loops here? Or is there another way to spec these?
@annevk @domenic
The text was updated successfully, but these errors were encountered: