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=0.7 required=5.0 tests=BAYES_00,MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6f69b1cf0f02b9ac X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-01-22 09:30:20 PST Path: supernews.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: Robert Dewar Newsgroups: comp.lang.ada Subject: Re: Built-in types (was Re: How can I avoid Using a Semaphore? Date: Mon, 22 Jan 2001 17:20:49 GMT Organization: Deja.com Message-ID: <94hq56$rlv$1@nnrp1.deja.com> References: <93ti8b$bjpps$1@ID-25716.news.dfncis.de> <9BP86.270637$U46.8654942@news1.sttls1.wa.home.com> <94563n$cb6kp$1@ID-25716.news.dfncis.de> <0Cka6.290338$U46.9207275@news1.sttls1.wa.home.com> <94co6t$v27$1@nnrp1.deja.com> <94f1a8$k9r$1@nnrp1.deja.com> <94fv9d$cjt$1@nnrp1.deja.com> <94g3tf$gb9$1@nnrp1.deja.com> <94hmgo$o2k$1@nnrp1.deja.com> NNTP-Posting-Host: 205.232.38.14 X-Article-Creation-Date: Mon Jan 22 17:20:49 2001 GMT X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; U) X-Http-Proxy: 1.0 x59.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 X-MyDeja-Info: XMYDJUIDrobert_dewar Xref: supernews.google.com comp.lang.ada:4323 Date: 2001-01-22T17:20:49+00:00 List-Id: In article <94hmgo$o2k$1@nnrp1.deja.com>, mark_lundquist@my-deja.com wrote: > If that's my only > requirement, then I'm being explicit about it when I write > "Integer", because that's what Integer is supposed to be -- > the "whatever integer". In this very unlikely scenario, I would suggest writing type My_Int is new Integer; -- Use standard default (and presumably efficient) integer so that if there are porting problems, or if you do need to specify additional attributes, then it is easily done without major rewriting. > (Let's see, just for integer types, what can the programmer > specify? There's base range, size, alignment, stream I/O > attributes... anything else?) Yes, there are other things, but the point is that we are specifically talking here about a complaint that you can NOT specify them for the standard type Integer. That's what this thread is about. It is curious logic to be in a position of saying 1. I want to use Integer when I don't want to specify any additional stuff. 2. It is annoying that for type Integer, I cannot specify additional stuff that makes little sense to me! > Well that's just it... it seems like if the programmer is > sharp enough to specify all this stuff, then he also ought to > be sharp enough to know when he means the "whatever" types > and to use them when that's what he means. Please give a VERY clear example of why it is good EVER to use type Integer (other than when constrained by a library)? Even if efficiency is a concern, the proper approach is to write something like type Temp_Int is range min-required .. max-required; type My_Int is new Temp_Int'Base; Now use My_Int. That's really MUCH better than using Integer directly. > There was a thread here last year, in which someone was > lamenting that Ada's integer types were not as "portable" as > Java's because the language doesn't nail standardize the > sizes/ranges. Well this of course makes no sense. In Java you only have the standard types, so it is important to standardize them. In serious Ada, you don't use these standard types anyway, so the fact that they are not defined is not relevant to serious programs. Of course at this stage, it would in practice be fine to define type Integer as being always 32 bits, precisely because serious code is not going to use this much anyway. Well to be honest (as they say in the AARM), we can't do that *because* of the involvement of Integer with Standard.String. Sent via Deja.com http://www.deja.com/