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=-0.3 required=3.0 tests=BAYES_00,FREEMAIL_FROM, SCC_BODY_URI_ONLY,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Received: by 2002:ac8:7f07:0:b0:40f:f509:3a75 with SMTP id f7-20020ac87f07000000b0040ff5093a75mr200785qtk.7.1692907178048; Thu, 24 Aug 2023 12:59:38 -0700 (PDT) X-Received: by 2002:a81:b64e:0:b0:589:a3d6:2e02 with SMTP id h14-20020a81b64e000000b00589a3d62e02mr366689ywk.3.1692907177668; Thu, 24 Aug 2023 12:59:37 -0700 (PDT) Path: eternal-september.org!news.eternal-september.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 24 Aug 2023 12:59:37 -0700 (PDT) In-Reply-To: Injection-Info: google-groups.googlegroups.com; posting-host=2a02:c7e:270d:5200:f8:67c1:56b5:a609; posting-account=YRfoYAoAAADhSEO2nLYx10QUUvp8akYl NNTP-Posting-Host: 2a02:c7e:270d:5200:f8:67c1:56b5:a609 References: <4c861cba-9ad6-429d-b530-a40c45dfc176n@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Parameterised 'Image Attributes From: Stephen Davies Injection-Date: Thu, 24 Aug 2023 19:59:38 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Bytes: 3016 Xref: news.eternal-september.org comp.lang.ada:65556 List-Id: On Wednesday, 23 August 2023 at 17:16:12 UTC+1, Dmitry A. Kazakov wrote: > On 2023-08-23 12:20, Stephen Davies wrote: > > > Actually, I think it might also be nice if Float'Trim_Image(X) returned > > a string that only used exponential notation for very large or very > > small values (which seems to be the default behaviour in Python). > To use the shortest representation for the given precision unless > specified otherwise: > > http://www.dmitry-kazakov.de/ada/strings_edit.htm#6 > > Ada 'Image attributes have "typographic quality" in plain contradiction > to the claim being for debugging purpose. That is why the plus sign is > always represented by a space and why floating-point representation is > always selected even for exact zero and the way the exponent part is > formatted. The typographic idea is to have *same looking* output. Note, > even if the output is mathematically incorrect as in the case of > floating-point numbers. 'Image considers precision and accuracy same, > which is *always* wrong when dealing with floating-point numbers. > > Different names would then be needed (Tidy_Image and Tidy_Width?). > It takes several parameters to control the behavior in a reasonable way. > -- How about an attribute called something like User_Image where programmers should make no assumption about the generated strings and implementations can provide OS-specific ways to customise things like leading space/plus/neither, decimal separator character, digit grouping character/spacing, exponential notation, enum casing, etc.