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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,971aa11c293c3db1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-22 13:35:43 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!fr.usenet-edu.net!usenet-edu.net!enst!enst.fr!not-for-mail From: "David C. Hoos, Sr." Newsgroups: comp.lang.ada Subject: Re: Ada The Best Language? Date: Sun, 22 Jul 2001 15:35:01 -0500 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: References: <5be89e2f.0107170838.c71ad61@posting.google.com> <5be89e2f.0107180235.726d46a8@posting.google.com> <9j3rrd$g71$1@s1.read.news.oleane.net> <5be89e2f.0107181300.4b4e93d7@posting.google.com> <3B57195E.A3A3FED@home.com> <9j93u6$1ua8$1@norfair.nerim.net> <3B586A17.862BA84D@home.com> <9j9s3t$kn8$1@wanadoo.fr> <9jej7c$7q1$1@wanadoo.fr> Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 995834141 63399 137.194.161.2 (22 Jul 2001 20:35:41 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Sun, 22 Jul 2001 20:35:41 +0000 (UTC) Cc: To: 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.4 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , List-Archive: Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:10429 Date: 2001-07-22T15:35:01-05:00 ----- Original Message ----- From: "Bertrand Augereau" Newsgroups: comp.lang.ada To: Sent: July 22, 2001 8:13 AM Subject: Re: Ada The Best Language? > > No, they're not. Enums are simply names for integer values > > that can be assigned to integers, used in place of an integer in > > an expression, or passed as an argument to functions with an > > integer argument type. > Enum defines a new type. On the contrary, enums and integers are completely interchangable. > I don't see the flaw of having an implicit conversion to int, as long as > there's is no implicit conversion to the enum. Not only is implicit copnversion to enum, but you can convert values out of range of the enum definition. The only thing an enum type definition buys you is the ability to use the name as a standin for the number -- nothing more. Not only that, but the same name cannot be reused in C enums, but they can in Ada - in fact, Ada enumeration values can overload subprogram names. I hope that this demonstrates the original authors assertion that C enums are 'weak' to be a substantial understatement. > > > Furthermore, you can't get the name of an enum value as a > > string intrinsically from the type. In Ada, the 'Image attribute > > returns the name of the enumeration value. > > That is true, I love 'image > > > > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada.eu.org > http://ada.eu.org/mailman/listinfo/comp.lang.ada >