holatuwol
Developer
I thought I allowed for this several dozen releases ago, but it turns out that I didn't actually implement the final changes which would permit it at the user-level. I've gone ahead and done so and the changes will be present in the next release of KoLmafia.
What this means, in regular terms, is that with the next release of KoLmafia, you can finally start giving your functions the same names, provided the parameters passed to these functions are somehow different. You're even allowed to give them different return types, provided this "use different parameters or different numbers of parameters" condition is met.
For example, the following code will validate in the updated ASH interpreter and print "Integer!" followed by "String!":
void test_me( string s )
{ print( "String!" );
}
void test_me( int i )
{ print( "Integer!" );
}
test_me( 1 );
test_me( "Hello world." );
What this means, in regular terms, is that with the next release of KoLmafia, you can finally start giving your functions the same names, provided the parameters passed to these functions are somehow different. You're even allowed to give them different return types, provided this "use different parameters or different numbers of parameters" condition is met.
For example, the following code will validate in the updated ASH interpreter and print "Integer!" followed by "String!":
void test_me( string s )
{ print( "String!" );
}
void test_me( int i )
{ print( "Integer!" );
}
test_me( 1 );
test_me( "Hello world." );