[swift-evolution] [Proposal Draft] parameter forwarding

Brent Royal-Gordon brent at architechies.com
Tue Jan 12 00:11:32 CST 2016


> Or is tuple packing and unpacking the best we can hope for?

If we do go the tuple packing/unpacking route, I wonder if we can add syntax that gets the parameter and return types of a function:

	func fooWithLogging(*params: foo.Parameters) -> foo.Return {
		print("Calling foo with \(params)")
		
		let value = foo(*params)
		
		print("	Returned \(value)")
		return value
	}

(Here I'm using a Ruby/Perl 6-style splat, since we're leaning pretty heavily on `...` already.)

-- 
Brent Royal-Gordon
Architechies



More information about the swift-evolution mailing list