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

Statements as expression #322

Open
giann opened this issue Jan 29, 2025 · 0 comments
Open

Statements as expression #322

giann opened this issue Jan 29, 2025 · 0 comments
Labels
language Issue related to the language proposal Something we consider doing
Milestone

Comments

@giann
Copy link
Collaborator

giann commented Jan 29, 2025

When a block expression has a single statement, the block syntax should be omittable:

final result = from {
    foreach (el in list) {
        if (el.isOk()) {
            out el;
        }
    }
};

becomes

final result = foreach (el in list) {
    if (el.isOk()) {
        out el;
    }
};
@giann giann added language Issue related to the language proposal Something we consider doing labels Jan 29, 2025
@giann giann added this to the 0.6.0 milestone Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language Issue related to the language proposal Something we consider doing
Projects
None yet
Development

No branches or pull requests

1 participant