Skip to content

Commit 0241967

Browse files
committed
Update
1 parent 3b8def0 commit 0241967

2 files changed

Lines changed: 57 additions & 56 deletions

File tree

doc/vim9.jax

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2528,31 +2528,32 @@ FlexArgs が最初に文字列引数を受け取り、次にリスト引数を
25282528
vim9 9->get(9) # E1531: Argument of get() must be a
25292529
vim9 9->tuple2list() # E1534: Tuple required for argument
25302530
<
2531-
Reserved for future use: *E1227* *E1250* *E1252*
2531+
将来の使用のために予約済み: *E1227* *E1250* *E1252*
25322532
E1227: List or Dictionary required for argument %d
25332533
E1250: Argument of %s must be a List, String, Dictionary or Blob
25342534
E1252: String, List or Blob required for argument %d
25352535

25362536

2537-
Categories of variables, defaults and null handling ~
2537+
変数、デフォルト、および null 処理のカテゴリ ~
25382538
*variable-categories* *null-variables*
2539-
There are three categories of variables:
2540-
primitive number, float, boolean
2541-
container string, blob, list, tuple, dict
2542-
specialized function, job, channel, user-defined-object
2539+
変数には 3 つのカテゴリがある:
2540+
プリミティブ型 数値、浮動小数点数、ブール値
2541+
コンテナ型 文字列、blob、リスト、tuple、辞書
2542+
特殊型 関数、ジョブ、チャネル、ユーザー定義オブジェクト
25432543

2544-
When declaring a variable without an initializer, an explicit type must be
2545-
provided. Each category has different default initialization semantics.
2544+
初期化子なしで変数を宣言する場合は、明示的に型を指定する必要がある。各カテゴリ
2545+
には異なるデフォルトの初期化セマンティクスがある。
25462546

2547-
Primitives default to type-specific values. All primitives are empty but do
2548-
not equal `null`: >vim9
2547+
プリミティブ型は、デフォルトで型固有の値になります。すべてのプリミティブ型は空
2548+
ですが、`null` と等しくはない: >vim9
25492549

25502550
vim9script
25512551
var n: number | echo [n, n->empty(), n == null] # [0, 1, false]
25522552
var f: float | echo [f, f->empty(), f == null] # [0.0, 1, false]
25532553
var b: bool | echo [b, b->empty(), b == null] # [false, 1, false]
25542554
<
2555-
Containers default to an empty container. Only an empty string equals `null`: >vim9
2555+
コンテナ型はデフォルトで空のコンテナになる。空の文字列のみが `null` と等しくな
2556+
る: >vim9
25562557

25572558
vim9script
25582559
var s: string | echo [s, s->empty(), s == null] # ['', 1, true]
@@ -2561,7 +2562,7 @@ Containers default to an empty container. Only an empty string equals `null`: >
25612562
var t: tuple<any> | echo [t, t->empty(), t == null] # [(), 1, false]
25622563
var d: dict<number> | echo [d, d->empty(), d == null] # [{}, 1, false]
25632564
<
2564-
Specialized types default to equaling `null`: >vim9
2565+
特殊型はデフォルトで `null` になる: >vim9
25652566

25662567
vim9script
25672568
var F: func | echo [F, F == null] # [function(''), true]
@@ -2574,20 +2575,20 @@ Specialized types default to equaling `null`: >vim9
25742575
endenum
25752576
var e: Enum | echo [e, e == null] # [object of [unknown], true]
25762577
<
2577-
Note: See |empty()| for explanations of empty job, empty channel, and
2578-
empty object types.
2578+
Note: 空のジョブ、空のチャネル、空のオブジェクト型の説明について
2579+
は、|empty()| を参照。
25792580

2580-
Vim does not have a familiar null value. Instead, it has various null_<type>
2581-
predefined values including |null_string|, |null_list|, and |null_job|.
2582-
Primitives do not have a null_<type>. Typical use cases for null_<type> are:
2583-
- to clear a variable and release its resources,
2584-
- as a default for a parameter in a function definition (for an example,
2585-
see |null_blob|), or
2586-
- assigned to a container or specialized variable to set it to null
2587-
for later comparison (for an example, see |null-compare|).
2581+
Vim にはお馴染みの null 値はない。代わりに、|null_string||null_list|
2582+
|null_job| など、様々な null_<type> 型の定義済み値がある。プリミティブ型には
2583+
null_<type> 型はない。null_<type> 型の典型的な使用例は以下のとおりである:
2584+
- 変数をクリアしてリソースを解放する。
2585+
- 関数定義のパラメータのデフォルトとして使用する (例については |null_blob|
2586+
を参照)。
2587+
- コンテナ型または特殊型に割り当てて、後の比較のために null に設定する (例
2588+
については |null-compare| を参照)。
25882589

2589-
For a specialized variable, like `job`, null_<type> is used to clear the
2590-
resources. For example: >vim9
2590+
`job` のような特殊な変数の場合、リソースをクリアするために null_<type> が使用
2591+
される。例: >vim9
25912592

25922593
vim9script
25932594
var mydate: list<string>
@@ -2599,63 +2600,62 @@ resources. For example: >vim9
25992600
sleep 2
26002601
echo $"The date and time is {mydate->join('')}"
26012602
echo [myjob, myjob->job_status()]
2602-
myjob = null_job # Clear the variable; release the job's resources.
2603+
myjob = null_job # 変数をクリアし、ジョブのリソースを解放する。
26032604
echo myjob
26042605
<
2605-
For a container variable, resources may also be cleared by assigning an
2606-
empty container to the variable. For example: >vim9
2606+
コンテナ変数の場合、変数に空のコンテナを割り当てることによってリソースをクリア
2607+
することもできる。例: >vim9
26072608

26082609
vim9script
26092610
var perfect: list<number> = [1, 4]
26102611
perfect->extend([9, 16, 25])
26112612
perfect = []
26122613
echo perfect
26132614

2614-
Using an empty container, rather than null_<type>, to clear a container
2615-
variable may avoid null complications - see |null-anomalies|.
2615+
null_<type> ではなく空のコンテナを使用してコンテナ変数をクリアすると、null の
2616+
複雑さを回避できる場合がある - |null-anomalies| を参照。
26162617

2617-
The initialization semantics of container variables and specialized variables
2618-
differ. For containers:
2619-
- An uninitialized container defaults to empty but does not equal `null`
2620-
(except for a uninitialized string).
2621-
- A container initialized to [], (), {}, "", or 0z is empty but does not
2622-
equal `null`.
2623-
- A container initialized as null_<type> defaults to empty and equals `null`.
2618+
コンテナ変数と特殊変数の初期化セマンティクスは異なる。コンテナの場合:
2619+
- 初期化されていないコンテナはデフォルトで空になるが、`null` と等しくない
2620+
(初期化されていない文字列を除く)。
2621+
- []、()、{}、""、または 0z に初期化されたコンテナは空だが、`null` と等しく
2622+
ない。
2623+
- null_<type> として初期化されたコンテナはデフォルトで空になり、`null` と等
2624+
しくなる。
26242625

2625-
In the following example, the uninitialized list ("lu") and [] initialized
2626-
list ("li") are equivalent and indistinguishable whereas "ln" is a null
2627-
container, which is similar to, but not equivalent to, an empty container
2628-
(see |null-anomalies|). >vim9
2626+
以下の例では、初期化されていないリスト ("lu") と [] 初期化されたリスト ("li")
2627+
は同等であり区別できないが、"ln" は null コンテナであり、空のコンテナに似てい
2628+
るが同等ではない (|null-anomalies| を参照)。 >vim9
26292629

26302630
vim9script
2631-
# uninitialized: empty container, not null
2631+
# 初期化されていない: 空のコンテナ、null ではない
26322632
var lu: list<any>
26332633
echo ['lu', $"empty={lu->empty()}", $"null={lu == null}"]
2634-
# initialized: empty container, not null
2634+
# 初期化済み: 空のコンテナ、null ではない
26352635
var li: list<any> = []
26362636
echo ['li', $"empty={li->empty()}", $"null={li == null}"]
2637-
# initialized: empty container, null
2637+
# 初期化済み: 空のコンテナ、null
26382638
var ln: list<any> = null_list
26392639
echo ['ln', $"empty={ln->empty()}", $"null={ln == null}"]
26402640
<
2641-
Specialized variables default to equaling null. These job initializations
2642-
are equivalent and indistinguishable: >vim9
2641+
特殊変数はデフォルトで null になる。以下のジョブ初期化は同等であり、区別できな
2642+
: >vim9
26432643

26442644
vim9script
26452645
var j1: job
26462646
var j2: job = null_job
26472647
var j3 = null_job
2648-
echo (j1 == j2) == (j2 == j3) # true (equivalent, indistinguishable)
2648+
echo (j1 == j2) == (j2 == j3) # true (同等、区別不能)
26492649
<
2650-
When a list, tuple, or dict is declared, if the item type is not specified
2651-
it cannot be inferred. Consequently, the item type defaults to "any": >vim9
2650+
リスト、tuple、または辞書を宣言する際に、項目の型が指定されていない場合は推論
2651+
できない。したがって、項目の型はデフォルトで "any" になる: >vim9
26522652

26532653
vim9script
26542654
var [t1, t2] = [(), null_tuple]
26552655
echo $'t1 is {t1->typename()} and t2 is {t2->typename()} too'
26562656
<
2657-
Tuples and functions (or partials) may be declared in various ways.
2658-
See |tuple-type|, |variadic-tuple|, and |vim9-func-declaration|.
2657+
Tuple と関数 (または部分関数) は様々な方法で宣言できる。|tuple-type|
2658+
|variadic-tuple|、および |vim9-func-declaration| を参照。
26592659

26602660
*null-compare*
26612661
For familiar null compare semantics, where an empty container is not equal to
@@ -3049,7 +3049,7 @@ Vim9 クラスのメソッドはジェネリック関数になることができ
30493049
==============================================================================
30503050

30513051
6. 名前空間、Import と Export
3052-
*vim9script* *vim9-export* *vim9-import*
3052+
*vim9script* *vim9-export* *vim9-import*
30533053

30543054
Vim9 script は、import されるように書くことができます。これは、いくつかの項目
30553055
が意図的に export され、他のスクリプトで利用できるようになることを意味します。

en/vim9.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2515,10 +2515,11 @@ following time: >vim9
25152515
FlexArgs = (...values: list<string>): string => join(values, ', ')
25162516
echo FlexArgs('3', '2', '1', 'GO!')
25172517
<
2518-
*E1211* *E1217* *E1218* *E1219* *E1220* *E1221* *E1222*
2519-
*E1223* *E1224* *E1225* *E1226* *E1228* *E1235* *E1238*
2520-
*E1251* *E1253* *E1256* *E1297* *E1298* *E1301* *E1528*
2521-
*E1529* *E1530* *E1531* *E1534*
2518+
*E1211* *E1217* *E1218* *E1219* *E1220*
2519+
*E1221* *E1222* *E1223* *E1224* *E1225*
2520+
*E1226* *E1228* *E1235* *E1238* *E1251*
2521+
*E1253* *E1256* *E1297* *E1298* *E1301*
2522+
*E1528* *E1529* *E1530* *E1531* *E1534*
25222523
Types are checked for most builtin functions to make it easier to spot
25232524
mistakes. The following one-line |:vim9| commands, calling builtin functions,
25242525
demonstrate many of those type-checking errors: >vim9
@@ -3077,7 +3078,7 @@ Currently, Vim does not support:
30773078
==============================================================================
30783079

30793080
6. Namespace, Import and Export
3080-
*vim9script* *vim9-export* *vim9-import*
3081+
*vim9script* *vim9-export* *vim9-import*
30813082

30823083
A Vim9 script can be written to be imported. This means that some items are
30833084
intentionally exported, made available to other scripts. When the exporting

0 commit comments

Comments
 (0)