[swift-evolution] Removing Variadic Parameters.

L. Mihalkovic laurent.mihalkovic at gmail.com
Thu Jul 7 03:37:05 CDT 2016


Even vb does that... If you ever want to write a compiler or anything that has to dynamically adjust its behavior (which i would expect most objc devs never do) then it might be useful to not cut all the claws of this tigger.
Regards
LM
(From mobile)

> On Jul 6, 2016, at 8:38 PM, Tino Heth via swift-evolution <swift-evolution at swift.org> wrote:
> 
> It's a late answer… but I wanted to be a good citizen and checked if the topic has been discussed before; so, it seems that is not the case ;-)
> 
> In short, I agree:
> Variadic parameters are somewhat cool, and I think I was exited when I've seen them in C the first time… but I afair, I never created a variadic function in production code, and I think I just used them for the first time in Swift (I checked wether print is variadic…)
> As of today, string interpolation has several advantages over old-style string-formatting, and I can't remember any other method in one of the established libraries that uses this feature:
> Explicitly creating an array is just two additional characters, which doesn't matter in a long list (which imho shouldn't be crammed into the function call anyways), and when there are only a few parameters, you can mimic variadics with Optionals defaulted to nil — and who knows what the long-awaited hygienic macros might do to the importance of variadic parameters.
> 
> Additionally, variadic parameters compete with trailing closures, which for me would always win the struggle for the last parameter ;-)
> 
> As I said, I can't remember a single use case in Swift — and I already utilized quite a lot of the "strange" techniques (currying, tuple splat, complicated combinations of generics & protocols…).
> So for me, the answer to the question "would I add this feature to Swift if it wasn't there?" is a clear no…
> 
> Tino
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution


More information about the swift-evolution mailing list