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/23 Message-ID: #1/1 X-Deja-AN: 684837529 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> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 2000-10-23T00:00:00+00:00 List-Id: niewiap@widzew.net (Pawe� Niewiadomski) writes: > Pretty neat, huh? Not as flexible as my previous (erroneous) idea (you > need to instantiate the generic every time you want to change the size of > your queue), but still gets rid of constraint verification problem. It is > just a rough, untested idea, but I think it will work. It can be made to work. But I don't think this is a good use of modular types. Instead, use a normal (signed) integer type ("range 0..Whatever"), and use an explicit "mod" operation, or an explicit if statement. That makes the code more readable, by making it clear what's going on at the "wraparound" place. - Bob