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=-3.2 required=3.0 tests=BAYES_00,NICE_REPLY_A, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Parameterised 'Image Attributes Date: Thu, 7 Sep 2023 11:01:58 +0200 Organization: A noiseless patient Spider Message-ID: References: <4c861cba-9ad6-429d-b530-a40c45dfc176n@googlegroups.com> <41ae24fb-793e-4bb7-9086-c8923ddc5d9dn@googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 7 Sep 2023 09:01:57 -0000 (UTC) Injection-Info: dont-email.me; posting-host="3e4fde5204bf1fe9ab276fdba6340f70"; logging-data="3089928"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/e3JuYhX3t9zsUU616ME/TYSLNcTzCnr0=" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Cancel-Lock: sha1:EMyXIZW56ys7z6530Sq7VAvbnuw= Content-Language: en-US In-Reply-To: Xref: news.eternal-september.org comp.lang.ada:65612 List-Id: On 2023-09-07 03:04, Randy Brukardt wrote: > "Dmitry A. Kazakov" wrote in message > news:uchukd$1lnvp$1@dont-email.me... >> On 2023-08-28 11:18, Stephen Davies wrote: >> > ... >> Neither there is one why 'Image must be a non-overridable attribute > > There actually is a good reason for this. Attributes have global visibility. > So if you allowed overriding of attributes, then a with added or removed in > a remote part of a program could silently change the behavior of code that > has no knowledge of of the change. That would be bad for "programming in the > large". Note that Ada 95 was proven to have no such cases, and we've tried > very hard to avoid them. Ah, but 'Image is for debugging only! (:-)) > One could imagine adding rather severe restrictions to overriding of > attributes to eliminate this problem (for instance, only allowing it for > primitive operations of the type), but that would eliminate all real value > of the feature (you can always use a primitive function and "use all" to get > the same effect without any new features). It must be a new type: type My_Integer is new Integer; for My_Integer'Image use Foo; -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de