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

Consider adding ability to return values from break in while loop #28

Open
GoogleCodeExporter opened this issue May 30, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

This is an idea we still want to review and is not necessarily something we 
really want to add to NL.

We could add a feature where instead of a while loop always returning void, if 
there is at least one break that contains a thunk of code, e.g., break("abc"), 
then the whole while loop becomes typed to the type of the code thunk (and any 
other breaks which contain code thunks will have to be of the same type, if 
some other break is empty, the code thunk is implicitly the default value of 
the type of the while loop expression). The thunk would not be evaluated 
unless/until after the while loop condition evaluates to false, at which point 
the thunk is evaluated and returned.

Original issue reported on code.google.com by [email protected] on 26 Nov 2011 at 2:12

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

No branches or pull requests

1 participant