Hi Kurt,

Method overloading and operator overloading are the two ways you can do this.

Adhoc overloading of unqualified function names was considered as part of the design of F#. However, we rejected it on software engineering grounds.

As you would appreciate, adhoc overloading can be a blessing and a curse. In C# and .NET overloading is relatively "tamed" primarily because all references to overload sets are qualified by a type name, e.g. C.M, rather than just M (except in the body of C, which is somewhat different). In F# we chose to follow a similar approach: permit method overloading, but ensure that references to overloaded things are qualified by (type) names. We expect this restriction to continue.

This may mean that you either use members more than you might otherwise to implement your overloading, or that you may need to add a few more calls on the client side of a library to distinguish between the three cases you mention.

Kind regards

don

By on 5/20/2008 4:54 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us
Built with WebSharper