โŒ About FreshRSS

Normal view

There are new articles available, click to refresh the page.
Before yesterdayNews from the Ada programming language world

Overloaded Subprograms in Ada

Our Programming Languages professor told us that:

"In Ada, the return type of an overloaded function can be used to disambiguate calls (thus two overloaded functions can have the same parameters)"

So this implies that in Ada, we could do something like this:

function Func (Var : Integer) return Integer;
function Func (Var : Integer) return Float;

And then create different implementations of these two functions, therefore overloading them.

This does not make much sense to me, how can the return type alone be sufficient to distinguish between overloaded subprograms? How would we even go about deciding which one of these functions we meant to call when we do decide to use them?

โŒ
โŒ