Skip to content

Commit d3abd63

Browse files
committed
ci: generate pages at 07fe2e1 [ci skip]
1 parent 07fe2e1 commit d3abd63

File tree

1 file changed

+40
-40
lines changed

1 file changed

+40
-40
lines changed

public/1.9/book/variable-bindings.html

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ <h1 class="title">変数束縛</h1>
184184

185185
<!-- bind some value to a name, so it can be used later. `let` is -->
186186

187-
<!-- used to introduce a binding, just like this: -->
187+
<!-- used to introduce a binding, like this: -->
188188

189189
<p>事実上全ての「Hello World」でないRustのプログラムは <em>変数束縛</em> を使っています。
190190
変数束縛は何らかの値を名前へと束縛するので、後でその値を使えます。
@@ -219,30 +219,30 @@ <h1 id='パターン' class='section-header'><a href='#パターン'>パター
219219

220220
<!-- variable bindings have a few tricks up their sleeves. For example the -->
221221

222-
<!-- left-hand side of a `let` expression is a ‘[pattern][pattern]’, not just a -->
222+
<!-- left-hand side of a `let` statement is a ‘[pattern][pattern]’, not just a -->
223223

224224
<!-- variable name. This means we can do things like: -->
225225

226226
<p>多くの言語では変数束縛は <em>変数</em> と呼ばれるでしょうが、Rustの変数束縛は多少皮を被せてあります。
227-
例えば、 <code>let</code> の左側の式は<a href="patterns.html">パターン</a>」であって、ただの変数名ではありません。
228-
これはこのようなことが出来るということです</p>
227+
例えば、 <code>let</code> 文の左側は<a href="patterns.html">パターン</a>」であって、ただの変数名ではありません。
228+
これはこのようなことができるということです</p>
229229

230230
<span class='rusttest'>fn main() {
231231
let (x, y) = (1, 2);
232232
}</span><pre class='rust rust-example-rendered'>
233233
<span class='kw'>let</span> (<span class='ident'>x</span>, <span class='ident'>y</span>) <span class='op'>=</span> (<span class='number'>1</span>, <span class='number'>2</span>);</pre>
234234

235-
<!-- After this expression is evaluated, `x` will be one, and `y` will be two. -->
235+
<!-- After this statement is evaluated, `x` will be one, and `y` will be two. -->
236236

237237
<!-- Patterns are really powerful, and have [their own section][pattern] in the -->
238238

239-
<!-- book. We don’t need those features for now, so we’ll just keep this in the back -->
239+
<!-- book. We don’t need those features for now, so we’ll keep this in the back -->
240240

241241
<!-- of our minds as we go forward. -->
242242

243-
<p>パターン式が評価されたあと<code>x</code> は1になり、 <code>y</code> は2になります。
243+
<p>この文が評価されたあと<code>x</code> は1になり、 <code>y</code> は2になります。
244244
パターンは本当に強力で、本書には<a href="patterns.html">パターンのセクション</a>もあります。
245-
今のところこの機能は必要ないので頭の片隅に留めておいてだけいて下さい</p>
245+
今のところこの機能は必要ないので頭の片隅に留めておいてだけいてください</p>
246246

247247
<!-- # Type annotations -->
248248

@@ -259,11 +259,11 @@ <h1 id='型アノテーション' class='section-header'><a href='#型アノテ
259259

260260
<p>Rustは静的な型付言語であり、前もって型を与えておいて、それがコンパイル時に検査されます。
261261
じゃあなぜ最初の例はコンパイルが通るのでしょう?ええと、Rustには「型推論」と呼ばれるものがあります。
262-
型推論が型が何であるか判断出来るなら、型を書く必要はなくなります。</p>
262+
型推論が型が何であるか判断できるなら、型を書く必要はなくなります。</p>
263263

264264
<!-- We can add the type if we want to, though. Types come after a colon (`:`): -->
265265

266-
<p>書きたいなら型を書くことも出来ます。型はコロン(<code>:</code>)のあとに書きます。</p>
266+
<p>書きたいなら型を書くこともできます。型はコロン(<code>:</code>)のあとに書きます。</p>
267267

268268
<span class='rusttest'>fn main() {
269269
let x: i32 = 5;
@@ -311,7 +311,7 @@ <h1 id='型アノテーション' class='section-header'><a href='#型アノテ
311311

312312
<!-- infers are. -->
313313

314-
<p>この注釈と <code>let</code> の時に使う記法の類似性に留意して下さい
314+
<p>この注釈と <code>let</code> の時に使う記法の類似性に留意してください
315315
このようなコメントを書くのはRust的ではありませんが、時折理解の手助けのためにRustが推論する型をコメントで注釈します。</p>
316316

317317
<!-- # Mutability -->
@@ -365,7 +365,7 @@ <h1 id='可変性' class='section-header'><a href='#可変性'>可変性</a></h1
365365

366366
<!-- mutation, then the solution is quite easy: add `mut`. -->
367367

368-
<p>束縛がデフォルトでイミュータブルであるのは複合的な理由によるものですが、Rustの主要な焦点、安全性の一環だと考えることが出来ます
368+
<p>束縛がデフォルトでイミュータブルであるのは複合的な理由によるものですが、Rustの主要な焦点、安全性の一環だと考えることができます
369369
もし <code>mut</code> を忘れたらコンパイラが捕捉して、変更するつもりでなかったものを変更した旨を教えてくれます。
370370
束縛がデフォルトでミュータブルだったらコンパイラはこれを捕捉できません。
371371
もし <em>本当に</em> 変更を意図していたのなら話は簡単です。 <code>mut</code> をつけ加えればいいのです。</p>
@@ -395,7 +395,7 @@ <h1 id='束縛を初期化する' class='section-header'><a href='#束縛を初
395395

396396
<!-- Let’s try it out. Change your `src/main.rs` file to look like this: -->
397397

398-
<p>試してみましょう。 <code>src/main.rs</code> をいじってこのようにしてみて下さい</p>
398+
<p>試してみましょう。 <code>src/main.rs</code> をいじってこのようにしてみてください</p>
399399

400400
<span class='rusttest'>fn main() {
401401
let x: i32;
@@ -413,8 +413,8 @@ <h1 id='束縛を初期化する' class='section-header'><a href='#束縛を初
413413

414414
<!-- warning, but it will still print "Hello, world!": -->
415415

416-
<p>コマンドラインで <code>cargo build</code> を使ってビルド出来ます
417-
警告が出ますが、それでもまだ「Hello, world!」は印字されます</p>
416+
<p>コマンドラインで <code>cargo build</code> を使ってビルドできます
417+
警告が出ますが、それでもまだ「Hello, world!」は表示されます</p>
418418

419419
<pre><code class="language-text"> Compiling hello_world v0.0.1 (file:///home/you/projects/hello_world)
420420
src/main.rs:2:9: 2:10 warning: unused variable: `x`, #[warn(unused_variable)]
@@ -431,7 +431,7 @@ <h1 id='束縛を初期化する' class='section-header'><a href='#束縛を初
431431

432432
<p>Rustは一度も使われない変数について警告を出しますが、一度も使われないので人畜無害です。
433433
ところがこの <code>x</code> を使おうとすると事は一変します。やってみましょう。
434-
プログラムをこのように変更して下さい</p>
434+
プログラムをこのように変更してください</p>
435435

436436
<span class='rusttest'>fn main() {
437437
let x: i32;
@@ -447,7 +447,7 @@ <h1 id='束縛を初期化する' class='section-header'><a href='#束縛を初
447447

448448
<!-- And try to build it. You’ll get an error: -->
449449

450-
<p>そしてビルドしてみて下さい。このようなエラーが出る筈です</p>
450+
<p>そしてビルドしてみてください。このようなエラーが出るはずです</p>
451451

452452
<pre><code class="language-bash">$ cargo build
453453
Compiling hello_world v0.0.1 (file:///home/you/projects/hello_world)
@@ -481,25 +481,25 @@ <h1 id='束縛を初期化する' class='section-header'><a href='#束縛を初
481481

482482
<!-- arguments we pass to functions and macros, if you’re passing more than one. -->
483483

484-
<p>印字する文字列に2つの波括弧(<code>{}</code>、口髭という人もいます…(訳注: 海外の顔文字は横になっているので首を傾けて <code>{</code> を眺めてみて下さい。また、日本語だと「中括弧」と呼ぶ人もいますね))を入れました。
485-
Rustはこれを何かの値を入れて(interpolate、インターポーレート)くれという要求だと解釈します
486-
<em>文字列インターポーレーション</em> (String interpolation)はコンピュータサイエンスの用語で、「文字列の中に差し込む」という意味です。
487-
その後に続けてカンマ、そして <code>x</code> を置いて <code>x</code> がインターポーレートしようとしている値だと指示しています
484+
<p>表示する文字列に2つの波括弧(<code>{}</code>、口髭という人もいます…(訳注: 海外の顔文字は横になっているので首を傾けて <code>{</code> を眺めてみてください。また、日本語だと「中括弧」と呼ぶ人もいますね))を入れました。
485+
Rustはこれを、何かの値で補間(interpolate)してほしいのだと解釈します
486+
<em>文字列補間</em> (string interpolation)はコンピュータサイエンスの用語で、「文字列の間に差し込む」という意味です。
487+
その後に続けてカンマ、そして <code>x</code> を置いて <code>x</code> が補間に使う値だと指示しています
488488
カンマは2つ以上の引数を関数やマクロに渡す時に使われます。</p>
489489

490-
<!-- When you just use the curly braces, Rust will attempt to display the value in a -->
490+
<!-- When you use the curly braces, Rust will attempt to display the value in a -->
491491

492492
<!-- meaningful way by checking out its type. If you want to specify the format in a -->
493493

494494
<!-- more detailed manner, there are a [wide number of options available][format]. -->
495495

496-
<!-- For now, we'll just stick to the default: integers aren't very complicated to -->
496+
<!-- For now, we'll stick to the default: integers aren't very complicated to -->
497497

498498
<!-- print. -->
499499

500-
<p>単に波括弧だけを使った時は、Rustはインターポーレートされる値の型を調べて意味のある方法で表示しようとします
501-
フォーマットをさらに詳しく指定したいなら<a href="../std/fmt/index.html">数多くのオプションが利用出来ます</a>
502-
とりあえずのところ、デフォルトに従いましょう。整数の印字はそれほど複雑ではありません</p>
500+
<p>波括弧を使うと、Rustは補間に使う値の型を調べて意味のある方法で表示しようとします
501+
フォーマットをさらに詳しく指定したいなら<a href="../std/fmt/index.html">数多くのオプションが利用できます</a>
502+
とりあえずのところ、デフォルトに従いましょう。整数の表示はそれほど複雑ではありません</p>
503503

504504
<!-- # Scope and shadowing -->
505505

@@ -519,7 +519,7 @@ <h1 id='スコープとシャドーイング' class='section-header'><a href='#
519519
<p>束縛に話を戻しましょう。変数束縛にはスコープがあります。変数束縛は定義されたブロック内でしか有効でありません。
520520
ブロックは <code>{</code><code>}</code> に囲まれた文の集まりです。関数定義もブロックです!
521521
以下の例では異なるブロックで有効な2つの変数束縛、 <code>x</code><code>y</code> を定義しています。
522-
<code>x</code><code>fn main() {}</code> ブロックの中でアクセス可能ですが、 <code>y</code> は内側のブロックからのみアクセス出来ます</p>
522+
<code>x</code><code>fn main() {}</code> ブロックの中でアクセス可能ですが、 <code>y</code> は内側のブロックからのみアクセスできます</p>
523523

524524
<span class='rusttest'>fn main() {
525525
let x: i32 = 17;
@@ -548,8 +548,8 @@ <h1 id='スコープとシャドーイング' class='section-header'><a href='#
548548

549549
<!-- Instead we get this error: -->
550550

551-
<p>最初の <code>println!</code> は「The value of x is 17 and the value of y is 3」(訳注: 「xの値は17でyの値は3」)と印字する筈ですが
552-
2つめの <code>println!</code><code>y</code> がもうスコープにいないため <code>y</code> にアクセス出来ないのでこの例はコンパイル出来ません
551+
<p>最初の <code>println!</code> は「The value of x is 17 and the value of y is 3」(訳注: 「xの値は17でyの値は3」)と表示するはずですが
552+
2つめの <code>println!</code><code>y</code> がもうスコープにいないため <code>y</code> にアクセスできないのでこの例はコンパイルできません
553553
代わりに以下のようなエラーが出ます。</p>
554554

555555
<pre><code class="language-bash">$ cargo build
@@ -576,33 +576,33 @@ <h1 id='スコープとシャドーイング' class='section-header'><a href='#
576576

577577
<!-- scope, will override the previous binding. -->
578578

579-
<p>さらに加えて、変数束縛は覆い隠すことが出来ます(訳注: このことをシャドーイングと言います)。
579+
<p>さらに加えて、変数束縛は覆い隠すことができます(訳注: このことをシャドーイングと言います)。
580580
つまり後に出てくる同じ名前の変数束縛があるとそれがスコープに入り、以前の束縛を上書きするのです。</p>
581581

582582
<span class='rusttest'>fn main() {
583583
let x: i32 = 8;
584584
{
585585
// println!(&quot;{}&quot;, x); // Prints &quot;8&quot;
586-
println!(&quot;{}&quot;, x); // &quot;8&quot;を印字する
586+
println!(&quot;{}&quot;, x); // &quot;8&quot;を表示する
587587
let x = 12;
588588
// println!(&quot;{}&quot;, x); // Prints &quot;12&quot;
589-
println!(&quot;{}&quot;, x); // &quot;12&quot;を印字する
589+
println!(&quot;{}&quot;, x); // &quot;12&quot;を表示する
590590
}
591591
// println!(&quot;{}&quot;, x); // Prints &quot;8&quot;
592-
println!(&quot;{}&quot;, x); // &quot;8&quot;を印字する
592+
println!(&quot;{}&quot;, x); // &quot;8&quot;を表示する
593593
let x = 42;
594594
// println!(&quot;{}&quot;, x); // Prints &quot;42&quot;
595-
println!(&quot;{}&quot;, x); // &quot;42&quot;を印字する
595+
println!(&quot;{}&quot;, x); // &quot;42&quot;を表示する
596596
}</span><pre class='rust rust-example-rendered'>
597597
<span class='kw'>let</span> <span class='ident'>x</span>: <span class='ident'>i32</span> <span class='op'>=</span> <span class='number'>8</span>;
598598
{
599-
<span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>&quot;{}&quot;</span>, <span class='ident'>x</span>); <span class='comment'>// &quot;8&quot;を印字する</span>
599+
<span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>&quot;{}&quot;</span>, <span class='ident'>x</span>); <span class='comment'>// &quot;8&quot;を表示する</span>
600600
<span class='kw'>let</span> <span class='ident'>x</span> <span class='op'>=</span> <span class='number'>12</span>;
601-
<span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>&quot;{}&quot;</span>, <span class='ident'>x</span>); <span class='comment'>// &quot;12&quot;を印字する</span>
601+
<span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>&quot;{}&quot;</span>, <span class='ident'>x</span>); <span class='comment'>// &quot;12&quot;を表示する</span>
602602
}
603-
<span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>&quot;{}&quot;</span>, <span class='ident'>x</span>); <span class='comment'>// &quot;8&quot;を印字する</span>
603+
<span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>&quot;{}&quot;</span>, <span class='ident'>x</span>); <span class='comment'>// &quot;8&quot;を表示する</span>
604604
<span class='kw'>let</span> <span class='ident'>x</span> <span class='op'>=</span> <span class='number'>42</span>;
605-
<span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>&quot;{}&quot;</span>, <span class='ident'>x</span>); <span class='comment'>// &quot;42&quot;を印字する</span></pre>
605+
<span class='macro'>println</span><span class='macro'>!</span>(<span class='string'>&quot;{}&quot;</span>, <span class='ident'>x</span>); <span class='comment'>// &quot;42&quot;を表示する</span></pre>
606606

607607
<!-- Shadowing and mutable bindings may appear as two sides of the same coin, but -->
608608

@@ -612,8 +612,8 @@ <h1 id='スコープとシャドーイング' class='section-header'><a href='#
612612

613613
<!-- is also possible to change the mutability of a binding. -->
614614

615-
<p>シャドーイングとミュータブルな束縛はコインの表と裏のように見えるかもしれませんが、それぞれ独立な概念であり互いに代用が出来ないケースがあります
616-
その1つにシャドーイングは同じ名前に違う型の値を再束縛することが出来ます</p>
615+
<p>シャドーイングとミュータブルな束縛はコインの表と裏のように見えるかもしれませんが、それぞれ独立な概念であり互いに代用ができないケースがあります
616+
その1つにシャドーイングは同じ名前に違う型の値を再束縛することができます</p>
617617

618618
<span class='rusttest'>fn main() {
619619
let mut x: i32 = 1;

0 commit comments

Comments
 (0)