From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Received: by 2002:ac8:7cba:: with SMTP id z26mr16623300qtv.143.1587396257189; Mon, 20 Apr 2020 08:24:17 -0700 (PDT) X-Received: by 2002:a9d:7ad8:: with SMTP id m24mr10529053otn.22.1587396256912; Mon, 20 Apr 2020 08:24:16 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 20 Apr 2020 08:24:16 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=2a02:c7d:897d:6600:198:b18a:3f2e:45ae; posting-account=YRfoYAoAAADhSEO2nLYx10QUUvp8akYl NNTP-Posting-Host: 2a02:c7d:897d:6600:198:b18a:3f2e:45ae User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Image attribute (yet again) From: Stephen Davies Injection-Date: Mon, 20 Apr 2020 15:24:17 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:58434 Date: 2020-04-20T08:24:16-07:00 List-Id: Whilst looking at the new features for Ada 2020, I spotted: An implementation may transform the image generated by the default implementation of S'Put_Image for a composite subtype S in the following ways: - If S is a composite subtype, the leading character of the image of a component value or index value is a space, and the immediately preceding character is an open parenthesis, then the space may be omitted. The same transformation is also permitted if the leading character of the component image is a space (in which case one of the two spaces may be omitted). [AARM note: This means that it is permitted to generate "(1 => 123, 2 => 456)" instead of "( 1 => 123, 2 => 456)".] Whilst it is nice that those in charge of the language are finally acknowledging how annoying the leading space on numeric images is, that just makes it more galling that they appear to still be doing about it for scalar numeric types. I understand that the default behaviour of "'Image" cannot possibly be changed as it would cause massive incompatibility. But there are other, simple solutions, e.g. new attribute, optional parameters, ... One justification that might be given for doing nothing is that "Trim(S'Image, Left)" can be used instead, but I disagree because: - It requires adding with/use clauses for Ada.Strings and Ada.Strings.Fixed. - "S'Trim_Image" would still be nicer (just as "First_Element(C)" can be used instead of "Element(First(C))".