From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00,INVALID_MSGID, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,8077d2e20cde67b1 X-Google-Attributes: gid103376,public From: Robert A Duff Subject: Re: Modular types inside records Date: 2000/10/24 Message-ID: #1/1 X-Deja-AN: 685248656 Sender: bobduff@world.std.com (Robert A Duff) References: <8FD47616EPablo@213.25.200.9> <8ss7fb$5c7$1@nnrp1.deja.com> <8FD4BD4F4Pablo@213.25.200.9> <8FD6C49EFPablo@213.25.200.9> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 2000-10-24T00:00:00+00:00 List-Id: niewiap@widzew.net (Pawe� Niewiadomski) writes: > I don't think that adding a couple of if statements makes the code more > readable. Or a couple of "mod" operators. >... On the contrary: if someone looks at the record and sees a > modular type, he says: OK, so I don't have to worry about constraint > errors; I can get down to the important stuff. When I see a modular type, I say: OK, so I don't have to worry about constraint errors; I have to worry about wrong answers. Half :-). >... My implementations of the > empty and full functions are just one-line-long and add and remove > procedures each take up as much as five lines of code. Imagine what they > would look like if you had to check for constraint errors every time. I don't understand that -- you don't *check* for C_E, you write the code so it doesn't cause C_E. - Bob