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.
--
BEDEVERE: Oooooh!
LAUNCELOT: No "Aaaaarrrrrrggghhh ... " at the back of the throat.
BEDEVERE: No! "Oooooh!" in surprise and alarm!
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// 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/20220402204357.A3C191C1448%40moolenaar.net.