for

    1. Test 1/3 for basics...OK
    2. Test 2/3 for reference...OK
    3. Test 3/3 for else...OK

    When a loop is labeled, it can be referenced from a break or continue from within a nested loop:

    1. $ zig test test.zig
    2. Test 1/2 nested break...OK
    3. All tests passed.

    inline for

    For loops can be inlined. This causes the loop to be unrolled, which allows the code to do some things which only work at compile time, such as use types as first class values. The capture value and iterator value of inlined for loops are compile-time known.

    1. $ zig test test.zig
    2. Test 1/1 inline for loop...OK

    It is recommended to use loops only for one of these reasons:

    • You need the loop to execute at for the semantics to work.
    • You have a benchmark to prove that forcibly unrolling the loop in this way is measurably faster.