comp.lang.ada
 help / color / mirror / Atom feed
From: Peter Amey <pna@praxis-cs.co.uk>
Subject: Re: Enumeration literal visibility and use type
Date: 1998/05/27
Date: 1998-05-27T00:00:00+00:00	[thread overview]
Message-ID: <356C45DE.5BF3@praxis-cs.co.uk> (raw)
In-Reply-To: 6kgh82$92n@gcsin3.geccs.gecm.com


John McCabe wrote:
> 
> fjh@cs.mu.oz.au (Fergus Henderson) wrote:
> >>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.
> 
> And explicit module qualifiers on enumeration literals don't?
> 

Not if suitable names are chosen.  Most of the difficulties with Ada 
prefixes and dotted names seem to arise because people fight the 
language rather than taking advantage of it.  Names should be chosen for 
their readability in context.  I much prefer:

package Valve is
  type T is (Open, Shut);
end Valve;

allowing:   DrainValve : Valve.T := Valve.Shut;

to the more common(in my experience) form:

package BasicTypes is
  type ValveType is (Open, Shut);
end BasicTypes;

which leads to: DrainValve : BasicTypes.ValveType := BasicTypes.Shut; 
which _is_ ugly.


Peter

-- 
---------------------------------------------------------------------------   
      __         Peter Amey, Product Manager
        )                    Praxis Critical Systems Ltd
       /                     20, Manvers Street, Bath, BA1 1PX
      / 0        Tel: +44 (0)1225 466991
     (_/         Fax: +44 (0)1225 469006
                 http://www.praxis-cs.co.uk/
 
--------------------------------------------------------------------------




  parent 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
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-27  0:00       ` Peter Amey [this message]
1998-05-27  0:00         ` John McCabe
1998-05-26  0:00 William Bralick
1998-05-26  0:00 ` John McCabe
1998-05-26  0:00   ` David C. Hoos, Sr.
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-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
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
replies disabled

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