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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,68ab861309518ae8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-20 08:50:56 PST Path: supernews.google.com!newsfeed.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!csulb.edu!newshub.sdsu.edu!newspeer.cts.com!galanthis.cts.com!127.0.0.1.MISMATCH!not-for-mail Sender: kst@king.cts.com Newsgroups: comp.lang.ada Subject: Re: enumration using integers? References: <3ADEC4E8.954B6830@emw.ericsson.se> <3ADFC797.7D2D537D@emw.ericsson.se> <3AE04917.DF97BEA0@emw.ericsson.se> From: Keith Thompson X-Newsreader: Gnus v5.5/Emacs 20.3 Date: 20 Apr 2001 08:50:55 -0700 Message-ID: NNTP-Posting-Host: 209.68.192.180 X-Trace: 987781855 nntp.cts.com 47992 209.68.192.180 Xref: supernews.google.com comp.lang.ada:7045 Date: 2001-04-20T08:50:55-07:00 List-Id: Sven Nilsson writes: > Ted Dennison wrote: > > Hmm. I don't see anything in the above that couldn't have been done > > by making Distance a sybtype of Integer. Are you saying that you > > just want an integer type > > with "holes" in it, so that > > Dist := 2; > > would raise a Constraint_Error? > > Yepp, that sounds about right. I've been looking for something like that > in Barnes but I couldn't find it... Any clue? > > -Sven Declare your own private type with the desired characteristics. You can overload whatever arithmetic operations you need. You don't get numeric literals, but you can overload unary "+" to convert from Integer. (The language doesn't have *everything* built in.) -- Keith Thompson (The_Other_Keith) kst@cts.com San Diego Supercomputer Center <*> Cxiuj via bazo apartenas ni.