4 ms·
Can't most languages in (1) implement forwardable patterns that accomplish (2), or is there some underlying language features in Objective-C or Smalltalk that a
by look_lookatme 14y ago
Can't most languages in (1) implement forwardable patterns that accomplish (2), or is there some underlying language features in Objective-C or Smalltalk that are superior in this case?
- TazeTSchnitzel 14y agoI'm guessing that in these languages you don't need special argument types (or you can use the same code for any function) There are several others that support this though... Python and JavaScript spring to mind.
- paulhodge 14y agoSure, with enough boilerplate code you can do anything in anything. It's more of a categorization of what's the normal style, of what is already provided and encouraged.
- xsmasher 14y agoIn Objective-C, I can easily say "if anyone calls a method on me that I don't implement, sent it to this object instead". I can also say "if anyone calls a method on me that I don't implement, do (foo) instead". C++, for example, has no equivalent language facility for these scenarios; in fact they're nonsensical since they would both fail to compile. You could build a similar system for C++ by making every object inherit from some base class that has a method performMethod( method, params) and replace all C++ method calls with your modified calls; but you're building a facility from scratch that comes out-of-the-box on Objective-C.