Function overloading: Difference between revisions

Content deleted Content added
Added Crystal lang to list of "Languages supporting overloading".
m Fixing a typo - You can help!
Line 41:
It is a classification of static polymorphism in which a function call is resolved using some "best match" algorithm, where the particular function to call is resolved by finding the best match of the formal parameter types with the actual parameter types. The details of this algorithm vary from language to language.
 
Function overloading is usually associated with [[statically-typed]] programming languages that enforce [[type checking]] in [[function call]]s. An overloaded function is really just a set of different functions that happen to have the same name. For any particular call, the compiler determines which overloaded function to use, and resolves this at [[compile time]]. This is true for progammingprogramming languages such as Java.{{sfn|Bloch|2018|loc=§Chapter 8 Item 52: Use overloading judiciously|p=238-244}}
 
In [[Java (programming language)|Java]], function overloading is also known as compile-time polymorphism and static polymorphism.