Re: Unintended polymorphism in Algol 60

gvcormac@plg.uwaterloo.ca (Gordon V. Cormack)
Tue, 27 Jun 1995 15:02:33 GMT

          From comp.compilers

Related articles
Unintended polymorphism in Algol 60 cowan@locke.ccil.org (John Cowan) (1995-06-23)
Re: Unintended polymorphism in Algol 60 gvcormac@plg.uwaterloo.ca (1995-06-27)
| List of all articles for this month |
Newsgroups: comp.compilers
From: gvcormac@plg.uwaterloo.ca (Gordon V. Cormack)
Keywords: algol60, polymorphism
Organization: University of Waterloo
References: 95-06-037
Date: Tue, 27 Jun 1995 15:02:33 GMT
Status: RO

John Cowan <cowan@locke.ccil.org> wrote:
>1) Some Algol 60 procedures seem to be polymorphic. Consider:
>
> 'procedure' foo(a, b, c) 'begin'
> a := b + c
> 'end';
>


I think that a,b,c are implicitly typed but I'm not sure.
>
>
>2) A parameter of type procedure in Algol 60 doesn't have any type or
>calling-convention information about the parameters. How does one know
>whether to supply thunks or values, and what type of values? Since there
>are no variables of procedure type, thank Ghu, a complete flow trace is
>possible, but is this really necessary?


This is a well-known screwup from FORTRAN, repeated in Algol 60, corrected in
Algol 68, but repeated again in Algol W, Pascal, and C. Pascal and C have
since been fixed. It requires a run-time type check.
--
Gordon V. Cormack CS Dept, University of Waterloo, Canada N2L 3G1
gvcormac@plg.uwaterloo.ca http://plg.uwaterloo.ca/~gvcormac
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.