Related articles |
---|
Antecedents of overloading (Re: Enumerated data types) xanthian@zorch.SF-Bay.ORG (1990-09-02) |
Newsgroups: | comp.compilers |
From: | xanthian@zorch.SF-Bay.ORG (Kent Paul Dolan) |
Keywords: | C, Pascal, design, Algol68, polymorphism |
Organization: | SF Bay Public-Access Unix |
References: | <1990Aug23.134826.2865@forwiss.uni-passau.de> <3621@goanna.cs.rmit.oz.au> <141425@sun.Eng.Sun.COM> |
Date: | Sun, 2 Sep 90 17:10:47 GMT |
grover@brahmand.Eng.Sun.COM (Vinod Grover) writes:
>ok@goanna.cs.rmit.OZ.AU (Richard A. O'Keefe) writes:
>>Algol 68 was the first language I met that allowed overloading, but from
>>the published discussions of the Algol 68 committee overloading was already
>>a well known idea then. Anyone know where it first showed up? ...
>
>I believe that Christopher Strachey used the term "ad hoc polymorphism" to
>refer to a breed of overloading. I *think* that was before Algol 68.
Further back than that, FORTRAN implemented what we now know as overloading
when:
INTEGER I,J,K,L,M
REAL A,B,C,D,E
A = I + B
B = D + E
J = K + L
all produced sensible answers. One can speak of "promotion" of the integers
to reals, but it is equally useful to speak of the "overloading" of "+" in
this situation, as we tend to do today.
Memory fades after 30 years, but I think some of the early built-in math
functions had overloaded alias names, too, so that IFUNCT(someinteger) and
RFUNCT(somereal) and FUNCT(anything) all got the conceptual FUNCT operation,
the latter on either integer or real values and returning the appropriate
type depending on the type of the parameter. Check this one out before
believing me, it _has_ been a while, and it might have been a later version
of FORTRAN.
Kent, the man from xanth.
<xanthian@Zorch.SF-Bay.ORG> <xanthian@well.sf.ca.us>
[Generic functions only made it into standard Fortran in F77. -John]
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.