comp.lang.ada
 help / color / mirror / Atom feed
From: bralick@seas.smu.edu (William Bralick)
Subject: Re: Enumeration literal visibility and use type
Date: 1998/05/27
Date: 1998-05-27T00:00:00+00:00	[thread overview]
Message-ID: <6kh4eh$k7f$1@hermes.seas.smu.edu> (raw)
In-Reply-To: 6kf0r3$isj$1@mulga.cs.mu.OZ.AU


In article <6kf0r3$isj$1@mulga.cs.mu.OZ.AU>,
Fergus Henderson <fjh@cs.mu.oz.au> wrote:
|bralick@seas.smu.edu (William Bralick) writes:
|
|>John McCabe  <jgm@hayling.cwmbran.gecm.com| wrote:
|>|... 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.
|>
|>Yes ... and I had understood that visibility of the type name was still
|>restricted (one would always need to write doodah.state_value_type), but
|>I was convinced that the enumerals themselves would be visible to avoid 
|>(1) the use of the "use clause" or (2) defining a series of named constants.
|
|What's wrong with (3) just using explicit module qualifiers?

The scenario is that the package with the enumeration type declared 
in it includes other types (but no operations), (2) this package is 
not in my control (so I cannot create a subpackage), (3) the names 
are quite descriptive (e.g. doodah.thingy_bobber.whatchamacallit), 
(4) the standard abbreviations are also not in my control, are cryptic
and require the renames we find obnoxious, viz.

   package d_tb_what renames doodah.thingy_bobber.whatchamacallit;

   -- note that it is a manual inspection task to ensure that the 
   -- standard abbreviations are used
   
   whatever : d_tb_what.cool_enumeration_type; 

   -- or, worse

   whatmore : doodah.thingy_bobber.whatchamacallit.cool_enumeration_type;
   ...

   begin

     whatever := d_tb_what.state0;

     -- or, again worse

     whatmore := doodah.thingy_bobber.whatchamacallit.state0;

   end test;

|>So once again, I am merely asking for a reference to some documentation
|>that might describe _why_ OPERATORS only were made visible
|
|Because explicit module qualifiers on OPERATORS look very ugly.

I think that a similar argument applies to enumerals.  I admit, though,
de gustibus non disputandum est.

Best regards,

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




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

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <6kej65$dnh$1@hermes.seas.smu.edu| <6kejt5$75u@gcsin3.geccs.gecm.com>
1998-05-26  0:00 ` Enumeration literal visibility and use type William Bralick
1998-05-26  0:00   ` Fergus Henderson
1998-05-27  0:00     ` William Bralick [this message]
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
1998-05-26  0:00 William Bralick
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
1998-05-26  0:00 ` John McCabe
1998-05-26  0:00   ` David C. Hoos, Sr.
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-26  0:00     ` Matthew Heaney
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
replies disabled

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