Closed Frotty closed 12 years ago
This would break the current resolution rules for function references as in "TimerStart(..., function print)". Please also add suggestions on how to change this with respect to overloading.
"You can't use overloaded functions in callbacks" :D
What should the exact rules for overloading be? Maybe you can take http://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.12.2 as an inspiration for the specification. Or you see that overloading can add quite some complexity to the language. Of course it will be simpler for Wurst as we have no backwards compatibility issues and no boxing and no type coercions but still we have to think about how overloading works with overriding, subtyping, packages, type inference, generics, etc.
You might also want to read http://www.roseindia.net/javatutorials/overloading_considered_harmful.shtml
So currently I am against adding overloading.
meh, I (ofc) didn't think about the full scale consequences, it would just be a cool enhancement to have.
The point is: I am not sure if it is an enhancement and it surely will complicate the compiler :D
Done, but still needs some testing and documentation.
example:
function print( string msg )
function print( unit u )
etc.
Would be cool