comp.lang.ada
 help / color / mirror / Atom feed
From: "David C. Hoos, Sr." <david.c.hoos.sr@ada95.com>
Subject: Re: Converting Char to Enum
Date: Mon, 4 Mar 2002 06:48:24 -0600
Date: 2002-03-04T06:48:24-06:00	[thread overview]
Message-ID: <mailman.1015246142.5735.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: 3C835426.DA864199@myob.com

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" <noname@myob.com>
To: <comp.lang.ada@ada.eu.org>
Sent: March 04, 2002 5:01 AM
Subject: Re: Converting Char to Enum


> Hi,
> 
> Original Post:
> 
> Lars Noschinski <lars@usenet.noschinski.de> :
> >...
> >there is a more elegant possibility.
> >                ^^^^^^^
> 
> <my suggestion snipped>
> 
> 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
> 





  parent reply	other threads:[~2002-03-04 12:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-02 18:17 Converting Char to Enum Lars Noschinski
2002-03-03  1:15 ` sk
2002-03-03 16:43   ` Robert Dewar
2002-03-03 18:54     ` Lars Noschinski
2002-03-03 20:07       ` Larry Kilgallen
2002-03-03 20:21         ` Lars Noschinski
2002-03-03 22:46           ` Larry Kilgallen
2002-03-04  6:55           ` Jeffrey Carter
2002-03-03 20:13       ` tmoran
2002-03-03  6:30 ` tmoran
2002-03-04 11:01 ` sk
     [not found] ` <3C835426.DA864199@myob.com>
2002-03-04 12:48   ` David C. Hoos, Sr. [this message]
2002-03-04 16:36     ` Lars Noschinski
2002-03-04 23:17       ` David C. Hoos
2002-03-05 15:55         ` Lars Noschinski
2002-03-05 20:15           ` David C. Hoos
  -- strict thread matches above, loose matches on Subject: below --
2002-03-06  6:23 Christoph Grein
replies disabled

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