You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code used as example of a for loop does not compile on Zig 0.10.0 and therefore is not valid.
test "for" {
//character literals are equivalent to integer literals
const string = [_]u8{ 'a', 'b', 'c' };
for (string, 0..) |character, index| { // This line gives an error for the compiler expects ')' not a comma ',' after string.
_ = character;
_ = index;
}
The compiler complaints that there cannot be a comma after the string type inside the for loop declaration.
I don't know if this is due to a change that's now valid in nightly 0.11 but it does raises the question, what should the documentation be targeting. The moving nightly or a previous stable version. However not yet very well defined that concept might be right now.
The text was updated successfully, but these errors were encountered:
I just noticed that Ch. 0 states that the latest version of Zig is 0.10.1 then later on, in the installation instructions, suggests that the user should see an output to zig version of 0.11.0-dev.2777+b95cdf0ae after following the install procedure.
Which means that currently ziglearn tests and compiles correctly on zig-0.11.0-dev.3395+1e7dcaa3a but does not on 0.10.1
From the Zig-lang.org webpage:
Latest Release: 0.10.1
I think the user should be instructed to install the latest release, not the nightly development version.
But, it seems there's no interest on discussing this?
The following code used as example of a for loop does not compile on Zig 0.10.0 and therefore is not valid.
The compiler complaints that there cannot be a comma after the string type inside the for loop declaration.
I don't know if this is due to a change that's now valid in nightly 0.11 but it does raises the question, what should the documentation be targeting. The moving nightly or a previous stable version. However not yet very well defined that concept might be right now.
The text was updated successfully, but these errors were encountered: