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 -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///