Loading ...
Sorry, an error occurred while loading the content.

76161Re: Patch 7.4.264

Expand Messages
  • Ingo Karkat
    Apr 24, 2014
    • 0 Attachment
      On 24-Apr-2014 12:43 +0200, Bram Moolenaar wrote:

      > Ingo Karkat wrote:
      >> Me, too. The following used to work:
      >> fun! Foo()
      >> endfun
      >> let g:Foo = function('Foo')
      >> After 7.4.264, I get:
      >> " E705: Variable name conflicts with existing function: g:Foo
      > That is correct. Previously Foo() and g:Foo were different names, which
      > is wrong. Both refer to the same function.

      Ah, okay. I can accept that.

      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
      echo Foo()
      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.

      >> 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.

      -- regards, ingo

      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 vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/d/optout.
    • Show all 22 messages in this topic