This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Objective-C Protocols


Hi,

Objective-C has two ways of typing objects: with Classes (@class)
and Protocols (@protocol). Like any other datatype you can forward
declare a class without providing the definition, like this:

@class A, B;

@interface C : Object
	/* uses objects of type A and B */
@end

@interface A : Object
	/* uses objects of type C */
@end

@interface B : Object
	/* uses objects of type C */
@end

However, you can't forward declare protocols. Unfortunately
this makes Protocols sometimes difficult or even impossible
to use. This also prevents a clean mapping of something
like OMG-IDL to create stubs for ObjC CORBA bindings.

Since there is no set standard for this language, and
since gcc (or gobjc) seems to be the leading compiler for ObjC
(I heard that even Apple will be using it with OS X), why
not add this feature and set an example for any other
Objective-C compilers out there.

If there aren't any gcc hackers interested in doing this. Where
should one start looking if someone was willing to do it.

Thanks in advance.

Igor



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]