buzz icon indicating copy to clipboard operation
buzz copied to clipboard

Statements as expression

Open giann opened this issue 11 months ago • 0 comments

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 avatar Jan 29 '25 05:01 giann