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.6 required=5.0 tests=BAYES_20,REPLYTO_WITHOUT_TO_CC autolearn=no 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 09:00:14 PST Path: supernews.google.com!newsfeed.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!titan03.ksc.nasa.gov!niven.ksc.nasa.gov!usenet From: "Samuel T. Harris" Newsgroups: comp.lang.ada Subject: Re: enumration using integers? Date: Fri, 20 Apr 2001 10:52:06 -0500 Organization: Raytheon Aerospace Engineering Services Message-ID: <3AE05B26.7954A22A@gsde.hou.us.ray.com> References: <3ADEC4E8.954B6830@emw.ericsson.se> <3ADFC797.7D2D537D@emw.ericsson.se> Reply-To: samuel_t_harris@raytheon.com NNTP-Posting-Host: sstf-fw.jsc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.7 [en] (X11; U; IRIX64 6.2 IP19) X-Accept-Language: en Xref: supernews.google.com comp.lang.ada:7046 Date: 2001-04-20T10:52:06-05:00 List-Id: Sven Nilsson wrote: > > Ted Dennison wrote: > > > > It understands perfectly what you want. It just won't allow you to do that. :-) > > I knew it! The machines are revolting!! Well, this machine is gonna be > playing Britney Spears MP3's the whole day... Take that you ungreatful > piece of ... > > > > The next obvious question is *why* do you want to do this? What are you trying > > to accomplish with an enumeration of integers? > > > > Right. I want to have a type containing certain integers that I can use > in calculations. Something like this: > > type Distance is (10, 15, 20, 37); The 37 is a real kicker. It it had been 35 and included 25 and 30, then perhaps ... type distance is delta 5.0 range 10.0..35.0; for delta'small use 5.0; (I believe that is correct off the top of my head). I've never used a fixed point type to represent an equi-distance set of integers, but I guess it would work. > Dist : Distance := 15; > Result : Integer := 0; > begin > Result := Some_Formula * Dist; -- And perhaps a typecast if need be. > > I could do that in other ways, for instance as suggested by Marc and > Philip, but that's not really the issue. I wanted to know if I could > magically write something to make my type-construct legal. Which I > probably can't. *sob* > > -Sven -- Samuel T. Harris, Principal Engineer Raytheon, Aerospace Engineering Services "If you can make it, We can fake it!"