Ingo Karkat wrote: > What I find inconsistent and strange is that though I can define > g:Foo(), I cannot call it with that global-scoped name: > > fun g:Foo() > return 42 > endfun > echo Foo() > 42 > echo g:Foo() > E117: Unknown function: g:Foo > E15: Invalid expression: g:Foo() > > Not that I personally would use the g:Foo() syntax, but I'm very used to > calling (script-local) s:Foo(), and this behavior is inconsistent.
I tried this with ":call g:Foo()", but it indeed doesn't work when invoking g:Foo() in an expression. I'll fix that. > >> In general, I do welcome the introduced restrictions, though, I've found > >> a place where I attempted to define a buffer-local function (fun! > >> b:Foo()); this is now correctly flagged with E128. > > > > Right. So the problem is that users have been using wrong function > > names, and they did work. Now they are flagged as errors, which may > > break some scripts. > > > > The question is: Is it acceptable to expect users to fix those scripts, > > or do we need to be lenient. A possible way is to add an option to > > allow the wrong names. That's not a nice solution though, it hides the > > actual problem. > > As these are real bugs, I'm against an option allowing those, too. > > Rather, the help about the error message should provide good > instructions (drop the invalid scope prefix) so that even casual users > are able to fix their beloved decades-old plugin that has long been > abandoned by its original author. Yeah, the help could mention that this changed at some point and that the function needs to be renamed now. -- >From "know your smileys": (:-# Said something he shouldn't have /// Bram Moolenaar -- [email protected] -- 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 /// -- -- 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 --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
