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=-0.1 required=5.0 tests=AXB_XMAILER_MIMEOLE_OL_024C2, 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 04:49:05 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!isdnet!enst!enst.fr!not-for-mail From: "David C. Hoos, Sr." Newsgroups: comp.lang.ada Subject: Re: Converting Char to Enum Date: Mon, 4 Mar 2002 06:48:24 -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 1015246142 87946 137.194.161.2 (4 Mar 2002 12:49:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Mon, 4 Mar 2002 12:49:02 +0000 (UTC) Return-Path: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 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 Xref: archiver1.google.com comp.lang.ada:20760 Date: 2002-03-04T06:48:24-06:00 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. For enumeration types in general, the use of 'Value and 'Image are indeed.appropriate. ----- Original Message ----- From: "sk" To: Sent: March 04, 2002 5:01 AM Subject: Re: Converting Char to Enum > Hi, > > Original Post: > > Lars Noschinski : > >... > >there is a more elegant possibility. > > ^^^^^^^ > > > > dewar@gnat.com (Robert Dewar) : > >Ouch! From heavy to heavier! > >An array is clearly the obvious efficient solution here. > > ^^^^^^^^^ > > I find 'Image, 'Value and kin elegant. I will > concede efficiency :-) > > Word choice aside, are the attribute functions > inherently (?sp) inefficient ? Or is the example > of the OP a specialized and reduced case ? > > type Printer_Status is (Available, Busy, Error, ...); > > I think I would prefer to rely on the strategy > outlined by the comments in "System.Val_Enum" > (spec, GNAT) than developing my own parser for > every enumeration type :-). > > ------------------------------------- > -- Merge vertically for real address > ------------------------------------- > s n p @ t . o > k i e k c c m > ------------------------------------- > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada.eu.org > http://ada.eu.org/mailman/listinfo/comp.lang.ada >