Tuple Calls

No, it is not. :slight_smile: One implicitly passes arguments, the other does not. To see the issue with this approach and how it couples behaviour and data, just consider what would happen if you have queue.push(42) and then someone wants to add a new queue.new_function(bar) that you haven’t defined. The coupling make it impossible to extend it without introducing a series of extension mechanisms, such as monkey patching or inheritance, all of them unnecessary if you don’t couple them in the first place. None of those issues happen with behaviours or pipes, where all arguments are still explicitly given.

And as a consequence they are even no supported fully by tools. For example, Hipe will not perform tuple dispatches. For all purposes, it is an undocumented feature and it may be removed from Erlang anytime.

4 Likes