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.9 required=3.0 tests=BAYES_00,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!news.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: moi Newsgroups: comp.lang.ada Subject: Re: Parameterised 'Image Attributes Date: Sat, 19 Aug 2023 17:49:41 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net izOmRXUMdxaxZKB29+d0FQQEKHFPf3QsigvCnUxF4OAw0EDXMN Cancel-Lock: sha1:TBaS6TPcCdb+pwb+Sn9qUqYop8E= sha256:5XzKvVm3+2MNIBGeOILNATkqFLeeTr6M1ZGGg3xw+as= User-Agent: Mozilla Thunderbird Content-Language: en-GB In-Reply-To: Xref: news.eternal-september.org comp.lang.ada:65542 List-Id: On 19/08/2023 10:14, J-P. Rosen wrote: > Le 18/08/2023 à 10:25, Luke A. Guest a écrit : >> On 18/08/2023 08:18, Rod Kay wrote: >>> Hello.all, >>>     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). >> >> I wanted them for ages, but there was a conversation ages ago where >> someone on here said attributes were for "debugging only," yet that's >> not what the arm says. >> > The intent of the 'Image attribute is to have a quick representation, > mainly for debugging purposes. If you want nice formatted output, use > the Put procedure on String from Text_IO. > My code uses 'Image heavily, because it is usually the neatest and the clearest way to format many strings that mingle words and numbers. I sometimes have to pass the result of 'Image to a function that implements the kind of functionality people are asking for, and it would be even neater and clearer if I could get that with parameters to 'Image itself. None of that output has anything to do with debugging. -- Bill F.