1.2. Overloading
Felix supports overloading. To demonstrate this,
we'll make a small modification to the hello
world program. You can compile and run the
program as before, just change the example number.
Start C++ section to tut/examples/tut102.flx[1
/1
]
1: include "std";
2: print "Hello World ";
3: print 42;
4: print "\n";
Here you can see that there are two procedures,
one to print strings, and one to print ints,
but they're both called 'print'.
Felix allows procedures and functions to be
overloaded, as does C++. However, unlike C++,
Felix has no automatic conversions, and
overload matching must be exact.