Skip to content

Instantly share code, notes, and snippets.

@softprops
Last active July 30, 2024 20:43
Show Gist options
  • Save softprops/a91ff0ac5aab4d19245674a62ff8f077 to your computer and use it in GitHub Desktop.
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
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