-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Editorial: new algorithm convention for return-if-abrupt #129
Conversation
Quick first pass:
|
Thank you! Will fix these issues! On the syntax, I went with no space as its the style for unary operators, but I think Andreas prefers the space as well so maybe others do too? I don't know about auto-linking ? to its definition... there are so many of them. Just read your algorithm conventions :-P |
Also, fwiw, the nested cases today don't RIA for intermediate values. In some cases, the inner operation can't fail. In other cases, the outer function passes through aburpt completion values. In still other cases, the implicit conversion of completion records to values is used. I think it's ok to move these all to explicit RIA though. |
A couple of step notes probably need to be updated, too. |
@anba you are probably right :/ Any idea of a good way to find these other than manually? FWIW, here's my list of ops that can't throw and so will never be prefixed with ?:
Adding to this list will likely result in a better conversion. |
Pushed a new commit that should address all @ljharb's issues. Now to figure out how to update step references :-P. Maybe step references should be generated somehow similar to other cross-refs. |
I only count 35 <emu-note> which contain "step", so manual updates should be doable. Pattern |
Yes, please! |
Anba, there are normative step references as well. Also some steps use the "NOTE: " convention to add a note to steps. But I think manually is the only way sadly :( Will work on updating step references tonight or tomorrow. The problem with generating them is you have nothing to anchor the reference to without a number. Which means you might require some kind of tag at the referenced site, eg:
But I never could bring myself to do that because it's quite a bit of effort for authors. Perhaps the cost of using this convention is greater than just applying manual fixups occasionally? |
You could maybe use the text of the referenced step (or some distinct prefix of it) as the anchor. E.g.:
Then the referenced step doesn't need to have an id attached to it. |
That's a pretty good idea @jmdyck. I'll investigate. As long as steptext is unique it could be one character long even. Pretty nice :) |
Fixed step references. Now concerned about the following pattern:
Suspect I'd fix this incorrectly to
|
There were a few cases like that that I've fixed (for now by just not doing the conversion). Now back to wanting another review! :-D |
Issues:
Other questions/notes:
|
Hmm, I had text in 5.2 earlier but it seems to have been dropped somehow. But I think 5.2 is more appropriate than 6.2.2. Maybe both places could be argued :-P.
I'm not sure... I did this intentionally. In general, for these nested forms to work, the outer function has to pass through abrupt completions. IMO it is more clear to instead make the inner call RIA. Is this bad for reasons I'm not seeing?
Current spec text has RIA, so I'll leave it for now.
I think it's because this wasn't rebased?
For some reason the source text has a space here. This will have to be fixed manually later. Same is true for the typed array cases.
Sure :) Incremental improvements are the name of this game!
I was planning on going through every explicit RIA call and fixing it if necessary...
Probably. It's kind of confusing as-is.
I think we can use the calling convention "Perform ?Compute()" which is used in a few places (minus the ? of course). |
I guess this depends on how |
See how you feel after reading the copy I added to 5.2? :) |
So far looking at the diff everything looks great to me. fwiw, I still think it looks better with |
Regarding readability, If all |
Sure - I'd be fine with linking, bolding, or adding the space - I prefer linking but anything imo is better than visually running the ? into the abstract operation name. |
I believe I have addressed all outstanding feedback in this thread (including adding the space!). I'm going to pull this in today. Any further issues can be raised of course :) |
Committed as 9c1e076! 🎆 |
This replaces occurrences of the pattern:
with
There is also some new prose in Algorithm Conventions I imagine we can nitpick significantly :)