Yegappan Lakshmanan wrote:

> >> To use a script local function as a job callback function, it looks like
> >> you need to use function('s:<function_name>') to generate a function
> >> reference. Is it possible to simply use the 's:function_name' string?
> >
> > That doesn't work, because the string doesn't know what script the
> > function is in.  Using function() will figure that out.
> 
> What about expanding the function name if it starts with "s:" or "<SID>"
> to <SNR><number>_<function name> in the get_callback() function?

That would be inconsistent with other places where a function reference
can be used.

> Currently get_callback() doesn't allocate memory for the function name.
> This needs to be changed to expand the function name. Maybe
> arg->vval.v_string can be freed and reallocated?
> 
> >
> >> Using the function name (as a string) as a callback is supported
> >> for global functions.
> >
> > Yes, then the function will be looked up when used, no context needed.
> 
> This will be confusing to a user. Function name as a string can be used
> for global functions but not for script local functions.

It's been like that forever.  We can't take away what already works, for
future work it's better to always use function().  We can add more hints
in the help for that.

-- 
How To Keep A Healthy Level Of Insanity:
11. Specify that your drive-through order is "to go".

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

Raspunde prin e-mail lui