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 03:03:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!fr.usenet-edu.net!usenet-edu.net!enst!enst.fr!not-for-mail From: sk Newsgroups: comp.lang.ada Subject: Re: Converting Char to Enum Date: Mon, 04 Mar 2002 05:01:58 -0600 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: References: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1015239782 84655 137.194.161.2 (4 Mar 2002 11:03:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Mon, 4 Mar 2002 11:03:02 +0000 (UTC) Return-Path: X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.19-4.3mdk i686) X-Accept-Language: en 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:20757 Date: 2002-03-04T05:01:58-06:00 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 -------------------------------------