Re: Passing Obj-C method as callback to C function
Re: Passing Obj-C method as callback to C function
- Subject: Re: Passing Obj-C method as callback to C function
- From: email@hidden
- Date: Tue, 28 Oct 2003 21:37:27 -0700
On Oct 28, 2003, at 1:12 PM, Bill Cheeseman wrote:
I believe this is covered in the gcc3
document in DeveloperTools under "Nested Functions," where it is
explained
that a function can be defined at the beginning of any block within an
Objective-C method. Code examples can be found by searching the mamasam
archive for "embed function in method," if I recall correctly. An
advantage
of doing this is that "self" is available to the function without
having to
pass it in as a void* parameter.
Which means we should be able to have Smalltalk-style blocks now. Just
need the syntactic sugar.
Something like
[array do: @[:each | some code goes here]]
would be really nifty (ie a block is @[])
I wonder what's holding that up?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.