Skip to content

Commit 4c0ebf7

Browse files
committed
Update usr_41.{txt,jax}
1 parent 30272ed commit 4c0ebf7

File tree

2 files changed

+92
-6
lines changed

2 files changed

+92
-6
lines changed

doc/usr_41.jax

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*usr_41.txt* For Vim バージョン 9.1. Last change: 2025 Feb 01
1+
*usr_41.txt* For Vim バージョン 9.1. Last change: 2025 Mar 23
22

33
VIM USER MANUAL - by Bram Moolenaar
44

@@ -812,6 +812,32 @@ substitute() の呼び出しの前後にいろいろな処理を入れたりす
812812
repeat() リストを複数回繰り返す
813813
flatten() リストの平坦化
814814
flattennew() リストのコピーを平坦化
815+
items() リストのインデックスと値のペアのリストを取得す
816+
817+
818+
Tuple 操作: *tuple-functions*
819+
copy() Tuple の浅いコピーを作成する
820+
count() Tuple 内で値が出現する回数を返す
821+
deepcopy() Tuple の完全なコピーを作成する
822+
empty() Tuple が空であるか判定する
823+
foreach() Tuple の項目に関数を適用する
824+
get() Tuple の項目を取得。間違ったインデックスでもエ
825+
ラーにならない
826+
index() Tuple 内の値のインデックス
827+
indexof() Tuple で式の評価が真となった位置のインデックス
828+
items() Tuple のインデックスと値のペアのリストを取得す
829+
830+
join() Tuple の項目を連結し、文字列にする
831+
len() Tuple 中の項目の個数
832+
list2tuple() 項目のリストを Tuple に変換する
833+
max() Tuple 中の最大値
834+
min() Tuple 中の最小値
835+
reduce() Tuple を値に縮める
836+
repeat() Tuple を複数回繰り返す
837+
reverse() Tuple 内の項目の並び順を反転させる
838+
slice() Tuple のスライスを取る
839+
string() Tuple の文字列表現
840+
tuple2list() Tuple の項目をリストに変換する
815841

816842
辞書操作: *dict-functions*
817843
get() 辞書の要素を返す。存在しないキーでもエラーを出
@@ -1207,6 +1233,7 @@ Vimサーバー: *server-functions*
12071233
test_null_list() null のリストを返す
12081234
test_null_partial() null の部分適用を返す
12091235
test_null_string() null の文字列を返す
1236+
test_null_tuple() null の Tuple を返す
12101237
test_settime() Vimが内部的に用いる時間を設定する
12111238
test_setmouse() マウスの位置を設定する
12121239
test_feedinput() インプットバッファにキーシーケンスを追加する
@@ -1623,8 +1650,8 @@ Note 関数への参照を保持する変数の名前は大文字で始めなけ
16231650
==============================================================================
16241651
*41.8* リストと辞書
16251652

1626-
ここまでは基本型(文字列と数値)を扱ってきました。Vim は二つの複合型、リストと辞
1627-
書もサポートしています
1653+
ここまでは基本型(文字列と数値)を扱ってきました。Vim は 3 つの複合型、リスト、
1654+
Tuple と辞書もサポートしています
16281655

16291656
リストとは、要素を順番に並べたものです。要素はどのような型でも構いません。数値
16301657
のリスト、リストのリスト、あるいは複数の型が混在したリストでも作れます。例え
@@ -1725,6 +1752,23 @@ range()が生成するリストの最初の要素は0であることに注意し
17251752

17261753
さらなる情報については |Lists| を参照してください。
17271754

1755+
TUPLE
1756+
1757+
Tuple は、不変の順序付きの項目のシーケンスです。項目は任意の型にすることができ
1758+
ます。項目にはインデックス番号でアクセスできます。3 つの文字列を含む Tuple を
1759+
作成するには、次のようにします: >
1760+
1761+
var atuple = ('one', 'two', 'three')
1762+
1763+
Tuple 項目は括弧で囲まれ、コンマで区切られます。空の Tuple を作成するには: >
1764+
1765+
var atuple = ()
1766+
1767+
|:for| ループは、リストと同様に Tuple 内の項目を反復処理するために使用できま
1768+
す。
1769+
1770+
詳細については、|Tuples| を参照してください。
1771+
17281772
☆辞書
17291773

17301774
辞書はキーと値のペアを保持します。キーを指定することで高速に値を検索できます。

en/usr_41.txt

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*usr_41.txt* For Vim version 9.1. Last change: 2025 Feb 01
1+
*usr_41.txt* For Vim version 9.1. Last change: 2025 Mar 23
22

33
VIM USER MANUAL - by Bram Moolenaar
44

@@ -839,6 +839,30 @@ List manipulation: *list-functions*
839839
repeat() repeat a List multiple times
840840
flatten() flatten a List
841841
flattennew() flatten a copy of a List
842+
items() get List of List index-value pairs
843+
844+
Tuple manipulation: *tuple-functions*
845+
copy() make a shallow copy of a Tuple
846+
count() count number of times a value appears in a
847+
Tuple
848+
deepcopy() make a full copy of a Tuple
849+
empty() check if Tuple is empty
850+
foreach() apply function to Tuple items
851+
get() get an item without error for wrong index
852+
index() index of a value in a Tuple
853+
indexof() index in a Tuple where an expression is true
854+
items() get List of Tuple index-value pairs
855+
join() join Tuple items into a String
856+
len() number of items in a Tuple
857+
list2tuple() convert a list of items into a Tuple
858+
max() maximum value in a Tuple
859+
min() minimum value in a Tuple
860+
reduce() reduce a Tuple to a value
861+
repeat() repeat a Tuple multiple times
862+
reverse() reverse the order of items in a Tuple
863+
slice() take a slice of a Tuple
864+
string() string representation of a Tuple
865+
tuple2list() convert a Tuple of items into a list
842866

843867
Dictionary manipulation: *dict-functions*
844868
get() get an entry without an error for a wrong key
@@ -1234,6 +1258,7 @@ Testing: *test-functions*
12341258
test_null_list() return a null List
12351259
test_null_partial() return a null Partial function
12361260
test_null_string() return a null String
1261+
test_null_tuple() return a null Tuple
12371262
test_settime() set the time Vim uses internally
12381263
test_setmouse() set the mouse position
12391264
test_feedinput() add key sequence to input buffer
@@ -1649,8 +1674,8 @@ More information about defining your own functions here: |user-functions|.
16491674
==============================================================================
16501675
*41.8* Lists and Dictionaries
16511676

1652-
So far we have used the basic types String and Number. Vim also supports two
1653-
composite types: List and Dictionary.
1677+
So far we have used the basic types String and Number. Vim also supports
1678+
three composite types: List, Tuple and Dictionary.
16541679

16551680
A List is an ordered sequence of items. The items can be any kind of value,
16561681
thus you can make a List of numbers, a List of Lists and even a List of mixed
@@ -1751,6 +1776,23 @@ This looks into lines 1 to 50 (inclusive) and echoes any date found in there.
17511776

17521777
For further reading see |Lists|.
17531778

1779+
TUPLE
1780+
1781+
A Tuple is an immutable ordered sequence of items. An item can be of any
1782+
type. Items can be accessed by their index number. To create a Tuple with
1783+
three strings: >
1784+
1785+
var atuple = ('one', 'two', 'three')
1786+
1787+
The Tuple items are enclosed in parenthesis and separated by commas. To
1788+
create an empty Tuple: >
1789+
1790+
var atuple = ()
1791+
1792+
The |:for| loop can be used to iterate over the items in a Tuple similar to a
1793+
List.
1794+
1795+
For further reading see |Tuples|.
17541796

17551797
DICTIONARIES
17561798

0 commit comments

Comments
 (0)