on 9/29/02 6:24 PM, Finlay Dobbie at finlay (at) dobbie .D.O.T net wrote:
>> I just try discuss a little with you language itself: >> Objective-C against C++ ? >> >> We can start other thread on this ? >> May be you know some URL that answer on this ? >> What can I do with Objective C more easier and effectively than in C++ >> ? > > Well, for example, there is a generic object type, "id". You can see if > an object responds to a selector (a selector is basically a method > name) at runtime, and if it does, make it perform that selector. You > can pass selectors as arguments to methods. etc, etc. Basically, a lot > more happens at runtime which would happen at compile time in C++. For > example, you could do something like this: > > id anObject; // assume this exists and points somewhere > if ([anObject respondsToSelector:@selector(stringValue)]) { > NSString *myString = [anObject stringValue]; > NSLog(@"myString: % (at) ", myString); > } > > Perhaps not the best example, but it should give you the general idea .D.O.T > I'm sure this has been discussed at length before on macosx-dev and > cocoa-dev :-)
Okay, Obj-C has more runtime support....looks to be like in SmalTalk.
But what about performance of this ? On the other hand sometimes important to have feature, then consider its performance.
Then other question. Do you really use this tricks with runtime in your development? Sounds to me like something very high level, meta language...
-- Best regards, Ruslan Zasukhin [ I feel the need...the need for speed ] ------------------------------------------------------------- e-mail: ruslan@paradigmasoft.com web: http://www.paradigmasoft.com
To subscribe to the Valentina mail list send a letter to valentina-on (at) lists .D.O.T macserve.net ------------------------------------------------------------- ©2002 Ruslan Zasukhin |