[PATCH] Fix assigning to scope dictionaries in python interface

35 views
Skip to first unread message

ZyX ZyX

unread,
Jul 16, 2012, 1:04:56 PM7/16/12
to vim...@googlegroups.com, lexca...@gmail.com
Vim bindevalled scope dictionary has the same problem I reported for
extend(). This patch fixes it, though with it case “masks existing
function” is indistinguishable with “funcref variable must start with
a capital”. I can make them distinguishable with few more lines if
needed (due to the existence of the first case I never assign function
references to g: or l: variables and believe this is a very bad idea,
thus it does not matter whether or not these cases are
distinguishable).

Also note: while lua interface lacks funcref problems (yet?), it
definitely makes it possible to have g:1 variable. I did not fix it
because I do not know what should be done in this case (and am
familiar neither with lua nor with its C API). Thus sending copy of
this message to Luis Carvalho. Do not know whether some other
interfaces have similar problems.

---
All changes I ever make are available at https://bitbucket.org/ZyX_I/vim.
hg_diff_-r_default.diff

Bram Moolenaar

unread,
Jul 16, 2012, 1:51:44 PM7/16/12
to ZyX ZyX, vim...@googlegroups.com, lexca...@gmail.com

ZyX wrote:

> Vim bindevalled scope dictionary has the same problem I reported for
> extend(). This patch fixes it, though with it case =93masks existing
> function=94 is indistinguishable with =93funcref variable must start with
> a capital=94. I can make them distinguishable with few more lines if
> needed (due to the existence of the first case I never assign function
> references to g: or l: variables and believe this is a very bad idea,
> thus it does not matter whether or not these cases are
> distinguishable).

Thanks, I'll look into it soon.

> Also note: while lua interface lacks funcref problems (yet?), it
> definitely makes it possible to have g:1 variable. I did not fix it
> because I do not know what should be done in this case (and am
> familiar neither with lua nor with its C API). Thus sending copy of
> this message to Luis Carvalho. Do not know whether some other
> interfaces have similar problems.

There are probably more like these..

--
The coffee just wasn't strong enough to defend itself -- Tom Waits

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages