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: a07f3367d7,421379614df5a9cd X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!backlog2.nntp.dca.giganews.com!nntp.nethere.com!news.nethere.com.POSTED!not-for-mail NNTP-Posting-Date: Sun, 30 Aug 2009 13:34:01 -0500 Newsgroups: comp.lang.ada Subject: Re: Range excluding 0.0 From: csampson@inetworld.net (Charles H. Sampson) Date: Sun, 30 Aug 2009 11:34:00 -0700 Message-ID: <1j59bht.1g5hayoavhvvbN%csampson@inetworld.net> References: <6f1ce89e-7889-4d58-b0f8-1945727f5149@f33g2000vbm.googlegroups.com> <1j57hiw.vmezw81qexbi6N%csampson@inetworld.net> <1bg7e0snmumug.m6mwq8uap1a6.dlg@40tude.net> User-Agent: MacSOUP/2.8.2 (Mac OS X version 10.4.11 (PPC)) X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-rqUNrcwjq0NhA7ZwT09DEL2XavSk41dE6skhDDotm0cq2/w56U/0EGdbIDvTBsQu/5d6vDbQ/wp5XVO!qfTckJK0jajLQVPrWsTGU13JN90b6NCcCvbN6xdMpHgeswDCvjTt/D3VfP61tmFB1NxReu6Nwrm6!jT+dMmBtxcfyCb+8kxi5o8Yo54QyLw== X-Complaints-To: abuse@nethere.com X-DMCA-Complaints-To: abuse@nethere.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.39 X-Original-Bytes: 2403 Xref: g2news2.google.com comp.lang.ada:8060 Date: 2009-08-30T11:34:00-07:00 List-Id: Dmitry A. Kazakov wrote: > On Sat, 29 Aug 2009 10:47:17 -0700, I wrote: > > > This is not just theoretical musing. I currently work in the world > > of compasses, so a range of the form [0.0 .. 360.0) is quite natural. > > (That notation is neither mathematical nor Ada. I hope its meaning is > > clear.) > > That is not range, the type would be not of real numbers. For example: > > 340.0 + 25.0 = 5.0 > Right, but that's not unusual. Of the predefined types of Ada, only modular and enumeration types are closed under their predefined operations. What I want is a way to express the set of real numbers (in the Ada sense) that an object of the type can legally hold. We already write the code to prevent a stored value of 360.0. What I want is a constraint error just in case we foul up. To be frank, I had forgotten that we can achieve the effect by using Pred or some other attributes, even though I've done that in another context. But my question essentially was, why weren't we given a notation to do it directly and easily? Charlie -- All the world's a stage, and most of us are desperately unrehearsed. Sean O'Casey