Destructuring assignment
Destructuring assignment allows to define multiple variables for each element of an array or map.
For arrays, value is assigned to variable:
arr = ["a", "b", "c"]
extract(var1, var2, var3) = arr
print var1 // a
print var2 // b
print var3 // c
Which is equivalent to:
arr = ["a", "b", "c"]
var1 = arr[0]
var2 = arr[1]
var3 = arr[2]
For maps, key and value are assigned to variable:
map = {"key1": 1, "test": "text"}
extract(var1, var2) = map
println var1 // [key1, 1]
println var2 // [test, text]
To skip value just leave argument empty:
extract(x, , z) = [93, 58, 90]
println x // 93
println z // 90