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

Bug with script-local funcref

Expand Messages
  • Andy Wokula
    A Funcref local to a script cannot be used after :call : func! s:LocalFunc(str) echo a:str endfunc let s:FuncRef = function( s:LocalFunc ) let g:FuncRef =
    Message 1 of 1 , Aug 29, 2007
    • 0 Attachment
      A Funcref local to a script cannot be used after ":call":


      func! s:LocalFunc(str)
      echo a:str
      endfunc

      let s:FuncRef = function("s:LocalFunc")
      let g:FuncRef = function("s:LocalFunc")

      call g:FuncRef("g:funcref")
      call s:FuncRef("s:funcref") " doesn't work
      call call(s:FuncRef, ["call(s:Funcref)"])
      call call("s:LocalFunc", ["call(s:LocalFunc)"])


      Output:

      g:funcref
      Error detected while processing ...
      line 9:
      E117: Unknown function: <SNR>64_FuncRef
      call(s:Funcref)
      call(s:LocalFunc)


      This doesn't look like intended.

      --
      Andy

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    Your message has been successfully submitted and would be delivered to recipients shortly.