Any way to avoid external parameter names?
Any way to avoid external parameter names?
- Subject: Any way to avoid external parameter names?
- From: Rick Mann <email@hidden>
- Date: Fri, 24 Oct 2014 18:35:54 -0700
One of the things I dislike the most about Swift is its insistence on "being expressive". The docs talk about "allowing" expressivity, but should you choose to allow it, you then require it, and Swift implicitly requires it in a lot of places.
Here's an example in a playground, where the call to inSendRequest() angers the compiler:
import Cocoa
typealias HTTPHeaders = [NSObject : AnyObject];
typealias ResponseTuple = (NSData?, HTTPHeaders?);
typealias SendResponseFunc = (inResp: NSData?, inRespHeaders: HTTPHeaders?) -> ();
func
waitForSweep(inSendResponse: SendResponseFunc)
{
inSendResponse(nil, nil); // Missing argument labels 'inResp:inRespHeaders'
}
I find this "expressiveness" to be overly verbose.
Somewhere I read that setting the external name to "_" suppressed this, but I'm not able to set external names in tuples, which is what the SendResponseFunc typealias is.
Any way to get what I want?
TIA,
--
Rick Mann
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden