bool concat patternmatching with switch

Dennis dkorpel at gmail.com
Wed May 29 08:59:10 UTC 2024


On Tuesday, 28 May 2024 at 19:39:45 UTC, monkyyy wrote:
> I propose syntax sugar where if you pass multible bools (and 
> maybe small enums), it will bitshift theses into int and call 
> the same basic asm pattern c used for its switch statements.

Something like that happens in DMD's source with an `X` function:

https://github.com/dlang/dmd/blob/d1f5a7ebd251b3df263a3c6ff87cac4aa9be309c/compiler/src/dmd/e2ir.d#L4770-L4792

You could generalize it up to 64 bits that way.


More information about the dip.ideas mailing list