It would be nice to have multi optional capture

var x: ?u8 = null;
var y: ?i32 = null;

if(x y) |a b| {

}

Be able go handle more that one

you can emulate this by chaining if-expressions:

if (x) |a| if (y) |b| { 

};

Though you do have to use semicolons in that case.

Might not later? some expressions should be statements instead · Issue #1755 · ziglang/zig · GitHub

1 Like

Please change the topic title to something meaningful, it should tell the reader what this topic is about.

Previous related topics:

1 Like

Thanks didn’t know about this format. Even if it does give me the ick :grinning_face_with_smiling_eyes:.

Responding to say that I like your proposal also, a pattern ive run into wanting a few times.

1 Like