|
|
|
|
|
by kazinator
3727 days ago
|
|
> if I do "foo.bar()" in C++, the compiler will simply not compile the code if "bar" is not already defined on the class "foo" is declared as In a more dynamic language, in fact "foo.bar()" may be equivalent of asking foo whether it understands how to bar, and if so, then please do it. If foo doesn't understand, there could be some mechanism for handling that, like a catch-all function that can be defined that gets invoked. Likewise, we could also have a static language with message passing OOP in which the same check is implemented. The classes declare statically which messages they understand and the compiler checks that. Quite simply, "late binding" != "message passing". There can be late binding of messages, and late binding of function calls. There is no real conceptual difference between single dispatch and (synchronous) message passing. What is Unix ioctl? Message passing or function call? |
|