comp.lang.ada
 help / color / mirror / Atom feed
* Image attribute (yet again)
@ 2020-04-20 15:24 Stephen Davies
  2020-04-25 22:35 ` Stephen Davies
  0 siblings, 1 reply; 21+ messages in thread
From: Stephen Davies @ 2020-04-20 15:24 UTC (permalink / 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))".

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2020-05-20  1:52 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-20 15:24 Image attribute (yet again) Stephen Davies
2020-04-25 22:35 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox