Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is operator overloading Polymorphism?
Message
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00554986
Message ID:
00555719
Views:
16
Thanks Len. Its probably one of those things that can't be understood from the textbook definition, only from wrestling with some examples for a while.


>>Example:
>>
>>1 + 1 = 2
>>"1" + "1" = "11"
>>
>>This is clearly an example of overloading the "+" operator, but is it polymorphic?
>
>The definition of polymorphism is a very grey area, IMO opinion, the example is not polymorphism, but is operator overloading - though some definitions of overloading describe it as a type of polymorphism. (e.g. http://webopedia.internet.com/TERM/p/polymorphism.html).
>
>James Booth's description of 'ad hoc polymorphism' may be relevant.
>http://jamesbooth.com/oop.htm
>
>My main objection to it being polymorphism, is that integers are a fundamental type & as such + is not really a method. But that probably reflects my background (Pascal/C/C++), so not being polymorphic is only an opinion not something I would state as a fact.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform