|
|
 | | From: | Isaac Gouy | | Subject: | Re: Static vs dynamic | | Date: | 22 Jan 2005 12:14:48 -0800 |
|
|
 | > >> ...which term > > adhoc polymorphism, overloading
> Here was my example, in a mythical dynamic java: I understood you to mean that example.
> Yes, it is a polymorphism based upon signature, but there's > no overloading involved at all. Which term for this then? > I don't think that you're saying that this is ad-hoc as well.
Yes, I am.
>> "There are also two major kinds of ad-hoc >> polymorphism. In overloading the same variable >> name is used to denote different functions, and >> the context is used to decide which function is >> denoted by a particular instance of the name."
The same variable name - "work()" - is used to denote different functions - "One work()" and "Two work()" - and the context is used to decide which function is denoted by a particular instance of the name.
If "thing" is an instance of "One" then "work()" denotes "One work()"; if "thing" is an instance of "Two" then "work()" denotes "Two work()".
|
|
 | | From: | Thomas G. Marshall | | Subject: | Re: Static vs dynamic | | Date: | Sat, 22 Jan 2005 22:23:56 GMT |
|
|
 | Isaac Gouy coughed up: >>>> ...which term >>> adhoc polymorphism, overloading > >> Here was my example, in a mythical dynamic java: > I understood you to mean that example. > >> Yes, it is a polymorphism based upon signature, but there's >> no overloading involved at all. Which term for this then? >> I don't think that you're saying that this is ad-hoc as well. > > Yes, I am. > >>> "There are also two major kinds of ad-hoc >>> polymorphism. In overloading the same variable >>> name is used to denote different functions, and >>> the context is used to decide which function is >>> denoted by a particular instance of the name." > > The same variable name - "work()" - is used to denote different > functions - "One work()" and "Two work()" - and the context is used to > decide which function is denoted by a particular instance of the name. > > If "thing" is an instance of "One" then "work()" denotes "One work()"; > if "thing" is an instance of "Two" then "work()" denotes "Two work()".
And that's considered "overloading"? It's not the overloading I understand.
-- Everythinginlifeisrealative.Apingpongballseemssmalluntilsomeoneramsitupyourn ose.
|
|
|