This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Objective-C Protocols
- To: gcc at gcc dot gnu dot org
- Subject: Objective-C Protocols
- From: Igor Khavkine <i_khavki at alcor dot concordia dot ca>
- Date: Sun, 1 Jul 2001 01:42:40 -0400
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