Content deleted Content added
Add reference & over loadings are distinguished by type signature, which can include return type (as in Ada) or just parameters (as in C++). More impartial phrasing. Still much to do... |
m Title linked in text |
||
Line 34:
* [[Nim (programming language)|Nim]]<ref>{{cite web|title=Nim Manual|url=https://nim-lang.org/docs/manual.html#overloading-resolution|website=nim-lang.org|language=en}}</ref>
* [[Crystal (programming language)|Crystal]]<ref>{{cite web|title=Crystal Docs|url=https://crystal-lang.org/reference/1.8/syntax_and_semantics/overloading.html|website=crystal-lang.org|language=en}}</ref>
* [[
==Rules in function overloading==
* The same function name is used for more than one function definition in a particular module, class or namespace
* The functions must have different [[
| last1 = Watt
| first1 = David A.
Line 47:
| publisher = John Wiley & Sons, Inc.
| isbn = 978-0-470-85320-7
| pages =
}}
</ref>
Line 57:
The mistake comed from confusion in each form of static polymorphism as following:
* ''[[Parametric polymorphism]]'' differs from overloading by that the function definition exists only ones and this function invoked with parameters of different types which are substituted formal parameter types.
* ''[[Ad hoc polymorphism]]'' is very similar to overloading but it's depends of a language. This classification was introduced by [[Christopher Strachey]] in 1967, but difference is that he applied for compiler specific features which was exists in some programming languages. It was possibly to define in a module only name of a function and have in another module a multiple functions with same name(exact
Function overloading differs from forms of [[Polymorphism (computer science)|polymorphism]] where the choice is made at runtime, e.g. through [[virtual function]]s, instead of statically.
|