Variadic Switch

(pydong.org)

31 points | by Tsche a day ago ago

2 comments

  • david2ndaccount 5 hours ago ago

    In D, you can just do a static foreach over a sequence to generate case labels:

    https://d.godbolt.org/z/PxWEW14K1

  • PeterWhittaker 3 hours ago ago

    I find the article very interesting and informative but, honestly, of all of the approaches, I find the basic switch to be the most readable and likely the most maintainable, at least for this case.