[fpc-pascal] Case statements without constants?
ryan at thealchemistguild.com
Mon Oct 29 13:42:32 CET 2018
> On Oct 29, 2018, at 5:24 PM, R0b0t1 <r030t1 at gmail.com> wrote:
> 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”).
Under the hood I would think cases with variables should just perform as if..else statements but as was pointed out that would require a significant amount of work.
Just wanted to make sure I wasn’t going crazy because you’d think a person like me would know something so basic about Pascal by now.
More information about the fpc-pascal