I mean if there is such mechanism in the vim script itself.
OK, maybe the title of this mail is not very clear for you to
understand, i just give an example.

let foo = {}
let foo.var = 100

we can access the value 100 by :
echo foo.var
echo foo['var']

i just want to know if there is a mechanism to convert
==> echo foo.var_not_exist
to
==> echo foo.__index__( "var_not_exist" )            "pseudo code, the
__index__ does not exist as i know
, which __index__ is a method when the key can not be found in a
dictionary object.

I found this kind of mechanism in many script languages, such as python, lua.
With this mechanism, we can hack the dictionary to many "interesting" feature.

Is there this accessing mechanism in vim script?
# As i know it seems not.

Or is there an alternate method to accessing dictionary  when the key
is not found
, instead of showing error directly?

-- 
You received this message from the "vim_dev" 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

Raspunde prin e-mail lui