Blazebit / blaze-expression

Apache License 2.0
5 stars 6 forks source link

Support let syntax for better reuse and readability #31

Open beikov opened 3 years ago

beikov commented 3 years ago

Not sure how important this is, but for bigger expressions it might make sense to use some kind of let expression syntax to avoid duplication/improve readability. I propose a syntax like the following:

let a = 1 + 1,
    b = a / 10,
    c = 20
in
    a * c

Implementation-wise, the use of let expressions will make no difference. I even propose that we implement this as parse time expansion.