29 ms·
Whether a method call qualifies as message passing in the OOP sense would depend on the language semantics. In any event the caller must not be specifying the
by gridlockd 8y ago
Whether a method call qualifies as message passing in the OOP sense would depend on the language semantics.
In any event the caller must not be specifying the function to call (i.e. it's a virtual method in C++ terms) and it should be possible to send a message that is not understood without causing a fatal error (requires reflection in many languages).
- Gibbon1 8y ago> and it should be possible to send a message that is not understood without causing a fatal error I do that sort thing in C via a SendMessage(msgType...) idiom. Instead of a bunch of functions, you have one function and a message Type and some data. If the destination doesn't know what to do with a message of type whatever it just spits that back.
- 0815test 8y agoThis is basically how defunctionalization is implemented. I'm less confident about the "what if the destination doesn't know about the msgType you sent" issue, because defunctionalization itself is a whole-program technique where the destination context has to know what to do with your function call. But your solution (i.e. raising an error condition) looks reasonable enough.