4 ms·
By "dynamic" do you mean "interpreted"? Because Objective-C is a pretty dynamic and flexible language, otherwise.
by Zev 15y ago
By "dynamic" do you mean "interpreted"? Because Objective-C is a pretty dynamic and flexible language, otherwise.
- richcollins 15y agoObjective-C does have performSelector, but its awkward to use. It lacks the ability to easily add slots to objects and you often have to work with C types. Perhaps "expressive" would be a better distinction. Javascript is a much more expressive language, meaning that I have to do a lot less work to accomplish the same end.
- bonch 15y ago> Objective-C does have performSelector, but its awkward to use. It lacks the ability to easily add slots to objects and you often have to work with C types. -performSelector: takes a selector string, and its variants allow you to pass objects as arguments. I'm not sure why you think it involves C types or why you cite it as the feature that makes Objective-C dynamic (there's considerably more to it than that).
- richcollins 15y agoI was talking about Objective-C not performSelector, although performSelector does illustrate some problems with C types. You can't return a value with perform selector precisely because of C types (unless you wanted performSelectorReturningInt ... etc)