ranchgirl
版主
发贴: 801
积分: 132
|
于 2005-10-02 21:52
Name overloading is actually supported in the computer sciences from the very beginning, and in all programming languages.
The plus (+) operator is overloaded long before even OO concepts came into play in computer sciences. It is in Fortran (the first high level computer language) for sure.
int + int: this plus(+) is passed by 2 ints as parameters. double + double: this plus(+) is passed by 2 doubles as parameters.
======================
All natural languages are overloaded long before computer even invented.
In Chinese: 运动可以锻炼身体! 分子运动是运动!
Chineses word 运动 is overloaded in these 2 sentences, they actually mean different things. We distingush them by context (上下文)。
Compiler is not that smart as we do. Compiler distinguishes overloaded methods by signature!!!
gongshi edited on 2005-10-02 22:00
|