]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(doc): Update the tuple help text
authorYegappan Lakshmanan <yegappan@yahoo.com>
Sun, 30 Mar 2025 13:37:24 +0000 (15:37 +0200)
committerChristian Brabandt <cb@256bit.org>
Sun, 30 Mar 2025 13:37:24 +0000 (15:37 +0200)
closes: #17009

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/doc/builtin.txt
runtime/doc/eval.txt
runtime/doc/tags
runtime/doc/usr_41.txt

index b903b3887b157fdde0e02fe9f51cdcec4dd8c3b4..5a72e214f3c0137c243c94f98d45b9e891719419 100644 (file)
@@ -1,4 +1,4 @@
-*builtin.txt*  For Vim version 9.1.  Last change: 2025 Mar 26
+*builtin.txt*  For Vim version 9.1.  Last change: 2025 Mar 30
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -11923,7 +11923,7 @@ trunc({expr})                                                   *trunc()*
                Return type: |Float|
 
 
-tuple2list({list})                                     *tuple2list()*
+tuple2list({tuple})                                    *tuple2list()*
                Create a List from a shallow copy of the tuple items.
                Examples: >
                        tuple2list((1, 2, 3))           returns [1, 2, 3]
index bcd64e30aaca8d48e047603a18937b9ff4cff3f0..7ea768aef5db10ca2b2c6220dd5059cc7292c4b4 100644 (file)
@@ -1,4 +1,4 @@
-*eval.txt*     For Vim version 9.1.  Last change: 2025 Mar 23
+*eval.txt*     For Vim version 9.1.  Last change: 2025 Mar 30
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -541,7 +541,8 @@ example, to add up all the numbers in a list: >
 A Tuple is an ordered sequence of items.  An item can be of any type.  Items
 can be accessed by their index number.  A Tuple is immutable.
 
-A Tuple uses less memory compared to a List and provides O(1) lookup time.
+A Tuple is similar to a List but uses less memory and provides O(1) lookup
+time for an item.
 
 Tuple creation ~
                                                *E1526* *E1527*
@@ -579,6 +580,15 @@ is not available it returns zero or the default value you specify: >
        :echo get(mytuple, idx, "NONE")
 
 
+Tuple modification ~
+                                                       *tuple-modification*
+A tuple is immutable and items cannot be added or removed from a tuple.  But
+List and Dict items within a tuple can be modified: >
+       :let tuple = (1, [2, 3], {'a': 4})
+       :let tuple[1][0] = 10
+       :let tuple[2]['a'] = 20
+
+
 Tuple concatenation ~
                                                        *tuple-concatenation*
 Two tuples can be concatenated with the "+" operator: >
index 7d54ee9b8584638212dec35681197418fa3606b1..fa4709224cf7c1fb556482472604e126f95a310c 100644 (file)
@@ -10937,6 +10937,7 @@ tuple-concatenation     eval.txt        /*tuple-concatenation*
 tuple-functions        usr_41.txt      /*tuple-functions*
 tuple-identity eval.txt        /*tuple-identity*
 tuple-index    eval.txt        /*tuple-index*
+tuple-modification     eval.txt        /*tuple-modification*
 tuple-type     vim9.txt        /*tuple-type*
 tuple2list()   builtin.txt     /*tuple2list()*
 tutor  usr_01.txt      /*tutor*
index 4c5e5ef4c69b23c7068e21ca1026d4e40fabe6cc..8279e3e999036301b718691ed6422cf87a1b1e16 100644 (file)
@@ -1,4 +1,4 @@
-*usr_41.txt*   For Vim version 9.1.  Last change: 2025 Mar 23
+*usr_41.txt*   For Vim version 9.1.  Last change: 2025 Mar 30
 
                     VIM USER MANUAL - by Bram Moolenaar
 
@@ -862,7 +862,7 @@ Tuple manipulation:                                 *tuple-functions*
        reverse()               reverse the order of items in a Tuple
        slice()                 take a slice of a Tuple
        string()                string representation of a Tuple
-       tuple2list()            convert a Tuple of items into a list
+       tuple2list()            convert a Tuple into a List
 
 Dictionary manipulation:                               *dict-functions*
        get()                   get an entry without an error for a wrong key