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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,583275b6950bf4e6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-27 23:55:28 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!cyclone.bc.net!arclight.uoregon.edu!enews.sgi.com!news.xtra.co.nz!53ab2750!not-for-mail From: "AG" Newsgroups: comp.lang.ada References: <3ec4b1c9$1@news.wineasy.se> <9fa75d42.0305161748.1735fc32@posting.google.com> <4W%xa.28765$cK5.11964@nwrdny02.gnilink.net> <1053353256.804734@master.nyc.kbcfp.com> <3ECFF541.1010705@attbi.com> <3ED0B820.5050603@noplace.com> <3ED2096F.3020800@noplace.com> <3ED353BE.40605@noplace.com> Subject: Re: Quality systems (Was: Using Ada for device drivers? (Was: the Ada mandate, and why it collapsed and died)) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: Date: Wed, 28 May 2003 18:56:03 +1200 NNTP-Posting-Host: 219.88.61.99 X-Complaints-To: newsadmin@xtra.co.nz X-Trace: news.xtra.co.nz 1054104927 219.88.61.99 (Wed, 28 May 2003 18:55:27 NZST) NNTP-Posting-Date: Wed, 28 May 2003 18:55:27 NZST Organization: Xtra Xref: archiver1.google.com comp.lang.ada:37875 Date: 2003-05-28T18:56:03+12:00 List-Id: "Marin David Condic" wrote in message news:3ED353BE.40605@noplace.com... > Pretty simple stuff. Suppose you had a type like: > > type Saturated_Integer is range -10..10 ; > > and an object of that type such as: > > X : Saturated_Integer := 9 ; > > and then: > > X := X + 4 ; > > would mean: > > (X = 10) > > and later you might do: > > X := X - 25 ; > > and you get > > (X = -10) But that means that something somewhere must have an actual counter which keeps the actual value of what you pretend is a saturated integer. After all, you, as the user of the saturated type, don't (or shouldn't) know if one saturated number is equal to another - they are all equal in a sense. But whatever implements them obviously must. So, what about this (assuming X is already saturated and Y is the largest unsaturated number): if Y = X - 1 then Should that tell me I've got the smallest saturated number? Can I then count them? (I've got the smallest number and I have "+", "-", "<", ">" etc) - looks like an ordinary integer now. Almost. Can I do something like for I in X..Y ? What would that do if there are several saturated values in that range? It looks like what you describe is just a simple matter of having a much wider actual range but providing some sort of a checked conversion/mapping which just does the range checking on the number and overrides it with a limit if needed.. It's not hard to implement either as a custom code or some utility library. However, pushing it onto the compiler seems to open all kinds of semantic cans of worms. Unless I misunderstood your point of course.