Allows to define and assigne element with the binding. It is mainly a shortcut to unstack element into variable (or constant if we are defining it)
// Name binding definition
var *{a, b: .c as int, left: ...} = Structure
// Order binding definition
var *[a, b, c, _, left...] = Structure
// assignment
*{a, b: .c} = Structure
name binding also works on const+ map[string]T for key that can be identifier
const+ dict = [
"test": 42,
"42": 18,
]
*{test, left: ...} = dict // left is struct{} since "42" is not an identifier
For order binding on array, the element are optional if the length is not known at compile time
var arr1 []int, arr2 [...]int, arr3 [4]int
arr1 = [1, 2, 3, 4] // ok
arr2 = [1, 2, 3, 4] // ok
arr3 = [1, 2, 3, 4] // ok
*[a, b, c, d] = arr1 // ok, a, b, c, d are int?
*[a, b, c, d] = arr2 // same
*[a, b, c, d] = arr3 // ok, a, b, c, d are int
*[a, b, c, d, e] = arr3 // compile error: too much element
*[a!, b!, c!, d!] = arr1 // ok, now a, b, c, d are int, but the app may crash