Questions about polymorphism word

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Questions about polymorphism word

melkyades
I was thinking about how to explain polymorphism today, which turned into a philosophic discussion with myself.

My first view is that we talk about polymorphism when we have a group of different objects that can respond to a common set of messages. This leads me to ask why we then use the word "polymorph" which focuses so strongly on shape of objects (which is actually hidden), when we are actually talking about the ability to respond to the same language. Maybe this was thought by considering the shape of an object as the set of messages it responds, but I find it a bit misleading.

Maybe there isn't a better word, or maybe I'm just wrong, or even both. Does anybody know which was the first usage of the word applied to programming? Do you think there's a better synonym?

Cheers!
Reply | Threaded
Open this post in threaded view
|

Re: Questions about polymorphism word

Alexandre Bergel-5
The most common definition of polymorphism is the following:
if you have a variable x that can hold a reference of a type A, then your language supports polymorphism if x can hold a reference of a type B. A and B are sharing a common interface.

Alexandre


On 3 Apr 2012, at 20:26, pocho wrote:

I was thinking about how to explain polymorphism today, which turned into a philosophic discussion with myself.

My first view is that we talk about polymorphism when we have a group of different objects that can respond to a common set of messages. This leads me to ask why we then use the word "polymorph" which focuses so strongly on shape of objects (which is actually hidden), when we are actually talking about the ability to respond to the same language. Maybe this was thought by considering the shape of an object as the set of messages it responds, but I find it a bit misleading.

Maybe there isn't a better word, or maybe I'm just wrong, or even both. Does anybody know which was the first usage of the word applied to programming? Do you think there's a better synonym?

Cheers!

-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.





Reply | Threaded
Open this post in threaded view
|

Re: Questions about polymorphism word

Dennis Schetinin
In reply to this post by melkyades
Polymorphism in biology occurs when two or more clearly different phenotypes exist in the same population of a species — in other words, the occurrence of more than one form or morph. [http://en.wikipedia.org/wiki/Polymorphism_(biology)]


Best regards,
Dennis Schetinin
Sent with Sparrow

On Wednesday, 4 April 2012 г. at 4:26, pocho wrote:

I was thinking about how to explain polymorphism today, which turned into a philosophic discussion with myself.

My first view is that we talk about polymorphism when we have a group of different objects that can respond to a common set of messages. This leads me to ask why we then use the word "polymorph" which focuses so strongly on shape of objects (which is actually hidden), when we are actually talking about the ability to respond to the same language. Maybe this was thought by considering the shape of an object as the set of messages it responds, but I find it a bit misleading.

Maybe there isn't a better word, or maybe I'm just wrong, or even both. Does anybody know which was the first usage of the word applied to programming? Do you think there's a better synonym?

Cheers!

Reply | Threaded
Open this post in threaded view
|

Re: Questions about polymorphism word

Carlos E. Ferro-3
On 03/04/2012 23:09, Dennis Schetinin wrote:
> *Polymorphism* in biology occurs when two or more clearly different
> phenotypes <http://en.wikipedia.org/wiki/Phenotypes> exist in the same
> population of a species — in other words, the occurrence of more than
> one /form/ or /morph/.
> [http://en.wikipedia.org/wiki/Polymorphism_(biology)
> <http://en.wikipedia.org/wiki/Polymorphism_%28biology%29>]
>
>
I think the term is used in this line (never forget the strong biology
background present on the founding fathers of Smalltak).
For me, it i called polymorphism (which means "many shapes" but also
"many ways") because for the same message you can have several different
ways/shapes in the answer, depending on the receiver.
(Sorry, it was clearer in Spanish: Pocho, son muchas formas... formas de
responder al mismo mensaje)


> Best regards,
> Dennis Schetinin
> Sent with Sparrow <http://www.sparrowmailapp.com/?sig>
>
> On Wednesday, 4 April 2012 г. at 4:26, pocho wrote:
>
>> I was thinking about how to explain polymorphism today, which turned
>> into a philosophic discussion with myself.
>>
>> My first view is that we talk about polymorphism when we have a group
>> of different objects that can respond to a common set of messages.
>> This leads me to ask why we then use the word "polymorph" which
>> focuses so strongly on shape of objects (which is actually hidden),
>> when we are actually talking about the ability to respond to the same
>> language. Maybe this was thought by considering the shape of an
>> object as the set of messages it responds, but I find it a bit
>> misleading.
>>
>> Maybe there isn't a better word, or maybe I'm just wrong, or even
>> both. Does anybody know which was the first usage of the word applied
>> to programming? Do you think there's a better synonym?
>>
>> Cheers!
>


--

Carlos E. Ferro**
[hidden email] <mailto:[hidden email]>
[hidden email] <mailto:[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: Questions about polymorphism word

hernanmd
In reply to this post by melkyades

2012/4/3 pocho <[hidden email]>
I was thinking about how to explain polymorphism today, which turned into a philosophic discussion with myself.

My first view is that we talk about polymorphism when we have a group of different objects that can respond to a common set of messages. This leads me to ask why we then use the word "polymorph" which focuses so strongly on shape of objects (which is actually hidden), when we are actually talking about the ability to respond to the same language. Maybe this was thought by considering the shape of an object as the set of messages it responds, but I find it a bit misleading.


Polymorphic is the behavior when receive and manipulates objects of different forms ("classes").

 
Maybe there isn't a better word, or maybe I'm just wrong, or even both.
Does anybody know which was the first usage of the word applied to programming?

Strachey, C. "Fundamental concepts in programming languages". Oxford University, Oxford (1967)
 
Do you think there's a better synonym?

Behavioral modes? (surely there are better words captured by B.F.Skinner or Dennett).
 

Cheers!



--
Hernán Morales
Institute of Veterinary Genetics.
National Scientific and Technical Research Council (CONICET).
La Plata (1900), Buenos Aires, Argentina.
Telephone: +54 (0221) 421-1799.
Internal: 422
Fax: 425-7980 or 421-1799.

Reply | Threaded
Open this post in threaded view
|

Re: Questions about polymorphism word

tomford
Useful to know, 10x. Useful to know