var x: ?u8 = null;
var y: ?i32 = null;
if(x y) |a b| {
}
Be able go handle more that one
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.
Please change the topic title to something meaningful, it should tell the reader what this topic is about.
Previous related topics:
Thanks didn’t know about this format. Even if it does give me the ick
.
Responding to say that I like your proposal also, a pattern ive run into wanting a few times.
Maybe we could just add so it will capture in order?
var op1: ?u8 = null;
var op2: ?i32 = null;
var boolean: bool = false;
var num = getRandomNumber(0, 100);
if(op1, boolean, num == 42, op2) |x, y| {
...
}