[fpc-pascal] Case statements without constants?

Marco van de Voort marcov at stack.nl
Mon Oct 29 14:00:16 CET 2018


In our previous episode, Ryan Joseph said:
> > 
> > I think it is important to differentiate between a language feature
> > and its common implementation. Perhaps case statements with variables
> > make sense? Of course, that doesn't mean anyone is going to add them.
> 
> I?ve been programming Pascal since about 1995 and I never knew cases were
> an optimization or had any special meaning.  In my mind I thought they
> were just a nice way to do branching when there were lots of cases to
> check (hence the ?case statement?).

It is just like a for loop is not exactly like a naieve while loop because
the bounds are only evaluated once. Some details you only acquire as very
experienced programmer, or implementator.



More information about the fpc-pascal mailing list