runtime(doc): Update the tuple help text
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>
This commit is contained in:
committed by
Christian Brabandt
parent
583f5aee96
commit
1c2f475850
@ -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: >
|
||||
|
||||
Reference in New Issue
Block a user