[Mono-list] Is Objective-C support possible?
Sun, 16 Sep 2001 22:11:37 -0700
At 12:04 AM -0400 9/17/01, Miguel de Icaza wrote:
> > The primary problem will likely be things like forward invocation
>> and class extensions (categories) which Java doesn't implement. ObjC
>> is far more flexible than Java.
>It should actually be possible to implement Objective-C with the .NET
>framework. Even categories should be possible to support.
>In Objective-C method invocation is always done at runtime, and there
>is very little support at compile-time for it. Every method
>invocation is performed by the runtime.
>For example, the compiler will translate:
> [object someMethod: "hello"]
>Into a call to a general message sending routine:
> __msgCall (object, "someMethod", "hello")
>It should be pretty simple to implement __msgCall, specially given
>System.Reflection.Emit's capability of generating code on the fly.
>Categories can be trivially implemented by having your `__msgCall'
>function cope with it.
>That does not mean that an Objective-C program will be immediately CLS
>compliant at every level, but it is a start.
The problem as I see it is categories have to be implemented in the runtime library which handles all objects in general so that when another object (possibly written in Java or whatever) calls said method, the new stacked method is called, not the original. So unless the general runtime supports class extensions, I don't see how it would work like it's intended.