procedure main() end
record main()
procedure print(x) args := x every i := 1 to *args do if type(args) == "list" then print(args[i]) else write(image(args)) end
args(p)
.
The names of functions are global. Since there is no declaration for args
in the procedure print()
, args
is global in Version
8. In Version 7.5, however, there is no args()
functions and
args
defaults to local in this procedure, which was what was
intended. Since args
is global in Version 8, the recursive
call of print()
changes the value of args
in the
middle of the loop.args
for a function,
since that name certainly is appealing for use as a program identifier.
On the other hand, it's handy to have reasonable mnemonics for functions
and the problem cannot be completely avoided in any case. Incidentally,
another name that sometimes causes this problem is tab
.