Comments on: Blocks in Objective-C https://briksoftware.com/blog/archives/100 Thu, 14 Jun 2012 18:56:48 +0000 hourly 1 https://wordpress.org/?v=4.7 By: Anonymous https://briksoftware.com/blog/archives/100/comment-page-1#comment-16061 Sun, 14 Sep 2008 19:39:27 +0000 https://briksoftware.com/blog/?p=100#comment-16061 Yes, there will be blocks in Snow Leopard. Yes they will be completely different from anything already in Cocoa. They will have new syntax along the lines of:

^{/*block definition*/}

]]>
By: Karsten https://briksoftware.com/blog/archives/100/comment-page-1#comment-16056 Wed, 03 Sep 2008 06:45:58 +0000 https://briksoftware.com/blog/?p=100#comment-16056 rastap: no, NSInvocation is different. it’s like a prepared message send, that you can evaluate with some arguments. However, the method that you call has to exist. NSInvocation is more a bit like function pointers in C. Blocks are much more dynamic. NSInvocations are also a bit hard to setup in standard
Cocoa.

Johanne: interesting…that indeed seems a bit weird. However, if they write some sort of wrapper class for the c-blocks, this should be just fine i think. But then it couldn’t be bridged to Carbon as easily as NSStrings. I guess time will tell what they come up with.

Karsten

]]>
By: Johannes Fortmann https://briksoftware.com/blog/archives/100/comment-page-1#comment-16053 Tue, 02 Sep 2008 22:36:39 +0000 https://briksoftware.com/blog/?p=100#comment-16053 I already posted this on http://lists.cs.uiuc.edu/pipermail/cfe-dev/2008-September/002700.html
Basically, blocks are provisioned to be objective-c objects, but for some strange reason the first pointer doesn’t point to an isa, it points to an object (*). The comments in the source as well as the test case say otherwise, yet this can’t be a simple oversight. I sure hope they change that; having blocks as native objects (however limited) would be soo cool.

(*) With:
struct Block_impl {
Class isa;
char private_stuff[];
};
it should be something like:
struct Block {
Block_impl impl;
char private_stuff[];
}
but it is
struct Block {
Block_impl *impl;
char private_stuff[];
}

]]>
By: rastap https://briksoftware.com/blog/archives/100/comment-page-1#comment-16052 Tue, 02 Sep 2008 22:24:54 +0000 https://briksoftware.com/blog/?p=100#comment-16052 Isn’t NSInvocation what you are looking for?

]]>
By: Anon https://briksoftware.com/blog/archives/100/comment-page-1#comment-16051 Tue, 02 Sep 2008 19:49:28 +0000 https://briksoftware.com/blog/?p=100#comment-16051 If you want your suggestions to be heard, send them to cfe-dev@cs.uiuc.edu (the clang mailing list) instead of posting them on your blog 😛

]]>