From: Stephen Davies <joviangm@gmail.com>
Subject: Image attribute (yet again)
Date: Mon, 20 Apr 2020 08:24:16 -0700 (PDT)
Date: 2020-04-20T08:24:16-07:00 [thread overview]
Message-ID: <ea6d64d1-fb0c-42de-b787-26ccfbccee9b@googlegroups.com> (raw)
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))".
next reply other threads:[~2020-04-20 15:24 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-20 15:24 Stephen Davies [this message]
2020-04-25 22:35 ` Image attribute (yet again) Stephen Davies
2020-04-26 6:05 ` J-P. Rosen
2020-04-26 14:16 ` Jere
2020-04-26 17:09 ` Jeffrey R. Carter
2020-04-26 17:33 ` Jere
2020-04-27 12:33 ` J-P. Rosen
2020-04-27 12:50 ` Jere
2020-04-27 13:42 ` J-P. Rosen
2020-04-27 14:05 ` Jere
2020-04-27 14:55 ` Jeffrey R. Carter
2020-04-28 6:04 ` J-P. Rosen
2020-04-27 14:10 ` Jere
2020-04-28 6:02 ` J-P. Rosen
2020-04-28 13:03 ` Jere
2020-04-26 18:40 ` Oliver Kellogg
2020-04-26 18:42 ` Oliver Kellogg
2020-04-26 18:43 ` Oliver Kellogg
2020-04-27 12:52 ` Jere
2020-05-20 1:52 ` Shark8
2020-04-26 18:57 ` Stephen Davies
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox