Skip to content

Commit

Permalink
deploy: 11137f5
Browse files Browse the repository at this point in the history
  • Loading branch information
CYBAI committed Dec 15, 2023
1 parent 2734e97 commit b3a794b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ch03-01-variables-and-mutability.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ <h2 id="變數與可變性"><a class="header" href="#變數與可變性">變數
<p>當使用 <code>mut</code> 時,我們可以將 <code>x</code> 的數值從 <code>5</code> 改變為 <code>6</code>。何時使用可變性的決定權在你手上,你可以依照特定場合做出你認為最佳的選擇。</p>
<h3 id="常數"><a class="header" href="#常數">常數</a></h3>
<p><strong>常數(constants)</strong>。和不可變變數一樣,常數會讓數值與名稱綁定且不允許被改變,但是不可變變數與常數還是有些差異。</p>
<p>首先,你無法在使用常數使用 <code>mut</code>,常數不是預設不可變,它們永遠都不可變。如果你使用 <code>const</code> 宣告而非 <code>let</code> 的話,你<strong>必須</strong>指明型別。我們會在下一章<a href="ch03-02-data-types.html#%E8%B3%87%E6%96%99%E5%9E%8B%E5%88%A5">「資料型別」</a><!-- ignore -->詳細解釋型別與型別詮釋,所以現在先別擔心細節。你只需要先知道你永遠必須先詮釋常數的型別。</p>
<p>首先,你無法在常數使用 <code>mut</code>,常數不是預設不可變,它們永遠都不可變。如果你使用 <code>const</code> 宣告而非 <code>let</code> 的話,你<strong>必須</strong>指明型別。我們會在下一章<a href="ch03-02-data-types.html#%E8%B3%87%E6%96%99%E5%9E%8B%E5%88%A5">「資料型別」</a><!-- ignore -->詳細解釋型別與型別詮釋,所以現在先別擔心細節。你只需要先知道你永遠必須先詮釋常數的型別。</p>
<p>常數可以被定義在任一有效範圍,包含全域有效範圍。這讓它們非常有用,讓許多部分的程式碼都能夠知道它們。</p>
<p>最後一個差別是常數只能被常數表達式設置,而不能用任一在運行時產生的其他數值設置。</p>
<p>以下為一個常數名稱的範例:</p>
Expand Down
2 changes: 1 addition & 1 deletion print.html
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,7 @@ <h4 id="關鍵字keywords"><a class="header" href="#關鍵字keywords">關鍵字
<p>當使用 <code>mut</code> 時,我們可以將 <code>x</code> 的數值從 <code>5</code> 改變為 <code>6</code>。何時使用可變性的決定權在你手上,你可以依照特定場合做出你認為最佳的選擇。</p>
<h3 id="常數"><a class="header" href="#常數">常數</a></h3>
<p><strong>常數(constants)</strong>。和不可變變數一樣,常數會讓數值與名稱綁定且不允許被改變,但是不可變變數與常數還是有些差異。</p>
<p>首先,你無法在使用常數使用 <code>mut</code>,常數不是預設不可變,它們永遠都不可變。如果你使用 <code>const</code> 宣告而非 <code>let</code> 的話,你<strong>必須</strong>指明型別。我們會在下一章<a href="ch03-02-data-types.html#%E8%B3%87%E6%96%99%E5%9E%8B%E5%88%A5">「資料型別」</a><!-- ignore -->詳細解釋型別與型別詮釋,所以現在先別擔心細節。你只需要先知道你永遠必須先詮釋常數的型別。</p>
<p>首先,你無法在常數使用 <code>mut</code>,常數不是預設不可變,它們永遠都不可變。如果你使用 <code>const</code> 宣告而非 <code>let</code> 的話,你<strong>必須</strong>指明型別。我們會在下一章<a href="ch03-02-data-types.html#%E8%B3%87%E6%96%99%E5%9E%8B%E5%88%A5">「資料型別」</a><!-- ignore -->詳細解釋型別與型別詮釋,所以現在先別擔心細節。你只需要先知道你永遠必須先詮釋常數的型別。</p>
<p>常數可以被定義在任一有效範圍,包含全域有效範圍。這讓它們非常有用,讓許多部分的程式碼都能夠知道它們。</p>
<p>最後一個差別是常數只能被常數表達式設置,而不能用任一在運行時產生的其他數值設置。</p>
<p>以下為一個常數名稱的範例:</p>
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion searchindex.json

Large diffs are not rendered by default.

0 comments on commit b3a794b

Please sign in to comment.