We can have desestruct one day?

You can destructure tuples already:

const std = @import("std");

const S = struct { u8, i32 };

pub fn main() !void {
    const s = S{ 25, -500 };

    const a, var b = s;
    b += 1;
    std.debug.print("a: {d}\nb: {d}\n", .{ a, b });
}

See this post for more info: New Destructuring Syntax

6 Likes