5 ms·
As I understand it, in statically typed languages that support multi-methods, you import the generic function declaration for a multi-method. This multi-method
by nessus42 15y ago
As I understand it, in statically typed languages that support multi-methods, you import the generic function declaration for a multi-method. This multi-method can be defined in zillion different modules. You only have to import the generic function declaration, not any of the function definitions. The generic function declaration can be parameterized, just like parameterized declarations in Scala. Single or multiple dispatch may be used to locate a method definition.
So, yes, your code does need more import statements. I don't consider this to be a problem. Your code, however, does not need to qualify the functions that it calls with the module where the function is defined.
- eli_gottlieb 15y agoYou would have to qualify the call with the module where the generic function is defined. Otherwise, you could import two modules that both define a generic function named foo() -- but whose foo() functions do completely different things.
- nessus42 15y agoYes. I consider this a feature, not a bug.