I wrote:

> Patch 8.2.1744
> Problem:    Vim9: using ":const!" is weird.
> Solution:   Use "var" - "final" - "const" like Dart.  "let" still works for
>             now.
> Files:      runtime/doc/vim9.txt, src/ex_cmds.h, src/errors.h, src/evalvars.c,
>             src/proto/evalvars.pro, src/cmdexpand.c, src/eval.c,
>             src/ex_docmd.c, src/vim9compile.c, src/vim9execute.c,
>             src/vim9script.c, src/vim.h, src/ex_cmdidxs.h,
>             src/testdir/test_vim9_assign.vim, src/testdir/test_vim9_script.vim

As discussed earlier, using ":var" / ":final" / ":const" looks like a
much better way to declare variables and constants.  It diverts from
what TypeScript is doing, but gets closer to some other popular
languages, such as using "final" as in Java.  And avoids the
Vim-specific use of ":const!".

I'll keep using ":let" as an alternative to ":var" for a little while,
so that those who already started using Vim9 syntax have a chance to
update their scritps.  Let me change that a week from now.

I'm going to change more tests so that we get a feeling of what we end
up with.  Feel free to discuss alternatives.

-- 
Bad fashion can discourage normal people from interacting with the engineer
and talking about the cute things their children do.
                                (Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            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/202009261325.08QDPfRR753459%40masaka.moolenaar.net.

Raspunde prin e-mail lui