Skip to content

If expression in std.debug.print tuple only evaluated once #6853

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
travv0 opened this issue Oct 28, 2020 · 1 comment
Closed

If expression in std.debug.print tuple only evaluated once #6853

travv0 opened this issue Oct 28, 2020 · 1 comment

Comments

@travv0
Copy link
Contributor

travv0 commented Oct 28, 2020

var i: usize = 0;
while (i < 10) : (i += 1) {
    std.debug.print("{}", .{if (i % 2 == 0) "#" else "."});
}

prints ##########

@travv0
Copy link
Contributor Author

travv0 commented Oct 28, 2020

Closing since this seems related to #3882

@travv0 travv0 closed this as completed Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant