@jwe made a change to the interpreter so that it now checks that the number of inputs and outputs when calling a function do not exceed the number specificed in the function signature.
This left a lot of redundant code that could be eliminated. The form of the m-file would look something like this:
function [out1, out2] myfunc (required_in1, in2) if (nargin < 1 || nargin > 2 || nargout > 2) print_usage (); endif ... endfunction
Assuming the first input was required and the second optional this can now be shortened to
if (nargin < 1) print_usage (); endif
I used some Perl, as well as a lot of manual labor, to clean up the core. See https://hg.savannah.gnu.org/hgweb/octave/rev/28de41192f3c. The same thing should be done for all of the packages before the 7.1 release as well. I can share my Perl script if anyone is keen, or the package maintainers can just go through their functions.