Sobeston / zig.guide

Repo for https://zig.guide content. Get up to speed with Zig quickly.
https://zig.guide
MIT License
689 stars 177 forks source link

Chapter 1: incorrect For loop syntax #177

Closed KTheRD closed 1 year ago

KTheRD commented 1 year ago

Chapter 1 has this code:

for (string, 0..) |character, index| {
    _ = character;
    _ = index;
}

Compiler fails to parse with error: expected ')', found ','. Maybe it was meant to be string[0..] instead of string, 0...

thechampagne commented 1 year ago

This is syntax has introduced in zig 0.11.x

KTheRD commented 1 year ago

Oh, thanks. Then maybe marking not yet available features would be good?

thechampagne commented 1 year ago

@KTheRD In chapter 0: This guide assumes you’re using a master build of Zig as opposed to the latest major release, which means downloading a binary from the site or compiling from source; the version of Zig in your package manager is likely outdated. This guide does not support Zig 0.10.1

KTheRD commented 1 year ago

Thanks, I oversighted that!