comp.lang.ada
 help / color / mirror / Atom feed
* Enumeration type "importation" problem
@ 1989-06-20 14:00 "EDWARD CRAGG"
  0 siblings, 0 replies; only message in thread
From: "EDWARD CRAGG" @ 1989-06-20 14:00 UTC (permalink / raw)


I am looking for a simple way to make an enumeration type which is
declared in one package an integral part of a second package as
follows: 


package SYSTEM_INTERFACE_TO_BE_HIDDEN_FROM_AVERAGE_USER is
type SYS_STATUS is ( OK, SOME_ERROR );
    .     .     .
end SYSTEM_INTERFACE_TO_BE_HIDDEN_FROM_AVERAGE_USER;


with SYSTEM_INTERFACE_TO_BE_HIDDEN_FROM_AVERAGE_USER;
package AVERAGE_USER_INTERFACE is
-- somehow I would like to declare STATUS such that
--     1) OK and SOME_ERROR are the values for status
--     2) = and /= are visible without needing to with and use
--        SYSTEM_INTERFACE_TO_BE_HIDDEN_FROM_AVERAGE_USER
--     3) there is a simple way to convert between STATUS and SYS_STATUS
--        (note, since in real life there are several hundred 
--         enumeration values for SYS_STATUS, I do not regard a CASE
--         conversion to be 'simple'
--
--     SUBTYPE and RENAMES satisfy 1 and 3 but not 2,
--     declaring a separate type and writing my own conversion 
--     functions satisfy 1 and 2 but not 3.
end AVERAGE_USER_INTERFACE;

Does anyone have any thoughts?


 ............................................................
Edward E Cragg                Bitnet:   ECRAGG@GMUVAX
                              Internet: ECRAGG@GMUVAX.GMU.EDU

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1989-06-20 14:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1989-06-20 14:00 Enumeration type "importation" problem "EDWARD CRAGG"

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