knowledge-database (beta)

Current group: comp.object

Re: Static vs dynamic

Re: Static vs dynamic  
Isaac Gouy
 Re: Static vs dynamic  
Thomas G. Marshall
From:Isaac Gouy
Subject:Re: Static vs dynamic
Date:21 Jan 2005 13:28:47 -0800
I agree. I wrote this and it's wrong:

> The "extra" we see in dynamically type checked languages has often
> been called "ad-hoc polymorphism" (more specifically "overloading").

The "extra" we see is apparent when we use ad-hoc polymorphism; but
arises because the execution context is "used to decide which function
is denoted by a particular instance of the name" (rather than the
compilation context).

> As explained by Cardelli and Wegner in
>
http://research.microsoft.com/Users/luca/Papers/OnUnderstanding.A4.pdf
>
> "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."
From:Thomas G. Marshall
Subject:Re: Static vs dynamic
Date:Sat, 22 Jan 2005 02:57:30 GMT
Isaac Gouy coughed up:
> I agree. I wrote this and it's wrong:
>
>> The "extra" we see in dynamically type checked languages has often
>> been called "ad-hoc polymorphism" (more specifically "overloading").
>
> The "extra" we see is apparent when we use ad-hoc polymorphism; but
> arises because the execution context is "used to decide which function
> is denoted by a particular instance of the name" (rather than the
> compilation context).


Yep. That's /an/ extra, and sure, determining what to call at runtime sure
is an interesting gem, to me at least.

But given the polymorphism types (go monospaced font):

Parametric
/
Universal
/ \
/ Inclusion
Polymorphism
\ Overloading
\ /
ad-hoc
\
Coercion

....which term would you use for the poly-m without inheritance example I
gave?


>
>> As explained by Cardelli and Wegner in
>>
> http://research.microsoft.com/Users/luca/Papers/OnUnderstanding.A4.pdf
>>
>> "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."



--
With knowledge comes sorrow.
   

Copyright © 2006 knowledge-database   -   All rights reserved