7 ms·
> 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...) idio
by 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.