Hi all,
I'm re-writing my cvscommand.vim plugin to handle both CVS and
Subversion version control systems. I'm currently implementing some
of the functionality through function references that define common
operations for each source control system in a dictionary specfic to
that system. I have a situation where I have a generic dispatch
function that identifies which dictionary to dereference to obtain the
function reference.
The problem is that the function eventually called behind the
function reference may have any number of arguments. Therefore, the
dispatch function takes any number of arguments to pass through. This
leads to the actual call, which looks like this (all on one line):
function! s:ExecuteVCSCommand(command, ...)
" find the proper functionMap dictionary, and then:
execute "return functionMap[a:command](" . join(map(copy(a:000),
"'\"' . v:val . '\"'"), ",") . ")"
My question is whether there is a simpler way to pass an unknown
number of arguments from the current function to a function which
accepts a variable-length list of arguments.
Thank you,
Bob