Last active
July 30, 2024 20:43
-
-
Save softprops/a91ff0ac5aab4d19245674a62ff8f077 to your computer and use it in GitHub Desktop.
what multi object if captures could look like if they worked the same way as multi capture for expressions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
pub fn main() void { | |
const maybeA: ?u8 = 1; | |
const maybeB: ?u8 = 2; | |
const maybeC: ?u8 = 3; | |
if (maybeA, maybeB, maybeC) |a, b, c| { | |
std.debug.print("{d} {d} {d}\n", .{ a, b, c}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment