comp.lang.ada
 help / color / mirror / Atom feed
From: John McCabe <jgm@hayling.cwmbran.gecm.com>
Subject: Re: Enumeration literal visibility and use type
Date: 1998/05/26
Date: 1998-05-26T00:00:00+00:00	[thread overview]
Message-ID: <6kejt5$75u@gcsin3.geccs.gecm.com> (raw)
In-Reply-To: 6kej65$dnh$1@hermes.seas.smu.edu


bralick@seas.smu.edu (William Bralick) wrote:

>package doodah is
>
>  type state_value_type is (state0, state1, state2, state_etc);
>
>  -- and just to make things interesting, let's create a useful message
>
>  type useful_message is record
>    state_stuff : state_value_type;
>    other_stuff : natural;
>  end record;
>
>end doodah;

There is no "cool_type". There is "state_value_type" and 
"useful_message", so you're "use type doodah.cool_type" will never work 
for a start.

>For some reason that I have yet to fathom, I had convinced myself 
>that "use type" would give immediate visibility of the enumerals in 
>doodah.cool_type.  I am now convinced that it doesn't (though I am
>ready to argue that it _should_).

Despite the obvious error, the "use type" clause is designed to provide 
visibility to the OPERATORS of the type, NOT the type itself so the 
behaviour you are seeing is correct.

-- 
Best Regards
John McCabe

=====================================================================
Any opinions expressed are mine and based on my own experience.  They
  should in no way be taken as the opinion of anyone I am currently
     working with, or of the company I am currently working for.
       If you have a problem with anything I say, SPEAK TO ME!
=====================================================================






  parent reply	other threads:[~1998-05-26  0:00 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-05-26  0:00 Enumeration literal visibility and use type William Bralick
1998-05-26  0:00 ` Roger Racine
1998-05-26  0:00 ` John McCabe [this message]
1998-05-26  0:00   ` David C. Hoos, Sr.
1998-05-26  0:00     ` Matthew Heaney
1998-05-27  0:00       ` John McCabe
1998-05-26  0:00     ` Ray Blaak
1998-05-27  0:00       ` John McCabe
1998-05-27  0:00         ` John McCabe
1998-05-26  0:00     ` John English
1998-05-27  0:00     ` Robert Dewar
1998-05-27  0:00       ` Matthew Heaney
1998-05-26  0:00 ` Matthew Heaney
1998-05-27  0:00   ` William Bralick
1998-05-27  0:00   ` Mats Weber
1998-05-27  0:00   ` John McCabe
     [not found] <6kej65$dnh$1@hermes.seas.smu.edu| <6kejt5$75u@gcsin3.geccs.gecm.com>
1998-05-26  0:00 ` William Bralick
1998-05-26  0:00   ` Fergus Henderson
1998-05-27  0:00     ` William Bralick
1998-05-27  0:00     ` John McCabe
1998-05-27  0:00       ` Peter Amey
1998-05-27  0:00         ` John McCabe
1998-05-27  0:00       ` Robert Dewar
1998-05-28  0:00         ` John McCabe
1998-05-28  0:00           ` Thomas Hood
1998-05-28  0:00             ` Robert Dewar
1998-05-28  0:00           ` Robert Dewar
1998-05-29  0:00             ` John McCabe
replies disabled

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