Thursday, August 19, 2021

Re: [vim9script] Why is a forward declaration needed?

On 2021-08-19, Bram Moolenaar <Bram@moolenaar.net> wrote:
> You are using "Call" in Expr(), and Expr is used in an expression
> to set "TrailingArg". To be able to check the type there, Expr() is
> compiled, which requires "Call" to exist.

Got it.

> NumberLiteral is defined just before setting "TrailingArg".

Too silly of me not to notice that.

> What is tricky here that in principle a variable needs to be defined
> before used, and when used in a function it should be defined before
> that function. But since compilation is done only when needed, it can
> be defined after the function, so long as it's before compiling it.

Ok, that makes sense.

Thanks,
Life.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/sfmdd7%24j5r%241%40ciao.gmane.io.

No comments: