diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-07-14 18:22:59 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-07-14 18:22:59 +0200 |
commit | b8be54dcc517c9d57b62409945b7d4b90b6c3071 (patch) | |
tree | f5eb85275a6b6f3a9eea3c819cb19e8c354f7991 /runtime/doc/eval.txt | |
parent | 37d9f175a4ab885052583746982d6bbfbe0095b9 (diff) | |
download | vim-git-b8be54dcc517c9d57b62409945b7d4b90b6c3071.tar.gz |
patch 8.1.1692: using *{} for literal dict is not backwards compatiblev8.1.1692
Problem: Using *{} for literal dict is not backwards compatible. (Yasuhiro
Matsumoto)
Solution: Use ~{} instead.
Diffstat (limited to 'runtime/doc/eval.txt')
-rw-r--r-- | runtime/doc/eval.txt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 1944fdd86..b10068238 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -60,7 +60,7 @@ Dictionary An associative, unordered array: Each entry has a key and a value. |Dictionary| Examples: {'blue': "#0000ff", 'red': "#ff0000"} - *{blue: "#0000ff", red: "#ff0000"} + ~{blue: "#0000ff", red: "#ff0000"} Funcref A reference to a function |Funcref|. Example: function("strlen") @@ -482,10 +482,10 @@ entry. Note that the String '04' and the Number 04 are different, since the Number will be converted to the String '4'. The empty string can also be used as a key. *literal-Dict* -To avoid having to put quotes around every key the *{} form can be used. This +To avoid having to put quotes around every key the ~{} form can be used. This does require the key to consist only of ASCII letters, digits, '-' and '_'. Example: > - let mydict = *{zero: 0, one_key: 1, two-key: 2, 333: 3} + let mydict = ~{zero: 0, one_key: 1, two-key: 2, 333: 3} Note that 333 here is the string "333". Empty keys are not possible here. A value can be any expression. Using a Dictionary for a value creates a |