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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,75c440b4b7ed5f91 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!e34g2000pro.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Real Time IO routines Date: Mon, 29 Oct 2007 10:26:56 -0700 Organization: http://groups.google.com Message-ID: <1193678816.121187.265910@e34g2000pro.googlegroups.com> References: <1193410739.367181.96050@50g2000hsm.googlegroups.com> <1193674697.257242.163990@v23g2000prn.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1193678816 21605 127.0.0.1 (29 Oct 2007 17:26:56 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 29 Oct 2007 17:26:56 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: e34g2000pro.googlegroups.com; posting-host=66.126.103.122; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Xref: g2news2.google.com comp.lang.ada:2619 Date: 2007-10-29T10:26:56-07:00 List-Id: On Oct 29, 9:40 am, Robert A Duff wrote: > Adam Beneschan writes: > > ... The semantics and result of 'Image are > > well-defined by the language. If those semantics are acceptable for a > > particular use, then there's nothing wrong with using 'Image (unless > > there's an issue with using a secondary stack as Ludovic mentioned). > > True. But it's pretty annoying that: > > 'Image of integers includes an unwanted leading space. > > 'Image does not provide the formatting control that Text_IO does. > > You have to include the name of the type in the code. > > 'Image of enumeration literals does not print what appears in the source > code -- it converts to ALL_CAPS. I agree with all of those. Nevertheless, as far as #1, #2, and #4 are concerned, the result is still acceptable in some instances, and the fact that it would not be good enough in some cases isn't any particular reason to decree that it should never ever ever be used. As for #1, I've often written my own function that declares a string S whose value is 'Image and then returns S(S'First+1..S'Last) to get rid of the leading space---this was before Trim functions became available in Ada 95. It's still more convenient than instantiating Integer_IO, or writing your own function that uses division and "mod". I believe GNAT does have an 'Img attribute that can be applied to an object (although I assume you still need 'Image for certain types of expressions that are not valid attribute prefixes). I don't know whether this was ever proposed as a language addition, and if so why it was rejected. -- Adam