Fri 18 Nov 2011 02:56:13 PM UTC, original submission:
When attempting to marshall a call to feval(), it is often the case that the length of the argument list being presented is not known until run time.
Currently, the only way I can see of addressing this is to switch with a case for each plausible number of arguments, but that is clearly very unsatisfactory.
An enhancement would be to either
a) have a variable-arguments version called perhaps va_feval() or vfeval() or similar, which would take two arguments - a function handle, and a cell array containing the arbitrary length argument list to be passed to the called function.
b) have a special case for feval(), where if it was passed exactly two arguments and the second argument was a cell array, that it was assumed that the cell array should be treated as the argument list for the function called.
The latter is tempting (in terms of avoiding duplicating code within the octave interpreter), but is not backwards compatible, and breaks compatibility with matlab.
Implementation in either case is fairly straightforward (I'd be happy to do the necessary).
|