comp.lang.ada
 help / color / mirror / Atom feed
* Enumeration_IO
@ 2000-04-06  0:00 NANCY HEHIR
  2000-04-07  0:00 ` Enumeration_IO Jeff Carter
  0 siblings, 1 reply; 11+ messages in thread
From: NANCY HEHIR @ 2000-04-06  0:00 UTC (permalink / raw)


Can anyone tell what the generic Enumeration_IO file in GNAT 3.12 should be
called ?
I can't seem to find it in my adainclude folder.






^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: Enumeration_IO
@ 1990-05-08 17:54 dritz
  0 siblings, 0 replies; 11+ messages in thread
From: dritz @ 1990-05-08 17:54 UTC (permalink / raw)


Having seen Michael Feldman's test program for Enumeration_IO, I think I can
say what the problem is.  The type Type_Set and its enumeration literals
Lower_Case and Upper_Case are declared in Text_IO, not in
Text_IO.Enumeration_IO.  The test program only "with"ed Text_IO; it did not
"use" it.  Hence the enumeration literal Lower_Case is not directly visible.
I would expect that adding "use Text_IO;" or replacing "Lower_Case" by
"Text_IO.Lower_Case" would solve the problem.

Ken Dritz
dritz@mcs.anl.gov

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Enumeration_IO
@ 1990-05-08  0:41 Mike Feldman
  1990-05-08 16:38 ` Enumeration_IO Alex Blakemore
  1990-05-08 23:53 ` Enumeration_IO M Y Ben Gershon
  0 siblings, 2 replies; 11+ messages in thread
From: Mike Feldman @ 1990-05-08  0:41 UTC (permalink / raw)


In preparing some programs for a book I am working on, I have gotten
interested in the idiosyncracies of Enumeration_IO. Specifically, the
PUT operations in this generic package are supposed to have a parameter
SET of type TYPE_SET, where TYPE_SET is (LOWER_CASE, UPPER_CASE).

Well, consider an enumeration type
  type COLORS is (red, blue, green);
and an instance 
  package COLOR_IO is new TEXT_IO.ENUMERATION_IO(ENUM => COLORS);
and a variable
  C : COLORS := blue;
and an output operation
  COLOR_IO.PUT(ITEM => C);

All is well so far, everything compiles and runs except that the output
value is BLUE, because the default is Upper_Case. Now change the output
operation to
  COLOR_IO.PUT(ITEM => C, SET => LOWER_CASE);

Irvine Ada (HP835), IntegrAda (IBM-PC), VADS (Sun3) and AdaVantage (Sun3)
ALL bail out on a "LOWER_CASE is an undefined identifier" diagnostic.
Clearly something is going on here. According to LRM 14.3.9 this should be
allowed. Can anyone provide some enlightenment here?

I will post a program if anyone wants to try this out.
---------------------------------------------------------------------------
Prof. Michael Feldman
Department of Electrical Engineering and Computer Science
The George Washington University
Washington, DC 20052
+1-202-994-5253
mfeldman@seas.gwu.edu
---------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2000-04-08  0:00 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-06  0:00 Enumeration_IO NANCY HEHIR
2000-04-07  0:00 ` Enumeration_IO Jeff Carter
2000-04-07  0:00   ` Enumeration_IO Robert Dewar
2000-04-08  0:00     ` Enumeration_IO Jeff Carter
  -- strict thread matches above, loose matches on Subject: below --
1990-05-08 17:54 Enumeration_IO dritz
1990-05-08  0:41 Enumeration_IO Mike Feldman
1990-05-08 16:38 ` Enumeration_IO Alex Blakemore
1990-05-08 18:32   ` Enumeration_IO Mike Feldman
1990-05-09 22:36     ` Enumeration_IO M Y Ben Gershon
1990-05-10  3:01       ` Enumeration_IO Mike Feldman
1990-05-08 23:53 ` Enumeration_IO M Y Ben Gershon

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