comp.lang.ada
 help / color / mirror / Atom feed
From: Larry Hazel <lhazel@mindspring.com>
Subject: Re: Question about enumeration types
Date: Tue, 24 Jul 2001 07:23:25 -0500
Date: 2001-07-24T12:23:07+00:00	[thread overview]
Message-ID: <3B5D68BD.841221BF@mindspring.com> (raw)
In-Reply-To: 3B5D5EA5.F20EC9D7@ffi.no

Reinert Korsnes wrote:
> 
> Hi,
> 
> (sorry for somehow repeating a question)
> 
> Given the program as below.  Here I did put "E : E1" inside
> a record since "E" is also a possible value for the enumeration type E1.
> 
> This is somehow verbose.  Is it a more elegant way ?

There is no conflict here.  You must always reference a record component this
way.  I think any other way would be less elegant.

> I find it boring that extending the range of possible values of
> an enumeration type may easily cause conflicts with variable names,
> and new variable names may cause conflicts values for enumeration
> types.  I sometimes would like to have the reserved word "Exit"
> as a possible value of an enumeration type....  Am I thinking
> somewhat wrong ?

At least an Ada compile will tell you about conflicts.

You can't use reserved words for anything else.  I have also wanted to use Exit
at times, but settled for Quit or Stop or some such.  Range is another reserved
word that would be the best variable name in some cases.  You just have to
qualify it in some way - Maximum_Range for instance.

Larry



  reply	other threads:[~2001-07-24 12:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-24 11:40 Question about enumeration types Reinert Korsnes
2001-07-24 12:23 ` Larry Hazel [this message]
2001-07-24 12:31 ` Marc A. Criley
2001-07-26 16:52 ` Robert Dewar
2001-07-27 13:04   ` Ken Garlington
2001-07-31  9:59   ` Peter Hermann
replies disabled

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