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=1.8 required=3.0 tests=BAYES_50,FORGED_GMAIL_RCVD, FREEMAIL_FROM,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.ada Subject: Re: Parameterised 'Image Attributes Date: Fri, 18 Aug 2023 11:53:44 -0700 Organization: None to speak of Message-ID: <87pm3ki3lz.fsf@nosuchdomain.example.com> References: MIME-Version: 1.0 Content-Type: text/plain Injection-Info: dont-email.me; posting-host="ed98cb3cb6283a5474b2936d7ca2542f"; logging-data="398367"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX184l6FCuAJjd0EeX1JQ1pGY" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cancel-Lock: sha1:EEQb80PffCPokQbvIigh9jXcfgg= sha1:+HJ/3fDjD/hWK297E2bteBFJepg= Xref: news.eternal-september.org comp.lang.ada:65535 List-Id: Rod Kay writes: > There has been some recent discussion on #ada irc regarding > formatted output. > > Would it be possible/desirable to allow the 'Image attribute to > have formatting parameters ? Something along the lines of ... > > > put_Line (some_Integer'Image (Width => 5, Padding => '0')); > > > ... and similar 'Image attribute parameters for other types. > > > If the parameters have defaults, then there should not be any > backwards compatibility issues (I think). TeleSoft's compiler (which I worked on) had 'Extended_Image and 'Extended_Value attributes that worked like that. I found them quite useful -- especially as an easy way to drop the leading space on Integer'Image. One small problem was that we had different parameters for integer and enumeration types, which introduced an ambiguity for discrete formal types. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Will write code for food. void Void(void) { Void(); } /* The recursive call of the void */