> Irrelevant reminiscence: many years ago, I changed the value of 2 this way.
>
>...
>
> Ah, those were the days ;-).
Were?? Well, I suppose there has been some progress - under present-day
Solaris, using Sun's Fortran compiler, this program:
subroutine foo(x)
x = x + 1
return
end
call foo(2)
end
produces a run-time error with the message "POSSIBLE ATTEMPT TO MODIFY
CONSTANT" followed by a segmentation fault!
And in "Structured Fortran 77 Programming with Hewlett-Packard
Computers" I read "Since a constant is meant to be a value not subject
to change, it should be used [as an actual argument] in those instances
where the subprogram's computations do not alter it."
Maybe you didn't read the manual.
David
|