Kana Natsuno schrieb:
>> there may be different engines, we can only enable one of them at each
>> vim session, the framework will call engine's initialization and some
>> interface functions, inside the engine.vim script it may need to set
>> some s:variables and access some s:functions inside framework.vim
>
> callee.vim:
> function SID()
> return maparg('<SID>', 'n')
> endfunction
> nnoremap <SID> <SID>
>
> function s:cript_local_function(...)
> return string(a:000)
> endfunction
>
> caller.vim:
> echo call(substitute('s:cript_local_function', '^s:', SID(), ''),
> ['Vim', 'is', 'forever'])
> " ==> ['Vim', 'is', 'forever']
--------------------------
" callee.vim:
com! -nargs=* -complete=command FrameworkLocal <args>
function s:cript_local_function(...)
return string(a:000)
endfunction
let s:mile = 'XD'
--------------------------
" caller.vim:
FrameworkLocal echo s:cript_local_function(['Vim', 'is', 'forever'])
" ==> ['Vim', 'is', 'forever']
FrameworkLocal echo s:mile
" ==> 'XD'
--
Andy
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---