Skip to content

Commit 4b925e5

Browse files
committed
Translate before *tuple*
1 parent 6218d8f commit 4b925e5

File tree

2 files changed

+68
-50
lines changed

2 files changed

+68
-50
lines changed

doc/eval.jax

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

33

44
VIMリファレンスマニュアル by Bram Moolenaar
@@ -19,9 +19,10 @@ Note: 式の評価はコンパイル時に無効化できる。無効化され
1919
1.1 変数の型
2020
1.2 関数への参照 |Funcref|
2121
1.3 リスト |Lists|
22-
1.4 辞書 |Dictionaries|
23-
1.5 Blobs |Blobs|
24-
1.6 変数について補足 |more-variables|
22+
1.4 Tuple |Tuples|
23+
1.5 辞書 |Dictionaries|
24+
1.6 Blob |Blobs|
25+
1.7 変数について補足 |more-variables|
2526
2. 式の文法 |expression-syntax|
2627
3. 内部変数 |internal-variables|
2728
4. 組み込み関数 |functions|
@@ -44,8 +45,8 @@ Note: 式の評価はコンパイル時に無効化できる。無効化され
4445

4546
1.1 変数の型 ~
4647
*E712* *E896* *E897* *E899* *E1098*
47-
*E1107* *E1135* *E1138*
48-
変数には10種類の型がある:
48+
*E1107* *E1135* *E1138* *E1523*
49+
変数には11種類の型がある:
4950

5051
*Number* *Integer*
5152
数値 32ビットまたは64ビットの符号有整数。|expr-number|
@@ -61,6 +62,10 @@ Note: 式の評価はコンパイル時に無効化できる。無効化され
6162
リスト 要素の順序つきの列。詳細は |List| を参照。
6263
例: [1, 2, ['a', 'b']]
6364

65+
Tuple 順序付けられた不変の項目のシーケンス。詳細については |Tuple|
66+
を参照。
67+
例: (1, 2, ('a', 'b'))
68+
6469
辞書 順序を持たない連想配列: 各要素はキーと値を持つ。|Dictionary|
6570
例:
6671
{'blue': "#0000ff", 'red': "#ff0000"}
@@ -159,16 +164,17 @@ Note: " " と "0" も空文字列ではないので、TRUE と見なされる。
159164

160165
*E611* *E745* *E728* *E703* *E729* *E730* *E731* *E908* *E910*
161166
*E913* *E974* *E975* *E976* *E1319* *E1320* *E1321* *E1322*
162-
*E1323* *E1324*
163-
リスト |List|, 辞書 |Dictionary|, |Funcref|, ジョブ |Job|, チャネル |Channel|,
164-
|Blob|, クラス |Class| および |object| は自動的に変換されない
167+
*E1323* *E1324* *E1520* *E1522*
168+
|List||Tuple||Dictionary||Funcref||Job||Channel||Blob||Class|
169+
および |object| 型は自動的に変換されない
165170

166171
*E805* *E806* *E808*
167172
数値と浮動小数点数をまぜると浮動小数点数になる。それ以外には浮動小数点数への自
168173
動的な変換は存在しない。文字列から浮動小数点数へは str2float() を使い、浮動小
169174
数点数から文字列へは printf() を、浮動小数点数から数値へは float2nr() を使う。
170175

171-
*E362* *E891* *E892* *E893* *E894* *E907* *E911* *E914*
176+
*E362* *E891* *E892* *E893* *E894*
177+
*E907* *E911* *E914* *E1521*
172178
浮動小数点数が予期されているところでは数値も使用可能だが、それ以外は使用できな
173179
い。
174180

@@ -260,9 +266,9 @@ Note 関数の辞書へのバインドは、その関数が辞書のメンバー
260266

261267
リストの作成 ~
262268
*E696* *E697*
263-
リストを作るには、[]の中にコンマで区切って要素を書く
269+
リストは、角括弧で囲まれたコンマで区切られた一連の項目で作成される
264270
例: >
265-
:let mylist = [1, two, 3, "four"]
271+
:let mylist = [1, "two", 3, "four"]
266272
:let emptylist = []
267273
268274
要素はどんな式でもよい。要素としてリストを指定すると、リストのリストができる:
@@ -309,29 +315,31 @@ Note 関数の辞書へのバインドは、その関数が辞書のメンバー
309315

310316
部分リスト ~
311317
*sublist*
312-
リストの一部分を取り出すには、[]の中に始点と終点のインデックスを書き、コロンで
313-
区切る: >
314-
:let shortlist = mylist[2:-1] " リスト[3, "four"]を得る
315-
316-
始点のインデックスを省略すると0となる。終点のインデックスを省略すると-1となる >
317-
:let endlist = mylist[2:] " 2番目から最後まで: [3, "four"]
318-
:let shortlist = mylist[2:2] " 1個の要素からなるリスト: [3]
318+
リストの一部を取得するには、角括弧でコロンで区切られた開始のインデックスと終了
319+
のインデックスを指定する: >
320+
:let shortlist = mylist[2:-1] " リスト [3, "four"] を得る
321+
322+
開始のインデックスを省略すると、0 と同じになる。終了のインデックスを省略する
323+
と、-1 と同じになる。 >
324+
:let endlist = mylist[2:] " 項目 2 から最後まで: [3, "four"]
325+
:let shortlist = mylist[2:2] " 1 項目のリスト: [3]
319326
:let otherlist = mylist[:] " リストのコピーを作る
320327
321-
最後のインデックスが含まれることに注意。排他的なインデックスを利用するなら
322-
|slice()| メソッドを利用する
328+
終了のインデックスは包括的であることに注意。排他的インデックスを使用する場合
329+
は、|slice()| 関数を使用する
323330

324-
終点のインデックスが始点のインデックスよりも前になってしまった場合は空リストと
325-
なる。エラーメッセージは表示されない。
331+
開始のインデックスがリストの終了の項目を超えている場合、または終了のインデック
332+
スが開始の項目より前である場合、結果は空のリストになる。エラーメッセージは表示
333+
されない。
326334

327-
終点のインデックスがリストの長さより大きい場合は、長さ-1を指定したときと同じに
328-
なる: >
335+
最後のインデックスがリストの長さ以上である場合は、長さから 1 を引いた値が使用
336+
される: >
329337
:let mylist = [0, 1, 2, 3]
330338
:echo mylist[2:8] " 結果: [2, 3]
331339
332-
NOTE: mylist[s:e]と書くと変数 "s:e" をインデックスとして使ったと解釈される。
333-
":" の前に1文字の変数を使うときは十分注意すること。必要ならこのようにスペース
334-
を入れるとよい: mylist[s : e].
340+
NOTE: mylist[s:e] と書くと変数 "s:e" をインデックスとして使ったと解釈される。
341+
":" の前に1文字の変数を使うときは十分注意すること。必要であればこのようにスペー
342+
スを入れるとよい: mylist[s : e].
335343

336344

337345
リストの同一性 ~
@@ -344,9 +352,9 @@ NOTE: mylist[s:e]と書くと変数 "s:e" をインデックスとして使っ
344352
:echo bb
345353
< [1, 2, 3, 4]
346354

347-
リストのコピーを作るには関数|copy()|を使う。前述の通り[:]を使ってもできる。
348-
れは浅いコピーである。つまりリストの要素であるリストに変更を加えると、コピーさ
349-
れたリスト内の同じ要素も変更される: >
355+
リストのコピーを作るには関数 |copy()| を使う。前述の通り [:] を使ってもできる。
356+
これは浅いコピーである。つまりリストの要素であるリストに変更を加えると、コピー
357+
されたリスト内の同じ要素も変更される: >
350358
:let aa = [[1, 'a'], 2, 3]
351359
:let bb = copy(aa)
352360
:call add(aa, 4)
@@ -448,8 +456,8 @@ Note リストの比較について注意: 2つのリストは、同じ長さを
448456
449457
for ループ ~
450458

451-
|:for| ループは、リスト、文字列または Blob の各要素に対してコマンドを実行する。
452-
変数に各要素が順番に代入される。リストを使った例: >
459+
|:for| ループは、リスト、Tuple、文字列または Blob の各要素に対してコマンドを実
460+
行する。変数に各要素が順番に代入される。リストを使った例: >
453461
:for item in mylist
454462
: call Doit(item)
455463
:endfor
@@ -482,6 +490,8 @@ for ループ ~
482490
: endif
483491
:endfor
484492
493+
Tuple の場合、一度に 1 つのタプル項目が使用される。
494+
485495
Blob の場合、一度に 1 バイトが使われる。
486496

487497
文字列の場合、任意の合成文字を含む 1 文字が文字列として使われる。例: >

en/eval.txt

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*eval.txt* For Vim version 9.1. Last change: 2025 Feb 23
1+
*eval.txt* For Vim version 9.1. Last change: 2025 Mar 30
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -21,9 +21,10 @@ a remark is given.
2121
1.1 Variable types
2222
1.2 Function references |Funcref|
2323
1.3 Lists |Lists|
24-
1.4 Dictionaries |Dictionaries|
25-
1.5 Blobs |Blobs|
26-
1.6 More about variables |more-variables|
24+
1.4 Tuples |Tuples|
25+
1.5 Dictionaries |Dictionaries|
26+
1.6 Blobs |Blobs|
27+
1.7 More about variables |more-variables|
2728
2. Expression syntax |expression-syntax|
2829
3. Internal variable |internal-variables|
2930
4. Builtin Functions |functions|
@@ -46,8 +47,8 @@ Profiling is documented at |profiling|.
4647

4748
1.1 Variable types ~
4849
*E712* *E896* *E897* *E899* *E1098*
49-
*E1107* *E1135* *E1138*
50-
There are ten types of variables:
50+
*E1107* *E1135* *E1138* *E1523*
51+
There are eleven types of variables:
5152

5253
*Number* *Integer*
5354
Number A 32 or 64 bit signed number. |expr-number|
@@ -63,6 +64,10 @@ String A NUL terminated string of 8-bit unsigned characters (bytes).
6364
List An ordered sequence of items, see |List| for details.
6465
Example: [1, 2, ['a', 'b']]
6566

67+
Tuple An ordered immutable sequence of items, see |Tuple| for
68+
details.
69+
Example: (1, 2, ('a', 'b'))
70+
6671
Dictionary An associative, unordered array: Each entry has a key and a
6772
value. |Dictionary|
6873
Examples:
@@ -165,16 +170,17 @@ A List, Dictionary or Float is not a Number or String, thus evaluate to FALSE.
165170

166171
*E611* *E745* *E728* *E703* *E729* *E730* *E731* *E908* *E910*
167172
*E913* *E974* *E975* *E976* *E1319* *E1320* *E1321* *E1322*
168-
*E1323* *E1324*
169-
|List|, |Dictionary|, |Funcref|, |Job|, |Channel|, |Blob|, |Class| and
170-
|object| types are not automatically converted.
173+
*E1323* *E1324* *E1520* *E1522*
174+
|List|, |Tuple|, |Dictionary|, |Funcref|, |Job|, |Channel|, |Blob|, |Class|
175+
and |object| types are not automatically converted.
171176

172177
*E805* *E806* *E808*
173178
When mixing Number and Float the Number is converted to Float. Otherwise
174179
there is no automatic conversion of Float. You can use str2float() for String
175180
to Float, printf() for Float to String and float2nr() for Float to Number.
176181

177-
*E362* *E891* *E892* *E893* *E894* *E907* *E911* *E914*
182+
*E362* *E891* *E892* *E893* *E894*
183+
*E907* *E911* *E914* *E1521*
178184
When expecting a Float a Number can also be used, but nothing else.
179185

180186
*no-type-checking*
@@ -267,9 +273,9 @@ position in the sequence.
267273

268274
List creation ~
269275
*E696* *E697*
270-
A List is created with a comma-separated list of items in square brackets.
276+
A List is created with a comma-separated sequence of items in square brackets.
271277
Examples: >
272-
:let mylist = [1, two, 3, "four"]
278+
:let mylist = [1, "two", 3, "four"]
273279
:let emptylist = []
274280
275281
An item can be any expression. Using a List for an item creates a
@@ -327,13 +333,13 @@ similar to -1. >
327333
:let otherlist = mylist[:] " make a copy of the List
328334
329335
Notice that the last index is inclusive. If you prefer using an exclusive
330-
index use the |slice()| method.
336+
index use the |slice()| function.
331337

332-
If the first index is beyond the last item of the List or the second item is
338+
If the first index is beyond the last item of the List or the last index is
333339
before the first item, the result is an empty list. There is no error
334340
message.
335341

336-
If the second index is equal to or greater than the length of the list the
342+
If the last index is equal to or greater than the length of the list the
337343
length minus one is used: >
338344
:let mylist = [0, 1, 2, 3]
339345
:echo mylist[2:8] " result: [2, 3]
@@ -463,8 +469,8 @@ Changing the order of items in a list: >
463469
464470
For loop ~
465471

466-
The |:for| loop executes commands for each item in a List, String or Blob.
467-
A variable is set to each item in sequence. Example with a List: >
472+
The |:for| loop executes commands for each item in a List, Tuple, String or
473+
Blob. A variable is set to each item in sequence. Example with a List: >
468474
:for item in mylist
469475
: call Doit(item)
470476
:endfor
@@ -497,6 +503,8 @@ It is also possible to put remaining items in a List variable: >
497503
: endif
498504
:endfor
499505
506+
For a Tuple one tuple item at a time is used.
507+
500508
For a Blob one byte at a time is used.
501509

502510
For a String one character, including any composing characters, is used as a

0 commit comments

Comments
 (0)