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,442eb9212004f30 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!l64g2000hse.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Problem using Ada.Text_IO.Modular_IO Date: Thu, 10 Jul 2008 07:59:00 -0700 (PDT) Organization: http://groups.google.com Message-ID: <32e35e5a-3cae-4fdc-be4a-3ae1e146e9f3@l64g2000hse.googlegroups.com> References: <4eab7055-df3d-4d56-87da-8248829da1da@26g2000hsk.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1215701940 13329 127.0.0.1 (10 Jul 2008 14:59:00 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 10 Jul 2008 14:59:00 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l64g2000hse.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ 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) Xref: g2news1.google.com comp.lang.ada:1082 Date: 2008-07-10T07:59:00-07:00 List-Id: On Jul 10, 12:25 am, a...@anon.org (anon) wrote: > It is easy to use and is tested and verified to work! To name one to > two reasons! Those don't seem like much of a reason. Declaring your own type as "mod 2**64" seems pretty darn easy. And what exactly do you mean by Unsigned_64 is "tested"? Unsigned_64 is simply declared as "mod 2**64" (this is specified by the language); so are you saying that operations on Unsigned_64 have been tested and have found to work right, but if you declare your own "mod 2**64" you have to do your own testing to make sure that operations on it work right? I'm having trouble interpreting your comment in a way that makes any sense. Of course, it really doesn't matter which one you use (except, perhaps, to help prevent incorrect type conversions). The only differences have to do with readability, pedagogy, and helping make your programs self-documenting. But ever since Ada was designed, the position of the Ada community has been that it's better to avoid using the standard numeric types provided by Ada (Integer, Float) and define your own that explicitly include the numeric range you need. You seem to be going in the opposite direction, by recommending that this user use a standard type provided by the language rather than defining his own (although the standard type you recommend is certainly better defined than Integer or Float). Another issue is that an implementation doesn't have to provide Interfaces.Unsigned_64. It should be present on any target processor whose addressable unit is an 8-bit byte or a 16-, 32-, or 64-bit word. But I've seen processors in the past that use 6-bit characters or 36-bit words, and in those cases, using Unsigned_64 instead of "mod 2**64" will turn a portable program into a nonportable one. I'll grant that such processors are rare these days. -- Adam