• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Any way to avoid external parameter names?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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:38:04 -0700

Oh! I think I figured out what I'm doing wrong. The typealias doesn't understand local names, and that makes some sense. I can just get rid of those altogether and be find. Sorry for the noise.
----------------
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


  • Follow-Ups:
    • Re: Any way to avoid external parameter names?
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Any way to avoid external parameter names?
  • Next by Date: Re: Any way to avoid external parameter names?
  • Previous by thread: Any way to avoid external parameter names?
  • Next by thread: Re: Any way to avoid external parameter names?
  • Index(es):
    • Date
    • Thread