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

Tino Heth 2th at gmx.de
Thu Jan 28 14:30:07 CST 2016


I hope the timing of the proposal is coincidence — I would feel really bad if I triggered the death of tuple splat ;-)

I strongly agree with Jens and Taras and would love to see "Remove implicit" replaced with "Fix"* in the headline:
There is no doubt that the feature in its current state has problems, but I think the concept in general isn't bad.
Imho it would be sad if nifty little helpers like tuple splat and currying disappear forever, just because their implementation has issues.

Besides the option of delayed execution, there could be other use cases we aren't aware of yet, either because the current APIs were designed without tuples (I really dislike the use of unsafe dictionaries for configuration of objects like NSPersistantStoreCoordinator), or because tiny pieces of functionality aren't available in the language.

Take forwarding of method arguments as an example:
There has been a proposal to introduce an extra construct for this, but with a tiny feature to retrieve the argument tuple, it could be as simple as

override func f(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int, g: Int, h: Int, i: Int, j: Int) // ridiculous long parameter list to exaggerate usefulness ;-)
{
	// do some stuff
	if a > 0 {
		#arguments.b += 1
	}
	super.f(#arguments)
}

Tino

* I wouldn't mind if fixing takes time and the feature is removed until it is polished ;-)


More information about the swift-evolution mailing list