On 10 Apr 2011, at 11:39 AM, Ken Thomases wrote:

>> I am grateful you called this to my attention, as I had been thinking that 
>> blocks were closures, in which referencing (but not, usefully, changing) 
>> stack-local variables would work.
> 
> Blocks are closures and referencing stack-local variables does work.  For 
> non-__block variables, the block has a const copy of the value, just as 
> though it were passed by value into a function.
> 
>> I'd been thrown by the existence of the __block attribute, which permits 
>> referencing a stack-local variable as an lvalue. I had reasoned that if a 
>> __block variable _is_ obviously a reference to that memory, a non-__block 
>> variable (whose value does _not_ propagate to the stack variable when a 
>> block changes it) obviously _couldn't_ be a reference.
> 
> You had been correct.  Kyle just confused you.

Your response is very clear, and my mind is at ease. Thank you.

        — F

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to