[swift-evolution] Proposal: Remove implicit tuple splat behavior from function applications

Chris Lattner clattner at apple.com
Wed Jan 27 13:41:14 CST 2016


> On Jan 27, 2016, at 11:32 AM, Jarod Long <swift at lng.la> wrote:
> 
> But failure in this case is a function that takes two arguments, and failureStubs is an array of tuples that map to that function's arguments. How do the tuple values get mapped to the arguments if not via tuple splatting?

Ah ok, I was looking at the success case I guess.  You’re right.  In this case, instead of :

    failure(failureStubs.removeFirst())

you’d have to write something like this:

    let tmp = failureStubs.removeFirst()
    failure(tmp.0, tmp.1)

-Chris

> 
> Jarod
> 
>> On Jan 27, 2016, at 11:28, Chris Lattner <clattner at apple.com <mailto:clattner at apple.com>> wrote:
>> 
>>> On Jan 27, 2016, at 11:24 AM, swift at lng.la <mailto:swift at lng.la> wrote:
>>> 
>>> Apologies -- I just realized I chose a bad example that isn't actually using the feature, but the usage would be here:
>>> 
>>> if successStubs.count > 0 {
>>>     success(successStubs.removeFirst())
>>> }
>>> else if failureStubs.count > 0 {
>>>     failure(failureStubs.removeFirst())
>>> }
>> 
>> This isn’t using the feature either.  You are passing a single value (returned by removeFirst) as a single argument.  No spat is happening.
>> 
>> -Chris
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160127/37115eda/attachment.html>


More information about the swift-evolution mailing list