[Cst-1b] Comp.Prog.Lang - ALGOL - Trouble Spots 2
Ewan Mellor
eem21@cam.ac.uk
Fri, 12 May 2000 14:57:43 +0100 (BST)
On Wed, 10 May 2000, Martin Harper wrote:
> On page 16 of comp.prog.lang(5.8), one of the trouble spots of ALGOL is claimed
> to be -
> "The types and modes of calling procedure arguments could not be specified."
>
> however, looking at the code fragments, it seems that you can - for example,
> over the page there is a "transpose" procedure, which runs as -
>
> real procedure transpose(A, m)
> value m;
> real array A; integer m;
> begin
> ...
> end
The example he gave was this one:
integer procedure f(g)
integer procedure g;
begin
...
end
what you can't say (as you would like to) is
integer procedure f(g)
procedure g(integer x)
begin
that is you cannot specify the types (and calling modes) of the parameters
of functions which in themselves are parameters to functions.
This of course knackers your type-checking all over the rest of the
program.
This applies to Algol W as well, according to my hastily scribbled notes.
Ewan.