comp.lang.ada
 help / color / mirror / Atom feed
From: Sven Nilsson <emwsvni@emw.ericsson.se>
Subject: Re: enumration using integers?
Date: Fri, 20 Apr 2001 07:22:31 +0200
Date: 2001-04-20T07:22:31+02:00	[thread overview]
Message-ID: <3ADFC797.7D2D537D@emw.ericsson.se> (raw)
In-Reply-To: HWCD6.2945$D4.288291@www.newsranger.com

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);
  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



  reply	other threads:[~2001-04-20  5:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-19 10:58 enumration using integers? Sven Nilsson
2001-04-19 12:42 ` Marc A. Criley
2001-04-19 13:02 ` Philip Anderson
2001-04-19 14:50 ` Ted Dennison
2001-04-20  5:22   ` Sven Nilsson [this message]
2001-04-20 13:57     ` Ted Dennison
2001-04-20 14:35       ` Sven Nilsson
2001-04-20 15:50         ` Keith Thompson
2001-04-20 18:18         ` Ted Dennison
2001-04-20 15:52     ` Samuel T. Harris
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox