> I want to do some coding like this:
let F = function('Foobar')
call call(F, [arg1, arg2], { optional self dict })
Note: F must be upper case, cause functions can only be assigned to
upper case vars.
Also see vim-addon-mw-utils (on my github page).
That implements a function reference by using a special key in a dict.
This way you can also add args to the function ref:
let f = funcref#Function('FooBar',{'args': [ 1, 2] })
call funcref#Call(f, [2,3])
will call FooBar(1,2, 2,3)
It also supports kind of eval functions definitions:
let f = funcref#Function("return ARGS[0]")
last but not least obj like functions:
let X = {}
fun X.A(a,b)
echo a:a
echo a:b
endf
call X.A(2,3)
let C = X.A
call call(C,[], X) " or the like
Marc Weber
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
No comments:
Post a Comment