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

Arthur Sabintsev arthur at sabintsev.com
Sat Dec 12 14:31:27 CST 2015

I think it’s a postfix in coffeescript.

Anyway,  I’m with you on both points! As much as I think func(args…) is ugly, it works, and fits the current paradigm.


Arthur / Sabintsev.com

On December 12, 2015 at 3:25:48 PM, Andrey Tarantsov via swift-evolution (swift-evolution at swift.org) wrote:

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.


swift-evolution mailing list
swift-evolution at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151212/a529fa14/attachment.html>

More information about the swift-evolution mailing list