On 4/2/22 1:43 PM, Bram Moolenaar wrote:
Ernie Rael wrote:
I've tried different things, the following looked like a good shot, but=20
it fails. Can a forward reference be done?
vim9script
var X: func = funcref('F')
def F()
echo "in F()"
enddef
X()
line 3:
E700: Unknown function: F
Not really. You can declare the "X" variable and set it only after
defining F() though. You can't use it earlier anyway.
If you really need to you could store the name of the function as a
string and use funcref() where you need to use it.
Thanks, now I understand a little better. I'm not sure I'll need it,
and glad to know how. Previously I look at help for funcref, "Just
like function()" looked at help for function(). My eyes glazed over...
-ernie
--
--
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/c78d62f7-07e8-2d23-e961-a69a804fd79d%40raelity.com.