Yegappan wrote:
> If you run the below script:
>
> --------------------------------------------
> vim9script
> def g:Test1(): void
> enddef
> echomsg function('g:Test1')
> echomsg funcref('g:Test1')
> --------------------------------------------
>
> The following output is produced:
>
> function('g:Test1')
> function('Test1')
>
> Note that in the second line the scope "g:" is missing. I expected that the
> same output will be produced by both function() and funcref().
With a funcref a pointer to the function is used, thus the scope is not
directly relevant. With function() it stores the name as it was given,
to be looked up later. Thus it should be OK to get a different name.
But it would be clearer for the funcref to output funcref('Test1').
I wonder what trouble it would cause if we change that now.
Unless there is a practical reason, I rather leave it as it is.
--
hundred-and-one symptoms of being an internet addict:
10. And even your night dreams are in HTML.
/// 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/20211209092740.3FCD81C0B28%40moolenaar.net.