Re: Dynamic Languages [was: Re: why Obj-C]
Re: Dynamic Languages [was: Re: why Obj-C]
- Subject: Re: Dynamic Languages [was: Re: why Obj-C]
- From: Matthew Johnson <email@hidden>
- Date: Sat, 06 Apr 2002 01:23:20 +1000
>
objc_msgSend(someObject, @selector(performClick:), nil);
>
>
... then the Objective-C runtime figures out how to dispatch the message.
>
That the above are equivalent should help drive this concept home-- if a
>
method invocation is really just a call to a C function that takes the
>
pointer to the target object and finds the method implementation on that
>
object all means that method dispatch occurs entirely at runtime.
Wow that9s a fantastic explanation! Thank you very much. This explains a
lot. I.e why a program will compile and run and then spits the dummy when
you invoke a method that is not in the class.
Alright now I understand that my next question is what is the inherent
benefit of doing this? I can't see it. In fact I can only see the downside
of doing it that way. I.e it compiles.
One benefit I can see is with shared objects introducing new features to a
executable without the need for recompiles. But I can reproduce this in
straight C.
Matt
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.