[swift-evolution] Proposal for Passing Arrays to Variadic Functions

Andrey Tarantsov andrey at tarantsov.com
Sat Dec 12 14:25:42 CST 2015


To summarize, there are 4 options used by other languages:

func(*args) — Ruby & Python

func(args...) — Go

func(...args) — CoffeeScript, I believe (it's been a while)

func(args) — C# does this, I think, and probably some others


I personally believe that:

1. passing an array as a variadic argument list definitely requires some annotation at the call site

2.  func(args...) looks awesome and matches the existing declaration syntax, so it should be a clear winner in Swift.


A.



More information about the swift-evolution mailing list