From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: From: erik quanstrom Date: Fri, 4 Sep 2009 13:42:24 -0400 To: 9fans@9fans.net In-Reply-To: <8214DB3A-3368-4B61-B0CD-BAC5F2BE7271@sun.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] "Blocks" in C Topicbox-Message-UUID: 6510bdda-ead5-11e9-9d60-3106f5b1d025 > Where exactly does it say that? > > > dispatch_block_t p; > > > > if(cond){ > > p =^ { print("cond\n"); }; > > }else{ > > p =^ { print("cond\n"); }; > > } > > p(); > > > > since the first part is equivalent to > > > > if(cond){ > > struct Block _t = ...; > > p = &_t; > > } > > I'm pretty sure Apple's compiler is smart enough to allow the > construct that > you've just mentioned. In fact, I'd be willing to bet on it. Sadly > just like about > anybody else on this thread I don't have an access to Snow Leopard Mac > OS X > at the moment. So if there needs to be an experiment run -- that'll > have to > wait till next week. as i believe was originally explained, i ripped that example *directly* from the apple grand central documentation on page 37 in the "Data Types" section: http://developer.apple.com/mac/library/documentation/Performance/Reference/GCD_libdispatch_Ref/GCD_libdispatch_Ref.pdf maybe you don't believe the documentation? - erik