Skip to content

Commit 6b2770c

Browse files
committed
fixup! usr_{41,45,46,90,toc}.jax:Update vim 8.2.1114 version help translate
1 parent d2d8617 commit 6b2770c

File tree

2 files changed

+13
-20
lines changed

2 files changed

+13
-20
lines changed

dict.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,6 @@ Vim script:
216216
- Vim スクリプト
217217
- Vimスクリプト
218218

219-
Vim9 script:
220-
- VIM9 スクリプト
221-
- VIM9スクリプト
222-
- Vim9 スクリプト
223-
- Vim9スクリプト
224-
225219
チャネル:
226220
- チャンネル
227221

doc/usr_46.jax

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -123,36 +123,35 @@ Vim9 script の変数は一度だけ `:let` もしくは `:const` コマンド
123123
に変換し、そして任意の文字列は数値ではないため結果が0になるのです!
124124

125125
`:def` だと型チェックが関数のコンパイル時に行われます。それによってあなたは引
126-
数の型と戻り値の型の指定が必要になります。また引数は "a:" のプリフィックスが不
127-
要だと注意されます: >
126+
数の型と戻り値の型の指定が必要になります。また引数は "a:" のプリフィックス無し
127+
で使われることに注意してください: >
128128
let s:collected = ''
129129
def ExtendAndReturn(add: string): string
130130
s:collected += add
131131
return s:collected
132132
enddef
133133
defcompile
134134
135-
Here we use `:defcompile` to do the compilation right away, without it the
136-
compilation would happen when the function is called. Vim will tell you what
137-
you did wrong: >
135+
ここで利用している `:defcompile` はコンパイルするたの手段で、コンパイルさせる
136+
のに関数を呼ばなくていいです。Vim はあなたが間違っていると警告します: >
138137
E1013: type mismatch, expected number but got string
139138
140-
Vim9 script is strict, it uses the "+" operator only for numbers and floats.
141-
For string concatenation ".." must be used. This avoids mistakes and avoids
142-
the automatic conversion that gave a surprising result above. So you change
143-
the first line of the function to: >
139+
Vim9 script は厳密で、"+" 演算子は数値か浮動小数点数でしか使えません。文字の結
140+
合であれば ".." を使わなくてはなりません。これが間違いの回避と上にあるような驚
141+
きの結果をもたらす自動型変換を回避します。そして関数の最初の行をこう変化させれ
142+
: >
144143
s:collected ..= add
145-
And now it works.
144+
動くようになります。
146145

147-
If the function does not return anything, just leave out the return type: >
146+
もし関数がなにも返さないなら、戻り値の型は無くてよいです: >
148147
def ReportResult(result: string)
149148
echo 'The result is: ' .. result
150149
enddef
151150
152-
This is also checked, if you try to return a value you'll get an error.
151+
これもまたチェックされ、もし値を返そうとすると、エラーとなるでしょう。
153152

154-
In case you don't care about types or have a function that does work with
155-
multiple types, you can use the "any" type: >
153+
あなたが型をケアしない場合や関数が多型で動くなら、"any" 型を使うことができます:
154+
>
156155
def Store(key: string, value: any)
157156
resultDict[key] = value
158157
enddef

0 commit comments

Comments
 (0)