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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,caabf5265fad78e5 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!feeder2.cambriumusenet.nl!feed.tweaknews.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!news.online.de!not-for-mail From: Albrecht =?ISO-8859-1?Q?K=E4fer?= Newsgroups: comp.lang.ada Subject: Re: Learning Ada Date: Mon, 06 Jul 2009 02:19:23 +0200 Organization: 1&1 Internet AG Message-ID: References: <59O1m.404661$4m1.69194@bgtnsc05-news.ops.worldnet.att.net> <62792744-daca-437b-bdee-4b8a21f7ce27@j32g2000yqh.googlegroups.com> <82oq45tj2uu26u6ecsgq70bsjskr9dvghr@4ax.com> <878wj61bpo.fsf_-_@nbi.dk> <4a4f6cce$0$31869$9b4e6d93@newsspool3.arcor-online.net> <4Aa4m.421894$4m1.207252@bgtnsc05-news.ops.worldnet.att.net> NNTP-Posting-Host: p54bca3d5.dip0.t-ipconnect.de Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: online.de 1246840137 11962 84.188.163.213 (6 Jul 2009 00:28:57 GMT) X-Complaints-To: abuse@einsundeins.com NNTP-Posting-Date: Mon, 6 Jul 2009 00:28:57 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.21) Gecko/20090403 SeaMonkey/1.1.16 Mnenhy/0.7.5.0 Hamster-Pg/1.25.2.0 In-Reply-To: <4Aa4m.421894$4m1.207252@bgtnsc05-news.ops.worldnet.att.net> Xref: g2news2.google.com comp.lang.ada:6847 Date: 2009-07-06T02:19:23+02:00 List-Id: anon schrieb: > But some people like "Ludovic Brenta, state that most Ada programmers > would prefer to create their own types. In some case, that goes against the RM > because it can create a non-standardize form of an Ada programs, that violate > other RM rules. It would be really smashing if you could provide some sort of proof for this bold claim. > Plus, the RM states that a number of numeric types are > predefined, such as "Integer", and it subtypes "Natural" and "Positive" as > well the type "Float" and its subtypes. > Redefining those predefines types are > legal in Ada, by simply re-defining the type. ... no? Standard.Integer et al cannot be redefined. You can change the underlying compiler, but then you could also change "begin" to "start". > Like for example, using 24 bit integer: > > type Integer is range -2 ** 24 .. +2 ** ( 24 - 1 ) ; > > To use this new definition of "Integer", globally it needs to be define in the > standard package, Now how would you go around doing that? > but for a single package or routine it better to create a new > type or subtype and for the routine or package. But in most programming this > is not necessary. That is, since Ada creation and the DOD dropping it full > support of Ada, the usage for redefining the numeric data types is almost nil, > not the norm any more. Plus, the DOD require full documentation on all new > define types. Why should we care about what the DoD requires again? > Now, "Rob Solomon" stated that he think "it would be beneficial, if > the types Float and Integer were removed from the language". That is a personal opinion, not a law of nature. > Second, the predefined types allow for the program to be more portable, > because a users type might not be accepted on the new system. But using the > standards or creating a subtype from the standards is better. An example is: > > type Integer is range -2 ** 256 .. +2 ** ( 256 - 1 ) ; > > which is a valid Ada statement but in a 32-bit and most 64-bit system this > type is not allowed. There's nothing stopping you from creating a special Ada compiler supporting arbitrary-length integers. Albrecht