I am trying to use the new vim7 "object-based" features and am stuck
with an issue in using autoload style variables. Save the below as t.vim
in your autoload directory and execute it (:runtime autoload/t.vim).
>>>>
let t#var = 'something'
let s:hash = {}
function! s:hash.func()
echomsg 'from numbered function scope: '. t#var
endfunction
echomsg 'from global scope: '. t#var
call s:hash.func()
<<<<
you get the below output:
from global scope: something
Error detected while processing function 3:
line 1:
E121: Undefined variable: t#var
E15: Invalid expression: 'from numbered function scope: '. t#var
Is there something wrong that I am doing or is this a bug?
BTW, I find the syntax for using autoload functions and variables with
in the same module as ridiculous. There should really have been a
shortcut, something like a new prefix type (say z:), and the usage
outside the module can still be the same, just that the identifiers when
declared (and used in the same module), will be prefixed with z: (and it
will not be hard to expand this z: to the current module prefix).
--
Thanks,
Hari
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com