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=-1.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 Path: border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!news.ecp.fr!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Your wish list for Ada 202X Date: Wed, 23 Apr 2014 15:28:29 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <7f1c01c5-3563-4b94-9831-152dbbf2ecdc@googlegroups.com> <1ehc8moozpxnj$.1twbrsmoobjry.dlg@40tude.net> <63812656-3d79-4330-8b02-1836f3669b00@googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1398284913 31397 69.95.181.76 (23 Apr 2014 20:28:33 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 23 Apr 2014 20:28:33 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Original-Bytes: 3684 Xref: number.nntp.dca.giganews.com comp.lang.ada:186046 Date: 2014-04-23T15:28:29-05:00 List-Id: "björn lundin" wrote in message news:63812656-3d79-4330-8b02-1836f3669b00@googlegroups.com... Den onsdagen den 23:e april 2014 kl. 16:06:55 UTC+2 skrev Dmitry A. Kazakov: ... >> OK, considering no place for the sign as in T'Image(V), the image of a >> modular and of an integer type will be same. But what about floating >> point >> types: > >I stated discrete_types. That would be a very weird restriction, as subtype'Image is defined for all scalar types (including float and fixed types). Obj'Image almost certainly would not be defined for literals, as a literal cannot be the prefix of an attribute and changing the attribute machinery would kill the cost/benefit ratio of any such change. One could allow values that are names (Float'(3.14159)'Image) but there's not problem determining how to handle that. Also note that the name would be "Image". GNAT uses "Img" because language-defined attributes cannot be redefined, but they would have much preferred to call it "Image". No need nor sense to use a different name ('First can have an object or subtype prefix, so nothing new about that.) If it sounds like I've considered this extensively, that's because I have. :-) Another proposal that I worked on carefully was Obj'Succ (where Obj could be a complex expression, which is better than Obj := Obj + 1; as that has a duplication of Obj.) ... >No. Not the only reason. >Another reason is when you work on a legacy system, >that was implemented with Ada83. >The system then turns out to be stubbornly vital, >so it won't go away for many years. But there are >few or no tagged types. If it's still required to stay in Ada 83, then adding Obj'Image to Ada 2020 isn't going to help any. If it's able to be changed, then there are lot of things that ought to be re-engineered if substantial work is going to be done, and using Obj'Image is down in the noise. BTW, your proposal is a lot like the way stream attributes work, and that has proven to be a massive can-of-worms. The entire mess about availability of stream attributes comes about because of the ability of different views to have a different ideaa of whether an attribute is legal or not. This is not a trivial idea (nor is the one in AI12-0020-1). (Also note that providing 'Image implies providing a matching 'Value, just like providing 'Write implies providing 'Read. 'Value is a lot messier than 'Image, in general.) Randy.