Hi,
On Sun, Mar 6, 2022 at 5:49 AM Bram Moolenaar <[email protected]> wrote:
>
>
> Another example, consider preparing a list with jobs, but the jobs have
> not been created yet:
>
The Vim9 LSP plugin uses this construct for the lsp server jobs.
I have run into the problem that you described below. It will
definitely help to simplify the code if the null_xxx values are
added.
Regards,
Yegappan
> var jobs = {read: null_job, write: null_job, check: null_job}
> ...
> jobs.read = job_start(...)
> if writing
> jobs.write = job_start(...)
> endif
> jobs.check = job_start(...)
> ...
> if jobs.write != null_job
> # write
> endif
>
> This looks better than just using "null" and handling the type
> difference in some way.
>
> Another problem not mentioned yet: When using a default value for a
> function argument, and the type is channel, there was no value that
> could be used. null_channel would be useful there too.
>
> > BTW, it is disconcerting that "string sval" or "list<string> l_sval" does
> > not work :-) But var works pretty well and it doesn't seem to be and issue.
>
> There are different ways to do declarations in various languages. Using
> "var" is similar to JavaScript and happens to fit well with Vim
> commands.
>
--
--
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/CAAW7x7nEVim1BHbWFTPBDXUyxpuxyXONm%2BqYW-JJEV%3DAf0yEjw%40mail.gmail.com.