Objective C?

Helge Hess helge.hess@mdlink.de
Thu Apr 6 18:25:00 GMT 2000


Corwin Light-Williams wrote:
> On the other hand, I think it would be cool if ObjC was more reflective.
> I mean, it's in the same realm as smalltalk or java, but there are some
> things missing that I'd kind of like to see. Easy method lookup, for
> instance. I'd like to say [[self class] methods] and get a method
> dictionary, or whatever was appropriate. It seems like this sort of
> thing would be possible(although perhaps difficult) without clobbering
> the language as it stands. Then again, I probably have no idea what
> I'm talking about

Objective-C *has* these reflective capabilities via it's C API. There
just is no standard object wrapper around it (to try one, check out
NGReflection, contained in the MOF2-fd kit available at
ftp.gnustep.org/pub/contrib [is not that nice, but exposes almost all
internals]).
Indeed creating a category on ObjC which wraps the C API is very easy.
Anyway, that is mainly a class library issue, not a language one.

Eg some stuff you can do dynamically in ObjC is adding methods to
classes or subclassing classes.

> But if someone wanted to champion that effort, it wouldn't be
> impossible? Is the Apple ObjC++ stuff counted in the aforementioned
> copyright assignment? I'd really like to see that functionality stay.
> If it needs to be cleaned up, fine. I'm more than willing to help out,
> although I'm probably not the ideal person for the job.

I agree that ObjC++ is somewhat nice for integration purposes (there is
a lot of C++ software out there ..). But I also agree that the effort
required is probably huge, given that the C++ frontend is likely the
most complex frontend of the gcc compiler.
I wonder whether the gcc C++ guys would be willing to add ObjC support
in the main C++ frontend (not by duplicating the C++ parser like it is
done with the C parser right now) - I guess not.

Greetings
  Helge


More information about the Gcc mailing list