-
Notifications
You must be signed in to change notification settings - Fork 356
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 a proposal for supporting non-local break
and continue
inside inline lambdas
#327
Conversation
Co-authored with @nikitabobko |
with `noinline` and `crossinline`. | ||
|
||
Non-local `break` and `continue` could be emulated using non-local return statements. | ||
For example, the following code snippets should be equivalent with respect to DFA: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the following code snippets should be equivalent with respect to DFA
Same here. KEEP document must not contain such phrases. Someone should check that the DFA is equivalent for both cases and write his/her investigation details into the document
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we don't need this section at all. It relies on the semantic of run
which seems to be less fundamental than the feature proposed (and this is not the only way to emulate non-local break/continue).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@strangepleasures sorry, I don't understand what you mean. I don't understand why this section relies on the semantic of run
. run
is just used because it's the most canonical way to invoke a lambda.
My point is different: I want that we really don't forget to check that the implementation is identical. And once we check it, we should mention it in the KEEP document. So the phrase "the following code snippets should be equivalent with respect to DFA" will turn into "in the current implementation the following code snippets is equivalent with respect to DFA"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nikitabobko but WHY do we need to check that in the first place? To me, this equivalence is just a fun fact, not a requirement. We could have also provided a semantically equivalent program written in different language, but what for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but WHY do we need to check that in the first place?
We need to check it to try to find potential bugs we have in the current implementation. It's just one more check. What is the point of "it should work like that" phrase in a KEEP document if, in reality, it doesn't work "like that"? Let's please really make sure that it "works like that"
"it works like that" phrase (without "should"), gives one more invariant about the language.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General comments:
- Please, run the whole text though Grazie. There are tons of obvious grammatical errors that should have been automatically detected.
- Mass-replace "loop-like" (in quotes) with loop-like without quotes for style issues.
88f62d6
to
bf57d64
Compare
No description provided.