comp.lang.ada
 help / color / mirror / Atom feed
* Enumeration literal visibility and use type
@ 1998-05-26  0:00 William Bralick
  1998-05-26  0:00 ` John McCabe
                   ` (2 more replies)
  0 siblings, 3 replies; 28+ messages in thread
From: William Bralick @ 1998-05-26  0:00 UTC (permalink / raw)




Greetings!

By now I have convinced myself that the following does not work as I had 
hoped:

-- we are provided the following package and required to use it to 
-- interface with other subsystems

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;

---

with doodah;
procedure test is

   use type doodah.cool_type;

   a_cool_message : useful_message;

begin

   a_cool_message.state_stuff := state0;  -- SIRENS WAIL, LIGHTS FLASH
                                          -- COMPILER WANTS: 
                                          -- doodah.state0

   ...

end test;

---

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_).

Because sharing this information with my other team members will require
that I eat more than a little crow ;-), I am looking for a pointer to 
any information (chapter and verse in the rationale, an AI, anything ...) 
that would explain _why_ Ada95 does not provide immediate visibility to 
enumeration types that have been the object of a "use type" clause.

Thanks and best regards,

-- 
Will Bralick        ............_/......._/__/..._/.......__/..._____/
                       ........._/....._/_/._/.._/......_/._/.._/..._/
        ........................._/..._/______/._/...________/._/___/
                         ........._/._/_/....._/_/...._/....._/_/.._/




^ permalink raw reply	[flat|nested] 28+ messages in thread
[parent not found: <6kej65$dnh$1@hermes.seas.smu.edu| <6kejt5$75u@gcsin3.geccs.gecm.com>]

end of thread, other threads:[~1998-05-29  0:00 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-05-26  0:00 Enumeration literal visibility and use type William Bralick
1998-05-26  0:00 ` John McCabe
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     ` John English
1998-05-26  0:00     ` Ray Blaak
1998-05-27  0:00       ` John McCabe
1998-05-27  0:00         ` John McCabe
1998-05-27  0:00     ` Robert Dewar
1998-05-27  0:00       ` Matthew Heaney
1998-05-26  0:00 ` Roger Racine
1998-05-26  0:00 ` Matthew Heaney
1998-05-27  0:00   ` Mats Weber
1998-05-27  0:00   ` William Bralick
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     ` John McCabe
1998-05-27  0:00       ` Robert Dewar
1998-05-28  0:00         ` John McCabe
1998-05-28  0:00           ` Robert Dewar
1998-05-29  0:00             ` John McCabe
1998-05-28  0:00           ` Thomas Hood
1998-05-28  0:00             ` Robert Dewar
1998-05-27  0:00       ` Peter Amey
1998-05-27  0:00         ` John McCabe
1998-05-27  0:00     ` William Bralick

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