c3c
c3c copied to clipboard
Should it be possible to splat normal arguments?
fn void foo(int x, int y) { ... }
fn void foo2(int x, int...) { ... }
fn void main()
{
int[2] a = { 1, 2 };
foo2(1, ...a); // Works today
foo(...a); // Maybe this should work
foo2(...a); // Should this work?
}
What should be possible?
I am in favor of this change! Ot would be sweet of this would work for vectors as well.
What would you use it for?
Another one on this topic, being able to splat arrays of any with automatic "unwrapping" would be cool.
Another one on this topic, being able to splat arrays of any with automatic "unwrapping" would be cool.
In a function context? That seems very bug prone?