Parameter checking suffers in some languages when:
(1) Mutually recursive procedures are used in one-pass
compilers.
Solution: Make it two pass or
Forward declarations with all parameters.
Solution:
(1) Declare the procedures as external again with full
parameter description. CAN still cheat.
(2) Smart linker - NOT ALWAYS POSSIBLE.
(3) Leave summarised declarations lying about which must be
used in compiling all programs using these procedures.
MODULA 2, Java classes.
procedure fish(i,j:integer; procedure y);
begin
:
y(1,2,3);
:
end;
How does it do the correct checking at compile time?
Type, number, order ..... No way at compile time.
Solution:
runtime checking --> check against information left from
descriptors.
Some compilers require you to specify full parameter specs
of the procedure parameter.