Ernie Rael wrote:
> In vim9.txt there's
>
> The key type can be string, number, bool or float. Other types result in an
> error. A number can be given with and without the []:
>
> Don't know if the following shows a bug in implementation or documentation.
> The two dictionaries are not equal.
>
> vim9script
>
> var d1 = {[000123]: 'foo'}
> echo d1
> ### output {'123': 'foo'}
>
> var d2 = {000123: 'foo'}
> echo d2
> ### output {'000123': 'foo'}
>
> if d1 == d2
> echo 'EQUAL'
> else
> echo 'NOT EQUAL'
> endif
This is correct. The key eventually is always a string. If you use a
number and convert it to a string then leading zeros are dropped. If
you use a string with leading zeros, they are kept. This is in the help
below ":he E717".
--
hundred-and-one symptoms of being an internet addict:
86. E-mail Deficiency Depression (EDD) forces you to e-mail yourself.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ 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/20220428142722.A10611C05B5%40moolenaar.net.