I want to call the function by its name as string variable.
Help describes that I need to use the call()
:
call('ceil', [1.4])
But I am getting an error:
E129: Function name required
What am I doing wrong?
the confusing part here is that call
is a command and call()
is a function.
After : you cannot simply write foo(). You have to write a (ex-) command calling foo(), like in
call foo() or
echo foo() or
let a=foo() and alike.
So in your example try :echo call('ceil', [1.4])
to see it working