AndreVanDelft / scala

The SubScript extension to the Scala programming language
http://www.subscript-lang.org/
12 stars 1 forks source link

Add "let" construct #72

Closed AndreVanDelft closed 8 years ago

AndreVanDelft commented 9 years ago

Next to val and var declarations, we could have "let" constructs:

  let a = b + 9

This would be equivalent to

{a = b + 9}

i.e. a tiny code fragment (proposed new syntax {}) doing the assignment. This has 2 benefits: less parentheses-like symbols (i.c. braces), and good alignment with val and var declarations.