From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM,NICE_REPLY_A,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Rod Kay Newsgroups: comp.lang.ada Subject: Re: Extra information in the message string of exceptions. Date: Tue, 7 Jun 2022 21:47:38 +1000 Organization: A noiseless patient Spider Message-ID: References: <1353f387-bb5a-4dc5-853f-a74d40f9237dn@googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 7 Jun 2022 11:50:45 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="3132443202e2650422bf11ef5d6e8d7c"; logging-data="29837"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+7KCODJkoLDGfhSX5TojpAFYc4OlMvwM8=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Cancel-Lock: sha1:ZGm6wbKkVSBpcoc0EfC3sPNCs8Y= In-Reply-To: Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:63946 List-Id: On 7/6/22 12:33, Randy Brukardt wrote: > > Janus/Ada has *always* done this (going all the way back to the original > Z-80 CP/M compiler). Very nice ! This particular case is not very expensive, since one > can use the fact that the out-of-range value is certainly in a register to > be tested in order to construct the message. And no real program cares about > the performance of raising Constraint_Error I didn't think that there would be too much impact on performance. -- the main issue is one of > space (making the program larger). > I hadn't really considered the extra space required. For a desktop/workstation/server, I expect the extra space would not be a huge consideration. For embedded systems and such, I guess it might be, though if the feature could be switched off for production releases perhaps not such a big problem. > P.S. I'd quibble with the OP, in that the vast majority of Constraint_Errors > have nothing to do with the standard library; their checks are compiled > directly into the code of your application. Quite right. I should simply have said the standard exceptions, wherever they are raised.