On Mon, Oct 24, 2011 at 1:02 PM, Gabriel Dos Reis wrote: > ... > Waldek Hebisch writes: > | I would not call this voodoo: the compiler performs reasonable type > | inference. > > There is nothing reasonable about it. The way that most AXIOM compilers > do overload resolution (even in faces of ambiguity) is to pick the first > from a list that makes the compilation works, regardless of whether the > arguments are the best or not. That list does not necessarily follow > any principles that relates the arguments to the call, e.g. exact match > or requiring fewer implicit coercions, etc. It is just how they happen > to be put on an internal list. >
As I recall that is not the case for function selection in the interpreter. There is some heuristic which does attempt to assign a "weight" based on the number of coercions and other factors. > | Sometimes compiler works too much to make sense of > | user input, but IMHO this is not the case. > > Unfortunately, this is one of those cases. We are lucky that it works > at all; that is why it is voodoo. > In your discussion you are talking about types of arguments but function selection in Axiom also uses the return type. So the compiler gives priority to any nullary function named Zero that returns the proper type. No? Regards, Bill Page. ------------------------------------------------------------------------------ The demand for IT networking professionals continues to grow, and the demand for specialized networking skills is growing even more rapidly. Take a complimentary Learning@Cisco Self-Assessment and learn about Cisco certifications, training, and career opportunities. http://p.sf.net/sfu/cisco-dev2dev _______________________________________________ open-axiom-devel mailing list open-axiom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/open-axiom-devel