The Road to Name-Based Destructuring (opens in new tab)
TL;DR New “val inside parentheses” syntax is being introduced to allow for name-based destructuring. Additionally, new syntax with square brackets is being introduced for positional destructuring. Both are currently Experimental (enabled using the -Xname-based-destructuring=only-syntax compiler argument) and will become Stable in a future release. In the distant future, the behavior of the “val outside parentheses” […]
Read the original article