From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,37956b356498633 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-03-04 15:11:06 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!t-online.de!fr.usenet-edu.net!usenet-edu.net!enst!enst.fr!not-for-mail From: "David C. Hoos" Newsgroups: comp.lang.ada Subject: Re: Converting Char to Enum Date: Mon, 4 Mar 2002 17:17:05 -0600 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: References: <3C835426.DA864199@myob.com> Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1015283463 7098 137.194.161.2 (4 Mar 2002 23:11:03 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Mon, 4 Mar 2002 23:11:03 +0000 (UTC) Return-Path: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.8 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Original-Cc: lars@usenet.noschinski.de Xref: archiver1.google.com comp.lang.ada:20788 Date: 2002-03-04T17:17:05-06:00 ----- Original Message ----- From: "Lars Noschinski" Newsgroups: comp.lang.ada To: Sent: Monday, March 04, 2002 10:36 AM Subject: Re: Converting Char to Enum > "David C. Hoos, Sr." wrote: > > I think the reason that V'alue and 'Image are not appropriate > > for the original poster's case is that his case was a subset of > > the type Character. > > | type Symbols is ('0', '1', 'B', 'T', 'U'); > > Is that really a subset of character? I'm asking, because the following > code prints "'0'", "'B'" etc. and not "0", "B". > Take a look at two things, viz.: 1. The definition of the Character type in LRM A.1 (35) 2. The output of this program: with Ada.Text_IO; procedure Lars is type Symbols is ('0', '1', 'B', 'T', 'U'); package Symbol_IO is new Ada.Text_IO.Enumeration_IO (Symbols); package Character_IO is new Ada.Text_IO.Enumeration_IO (Character); begin Ada.Text_IO.Put_Line ("Symbols:"); for S in Symbols loop Symbol_IO.Put (S); Ada.Text_IO.Put (", "); end loop; Ada.Text_IO.New_Line (2); Ada.Text_IO.Put_Line ("Characters:"); for C in Character loop Character_IO.Put (C); Ada.Text_IO.Put (", "); end loop; Ada.Text_IO.New_Line (2); end Lars; > -------------------------------------------------------------------- > procedure Put_Symbol(sym : symbol) is > > package TIO is new Ada.Text_Io.Enumeration_Io(Symbols); > > begin -- Put_Symbol > TIO.Put(Sym); > end Put_Symbol. > -------------------------------------------------------------------- > > > CU Lars Noschinski > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada.eu.org > http://ada.eu.org/mailman/listinfo/comp.lang.ada >