Top 1K Features Creators Events Podcasts Books Extensions Interviews Blog Explorer CSV

Function Overloading

< >
Example from 1 languages: C++
// volume of a cube int volume(const int s) { return s*s*s; } // volume of a cylinder double volume(const double r, const int h) { return 3.1415926*r*r*static_cast<double>(h); }
Example from 1 languages: Pascal
program Adhoc; function Add(x, y : Integer) : Integer; begin Add := x + y end; function Add(s, t : String) : String; begin Add := Concat(s, t) end; begin Writeln(Add(1, 2)); (* Prints "3" *) Writeln(Add('Hello, ', 'World!')); (* Prints "Hello, World!" *) end.
Example from 1 languages: Speedie
function volume (|float| a, |float|) return a*a*a function volume (|float| r, |float| h, |float|) // volume of a cylinder return math.pi*r*r*h
*

Languages with Function Overloading include C++, Pascal, Chapel, Dale, Speedie

*

Languages without Function Overloading include JavaScript, Ruby, C3, Lil, Jule

*

View all concepts with or missing a hasFunctionOverloading measurement

*

Read more about Function Overloading on the web: 1. 2.

- Build the next great programming language · Add · Issues · About · Search · Keywords · Livestreams · Labs · Resources · Acknowledgements