Introduction to Programming in ATS: | ||
---|---|---|
<<< Previous | Convenience in Programming | Next >>> |
I will cover in this section several forms of overloading supported in ATS: static constant overloading, data constructor overloading and dynamic function overloading.
A symbol in ATS can be overloaded with multiple (dynamic) functions. The following syntax introduces a symbol of the name foo for overloading:
Suppose that foo1, foo2 and foo3 are names of three functions in ATS. Then we can overload foo with these three functions as follows:
An overloaded function symbol is resolved according to the number of arguments it takes and, if needed, the types of these arguments.
<<< Previous | Home | Next >>> |
Compile-Time Directives | Up | Modularity |