Full pattern matching is likely very hard and slow too implement while switch statements are just an asm trick
There's something in between, where you preprocess several if statements in concatenated bools, then you reuse the asm trick on the resulting recomputed ints
https://forum.dlang.org/thread/fsjfcairmfcdwraxabdk@forum.dlang.org
switch(i%3==0,i%5==0){
case 1,1: return "fizzbuzz";
case 0,1: return "buzz";
case 1,0: return "fizz";
case ?,?: return i.to!string;
}
Full pattern matching is likely very hard and slow too implement while switch statements are just an asm trick
There's something in between, where you preprocess several if statements in concatenated bools, then you reuse the asm trick on the resulting recomputed ints
https://forum.dlang.org/thread/fsjfcairmfcdwraxabdk@forum.dlang.org