<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                Haxe中的數組推導使用現有的語法使數組可以更簡潔的初始化。它通過 for 或者 while循環構造: > Array comprehension in Haxe uses existing syntax to allow concise initialization of arrays. It is identi?ed by for or while constructs: ~~~ class Main { static public function main() { var a = [for (i in 0...10) i]; trace(a); // [0,1,2,3,4,5,6,7,8,9] var i = 0; var b = [while(i < 10) i++]; trace(b); // [0,1,2,3,4,5,6,7,8,9] } } ~~~ 變量 a 是被初始化為一個數組,保存從0到9的數值。編譯器生成的代碼,添加每次循環迭代的值到數組中,所以跟下面的代碼是等價的: > Variable a is initialized to an array holding the numbers 0 to 9. The compiler generates code which adds the value of each loop iteration to the array, so the following code would be equivalent: ~~~ var a = []; for (i in 0...10) a.push(i); ~~~ 變量 b 是初始化為一個數組,保存同樣的值,但是通過一個不同的推導樣式,使用了 while 循環而不是 for 。再一次,跟如下的代碼是等效的: > Variable b is initialized toan array with the same values, but through a different comprehension style using while instead of for. Again, the following code would be equivalent: ~~~ var i = 0; var a = []; while(i < 10) a.push(i++); ~~~ 循環表達式可以是任何類型,包括條件和嵌套的循環,所以如下的內容會如預期運行: > The loop expression can be anything,including conditions and nested loops,so the following works as expected: ~~~ class Main { static public function main() { var a = [ for (a in 1...11) for(b in 2...4) if (a % b == 0) a+ "/" +b ]; // [2/2,3/3,4/2,6/2,6/3,8/2,9/3,10/2] trace(a); } } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看