Coming back to the discussion about how to deal with constants. I had
been trying to follow TypeScript, leading to:
let name = [] # mutable
const name = [] # name immutable, list mutable
const! name = [] # name and list immutable
This is not actually following TypeScript, since TypeScript does not
have "const!".
I found an alternative in Dart by using "final". Java also uses
"final".
let name = [] # mutable
final name = [] # name immutable, list mutable
const name = [] # name and list immutable
This is less weird, isn't it?
Even though it's not found exactly this way in another language. Dart
uses "var name = []" for mutable. We could even go that way:
var name = [] # mutable
final name = [] # name immutable, list mutable
const name = [] # name and list immutable
Thus dropping "let" in Vim9. I've been making quite a few mistakes with
"let" in Vim9, since the meaning actually differs from "let" in legacy
Vim script. I tend to accidentally use it for assignments, even though
it's actually a declaration. Perhaps it's good to make the difference
clearer by not using "let" at all? It drops the idea of following
TypeScript, but we weren't doing that 100% anyway.
--
Sometimes you can protect millions of dollars in your budget simply by buying
a bag of cookies, dropping it on the budget anylyst's desk, and saying
something deeply personal such as "How was your weekend, big guy?"
(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/202009251020.08PAK6qd447598%40masaka.moolenaar.net.