On Apr 9, 2021, at 9:55 AM, Remi Forax <fo...@univ-mlv.fr> wrote: > > I think the combinator should be lookupswitch which is more general than > tableswitch with a special case when generating the bytecode to generate a > tableswitch instead of a lookupswitch if the indexes are subsequent.
We can get there in the simpler steps Jorn has outlined. The combinator is much simpler if the case numbers are implicit in [0,N). Then it’s natural to filter on the [0,N) input as a separately factored choice. That also scales to pattern-switch. I agree with the choice to have N call sites. It’s possible to build the one call site version on top using constant combinators but not vice versa.