I've never seen that, and looking for it online just gives me references that say it's Java-specific and simply calls the function from the parent class's scope. If that's the case, it's not the same thing here, since that doesn't need to be in a class (and wouldn't be, equivalently even, in GM).
Sorry, I sometimes get languages mixed up....I think I got lua mixed up with it.
Anyway, just did some research and found that recursion does not occur in C/C++ when a global operator is used inside a global operator overloading function. At least, that's the information that I found:
http://www.cs.washington.edu/education/courses/cse303/10wi/ticpp-excerpt/ticpp-ch12.html
No, it does occur. Something like this (only writing the relevant parts):
class Integer {
private:
int i;
public:
int operator+(int val) {
return (i+val);
}
};Is not calling the same function. It's overloading + for (Integer_type_variable)+(int_variable) and calling (int_variable)+(int_variable). In C++, because the parameters are different types, it's a different function. Now, if you tried this:
class Integer {
private:
int i;
public:
int operator+(Integer val) {
return (*this + val);
}
};That would indeed cause recursion problems.
In GM--where typing is not only very loose to begin with, but scripts don't have prototypes or any way to define the types of their arguments--that means GM has no way of knowing if you're using a different "+", so to speak, and would be forced to assume recursion.
Of course, like I said before, "because other languages can't do it" is a very poor reason not to add it to GM. It just opens up a host of other issues that need to be considered, such as recursion. The easiest way to fix that would be as has been suggested: create a call_default("script_name", arguments,...) function which is the only function that cannot be overloaded.
-IMP
*EDIT* Slight correction of the operator overloading syntax. Oh, and I tested that kind of operator recursion in a short command-line C++ program. The result is just a complete program crash

.
Edited by IceMetalPunk, 02 September 2011 - 04:38 PM.