> These is very unfortunate as a solution for “spreading” a collection or tuple 
> so that It can be applied to function taking a variadic.
> It makes sense on the declaration site but not on the call site. 
> 
> someFunc(@nonVariadic [1])  
> someFunc(@variadic [1]) 
> 
> There is nothing special about variadic/ spreading that would warrant an 
> attribute. 
> 
> I think using attributes is not different than using a keyword like c# uses. 
> http://stackoverflow.com/questions/7580277/why-use-the-params-keyword 
> <http://stackoverflow.com/questions/7580277/why-use-the-params-keyword>
> 
> Do we really want to tag every array/tuple with a @variadic or @nonVariadic 
> tag when packing and unpacking parameters?
> 
> variadic/ spreading (AKA packing / unpacking ) is a well known concept to 
> most languages. 

I have the impression there is a misunderstanding about the proposal:
It would not only make the variadics-syntax superflous, but also the whole 
splatting-magic.
There would only be functions that accept arrays, and you could freely choose 
to feed them a comma-seperated list instead.
The attribute would be written in the function declaration only — and we could 
even decide that it isn't needed at all, and simply accept lists wherever an 
array is expected.
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to