Content deleted Content added
→Overloading: Attempt to use inline code for clarity |
→Overloading: Make some small improvements |
||
Line 28:
===Overloading===
To handle these six function calls, four different pieces of code are needed
* In the first case, [[integer (computer science)|integer]] addition must be invoked.
* In the second and third cases, [[floating point|floating-point]] addition must be invoked (with [[type promotion]], or [[type coercion]], in the third case).
* In the fourth and fifth cases, [[List (computing)|list]] [[concatenation]] must be invoked.
* In the last case, [[literal string|string]] concatenation must be invoked.
Thus, the name <code>+</code> actually refers to three or four completely different functions. This is an example of ''[[Overloading (programming)|overloading]]''.
==References==
|