Dictu
Dictu copied to clipboard
[FEATURE] List unpacking for function args
Is your feature request related to a problem?
Look into unpacking for functions, to begin with just list unpacking that map to positional arguments. We can look into this again if/when keyword arguments are ever implemented and extend this with dictionary unpacking.
Describe the solution you'd like
Similar implementation to python:
def test(a, b, c) {
print(a, b, c);
}
test(*[1, 2, 3]);
test(1, *[2, 3]); // Can pass positional arguments too
Describe alternatives you've considered
We could consider a different operator, much like JSs spread, .... Not massively fussed about this.