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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,630c12e823d1bdf4 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-10 07:09:58 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!chcgil2-snh1.gtei.net!chcgil2-snf1.gtei.net!news.gtei.net!news.binc.net!kilgallen From: Kilgallen@SpamCop.net (Larry Kilgallen) Newsgroups: comp.lang.ada Subject: Re: Ranged Types (was: Hijacking a Thread) Date: 10 Jan 2003 09:09:35 -0600 Organization: LJK Software Message-ID: References: <1040653133.613605@master.nyc.kbcfp.com> <3e18f3f3_1@news.tm.net.my> <6KwmrO7CZtnj@eisner.encompasserve.org> <1041910244.361888@master.nyc.kbcfp.com> <3E1E5604.5030209@nospam.adrianhoe.com> <1042177570.752923@master.nyc.kbcfp.com> NNTP-Posting-Host: eisner.encompasserve.org X-Trace: grandcanyon.binc.net 1042211311 26009 192.135.80.34 (10 Jan 2003 15:08:31 GMT) X-Complaints-To: abuse@binc.net NNTP-Posting-Date: Fri, 10 Jan 2003 15:08:31 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:32886 Date: 2003-01-10T09:09:35-06:00 List-Id: In article <1042177570.752923@master.nyc.kbcfp.com>, Hyman Rosen writes: > To go back on topic for a minute (what a concept!), another thread > got me wondering just how useful in practice ranged types are. > What situations lead one to declare a type which is limited to a > range of integers? I'm thinking fixed-size arrays, which I usually > consider to be a design error. Fixed size arrays are not a error in many situations, such as tracking the N highest instances of a particular event. Of course overflowing the index type would also be detected as overflowing the array. In declaring such an array, I typically base the array limits on the 'first and 'last attributes of the type so that a later change to make that 150 entries need only be made in one place.