gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gm2] Fwd: CASE: gm2-4.1.2 of 2011-11-08 bug (or possibly philosophi


From: Gary E Rudy
Subject: Re: [Gm2] Fwd: CASE: gm2-4.1.2 of 2011-11-08 bug (or possibly philosophical difference)
Date: Sat, 12 Nov 2011 21:39:55 -0500

At 06:10 AM 11/11/2011, you wrote:

ItemType = RECORD CASE : INTEGER OF
1: ....
2: ....
    END(*CASE*); END(*RECORD*)

This checking is very easy to bypass with:

ItemType = RECORD CASE : INTEGER OF
1: ....
2: ....
ELSE (* Do nothing, I don't care! *)
    END(*CASE*); END(*RECORD*)

As long as its an option I certainly don't see any reason not to have it available.

I found this very annoying when I first moved to a more ISO aware compiler, but I eventually found it at least somewhat useful. The compiler I use (Stonybrook) makes it very easy to turn this checking on and off in the code on a case by case basis (no pun intended :). Eventually I just started adding the empty ELSE clause where I didn't want it, though, very simple. If you do add the checking, do make sure it takes that into account!

Obviously it's original purpose, and where it CAN be somewhat useful is with enumerated types to make sure you don't simply omit one by mistake, or forget to adjust all of your code when a new value is added to the type later on.

--Foo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]