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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9ae67d2ea862546d,start X-Google-Attributes: gid103376,public From: "James S. Rogers" Subject: Unexpected language detail Date: 1998/11/26 Message-ID: <73iqh9$3kl@bgtnsc01.worldnet.att.net>#1/1 X-Deja-AN: 415796541 Organization: AT&T WorldNet Services X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Newsgroups: comp.lang.ada Date: 1998-11-26T00:00:00+00:00 List-Id: At work we were designing a generic bounded queue package indexed by a modular type. One of our requirements for this queue package is that it be able to correctly work with any modular type as the index. We encountered a problem when the queue contained a single element. This condition occurs when someone instantiates the package with a type defined as type Index is mod 1; Of course, the only valid value in this type is 0. The iterator for a queue with this type cannot use arithmetic. You cannot add 1 to the current value to get 0 because 1 is out of the range of the type. The solution we found was to use the 'SUCC attribute for the index type. This produced a correct iterator for all possible modular index types. Jim Rogers Colorado Springs, Colorado