If you use clang, blocks are another approach.
[0] http://en.wikipedia.org/wiki/Blocks_(C_language_extension)
[0] http://en.wikipedia.org/wiki/Blocks_(C_language_extension)
I think the problems you're describing are ones that are going to be faced in any attempt at C closures. Closures have memory attached, that's the appeal of them and also the source of all the problems.
Block_copy etc are implemented in libclosure which iirc does not require libobjc either. But of course if you ARE writing objc, they are valid objects and can be treated as such
But if you write your program to use blocks from the start, that's not a big problem.
Blocks are supported for programs developed for Mac OS X
10.6+ and iOS 4.0+,[1] although third-party runtimes
allow use on Mac OS X 10.5 and iOS 2.2+.[2]
http://en.wikipedia.org/wiki/Blocks_(C_language_extension)Regardless, both of you appear to be correct:
BlocksRuntime - a target-independent implementation of
Apple "Blocks" runtime interfaces.
http://compiler-rt.llvm.org/