• 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
Re: Stupid block syntax!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stupid block syntax!


  • Subject: Re: Stupid block syntax!
  • From: Quincey Morris <email@hidden>
  • Date: Tue, 03 Jul 2012 23:19:59 -0700

On Jul 3, 2012, at 22:40 , Graham Cox wrote:

> 	NSComparisonResult (^comp)( id<DKStorableObject>, id<DKStorableObject> ) = ^( id<DKStorableObject> a, id<DKStorableObject> b )

Actually, for a block literal, it's:

	… = ^NSComparisonResult ( id<DKStorableObject> a, id<DKStorableObject> b ) { … }

The literal syntax puts the return type after the [unparenthesized] "^", unlike the pointer syntax which puts the return type before the [parenthesized] "^".

> Could the stupid block syntax be any less intuitive?

Well, to be fair, it's *two* stupid syntaxes.


_______________________________________________

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: Stupid block syntax!
      • From: Dave <email@hidden>
    • Re: Stupid block syntax!
      • From: Graham Cox <email@hidden>
References: 
 >Stupid block syntax! (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Stupid block syntax!
  • Next by Date: Re: Stupid block syntax!
  • Previous by thread: Re: Stupid block syntax!
  • Next by thread: Re: Stupid block syntax!
  • Index(es):
    • Date
    • Thread