Is there a way to remove a parameter from a procedure so as to cause minimal disruption to the actual argument list of existing calls to the procedure?
Before removal of parameter "z":
After removal of parameter "z":
It seems that the actual arguments are moved down/over, beginning with the one removed, so that all those following the one removed are miss-assigned and the last one is unassigned.
Is there a way to avoid this so as to require less editing of the call sites?
Interesting idea: use a list for multiple parameters. That would make subsequent changes to the parameters easier.
However, what I am looking for is a solution after the fact: the procedure is already coded with multiple parameters and numerous calls are already present in existing code.... I want to remove a parameter that is not the last one.
It's not really a big problem ... but, as I am still somewhat of an ai2 beginner, I was wondering if there was a more sophisticated (=easier ) solution.
I think @Randal_Andress is correct here as far as a refactoring operation is concerned on the parameters. If a procedure declares parameters 1...6, and parameter 3 is removed, then 1, 2, 4...6 should remain and the parameter at position 3 should be bumped, rather than the parameter at position 6. Otherwise, the semantics of the parameters after the removed index may be altered. Other IDEs like IntelliJ will follow the semantics I've outlined (although the original interpretation is also correct for a particular definition of correctness).