How can I pass varargs to another function in vimscript?

Viewed 1533

I want to write a wrapper to a plugin's function, but it uses varargs (...). How can I pass the same arguments my function receives to the plugin's function?

Example:

function! PluginInterface(...)
    for i in a:000
        echo i
    endfor
endfunction

function! MyInterface(...)
    echo a:1 . ' is great'
    call PluginInterface(a:000)
endfunction

echo '>> Their call'
call PluginInterface('hello', 'world')
echo '>> My call'
call MyInterface('hello', 'world')
1 Answers
Related