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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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 Path: g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!usenet-fr.net!de-l.enfer-du-nord.net!news.weisnix.org!newsfeed.ision.net!newsfeed2.easynews.net!ision!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Sat, 04 Jul 2009 16:53:01 +0200 From: Georg Bauhaus Reply-To: rm.tsoh+bauhaus@maps.futureapps.de User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Learning Ada (Was: unsigned type) 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> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <4a4f6cce$0$31869$9b4e6d93@newsspool3.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 04 Jul 2009 16:53:02 CEST NNTP-Posting-Host: 266a078d.newsspool3.arcor-online.net X-Trace: DXC=7=ScgYO;Qc]YQ5E:l anon wrote: > Standards are the way to go. Yes, standards are the way to go. And this *is* standard Ada: type T is range 1_000_000 .. 9_999_999; The type T has the exact same set of operations as Standard.Integer. It is just as efficient as implementation defined Standard.Integer. The types Integer or Boolean you mentioned are not needed in order to define T. Universal_integer is the type of integer literals like 1_000_000; it is *not* declared in package Standard, it does not even have a name, it is just a predefined anonymous type. > Also, Its kind of funny. Other than me not one person here tried to answer the > original person question from "unsigned type". The first answer by Florian Weimer answered the original question, implying, I guess, that CARDINAL is not a mod type and so cannot be replaced with a mod type like Unsigned_N as you seem to suggest: For Modula-2's CARDINAL, there is overflow check control... So CARDINAL is not the same as a modular type in Ada. The second answer, by Albrecht K�fer, in addition points to modular types and to how they differ from Modula-2's CARDINAL. Maybe it is part of Ada culture to explain how a problem is solved in Ada, not how you can write Ada in the language you know, even when that might make some Ada teachers more popular among those students who do not have the, uhm, time to really learn Ada.