Frank Heckenbach wrote:
Scott Moore wrote:
Overloaded functions and procedures cannot be passed as procedure or function parameters. The following is an illegal example:
program test;
procedure alpha;
begin
end;
procedure alpha(i: integer);
Should be `overload' I suppose.
begin
end;
procedure zeta(procedure tau);
begin
end;
begin
zeta(alpha)
end.
It is ambiguous which copy of alpha gets passed to zeta, since the parameters to alpha do not appear in the call to zeta.
You've addressed some valid concerns in your other examples, but in this case, I'm not sure what the problem is. A parameter `procedure tau' means a procedure parameter without arguments. Otherwise you'd have to write `procedure zeta(procedure tau (i: Integer));'. So I see no ambiguity here.
Or do you follow Wirth's original Pascal for procedural parmeters (which doesn't specify arguments AFAIK), rather than ISO Pascal?
Frank
I see your point, matching indirectly via the type of passed parameter. Let me study if that works for all combinations of overloads and get back to you. Say, it pays to have you guys look stuff over !