> Not sure if this is a bug or not.
>
> Example:
> ---------------------------------------------------
>
> fun! s:Foo()
> endfun
>
> fun! s:Bar()
> endfun
>
> let name_foo = get(function('s:Foo'), 'name')
> let name_bar = get(funcref('s:Bar'), 'name')
>
> echo printf('"%s" vs "%s"', name_foo, name_bar)
>
> exe "function " . name_foo
> exe "function " . name_bar
>
> ---------------------------------------------------
>
> Result:
> ---------------------------------------------------
>
> "<SNR>116_Foo" vs "<80><fd>R116_Bar"
> function <SNR>116_Foo()
> endfunction
> function <SNR>116_Bar()
> endfunction
>
> ---------------------------------------------------
>
> When the Funcref is a funcref() instead of function() the
> "<SNR>" part is "0x80fd52".
>
> As one can use the the name starting with 0x80 for looking
> up by :function, I'm not sure if it is a bug or a feature.
>
> It looks like a signature of sorts and can perhaps be used
> to reliably distinguish the two from one another?
Yes, this looks like a bug. When requesting the function name there is
no need to keep the internal coding of the script-local function name.
I'll make a patch for that.
--
The Feynman problem solving Algorithm:
1) Write down the problem
2) Think real hard
3) Write down the answer
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ 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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20220627104618.9AFF91C4810%40moolenaar.net.