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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,81bb2ce65a3240c3 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.241.7 with SMTP id we7mr700734pbc.4.1336515096735; Tue, 08 May 2012 15:11:36 -0700 (PDT) MIME-Version: 1.0 Path: pr3ni3861pbb.0!nntp.google.com!news2.google.com!news3.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!85.12.40.139.MISMATCH!xlned.com!feeder7.xlned.com!news2.euro.net!newsfeed.x-privat.org!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: What would you like in Ada202X? Date: Tue, 8 May 2012 17:11:31 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <3637793.35.1335340026327.JavaMail.geo-discussion-forums@ynfi5> <20780405.1069.1336372385458.JavaMail.geo-discussion-forums@pbkc8> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1336515095 10142 69.95.181.76 (8 May 2012 22:11:35 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 8 May 2012 22:11:35 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Date: 2012-05-08T17:11:31-05:00 List-Id: "Niklas Holsti" wrote in message news:a0rsroFp8lU1@mid.individual.net... (Commenting only on the side-track) ... > This is a side track, but I don't see any compelling reason (except > compatibility) to define a standard default representation for enumeration > types. There is no standard representation for Booleans, integer types, > floats, records; why should enumeration types have one? (Is it a remnant > of a C-style identification of enumerations with integers?) > > Decades ago I liked to specify my own enumeration representations, but I > would think three times before doing it today. It is only useful for > unchecked conversions and I/O. If you use it for input, you have to mess > about with 'Valid or exceptions. 'Valid *and* exceptions. You can never assume that Program_Error is not raised; using an invalid value is a bounded error and the compiler is definitely allowed to raise Program_Error if the error is detected. (And Janus/Ada does detect it; as I previously noted, it uses the Position number for all operations, and if there is no Position number for a value, we have to do something, and the language says that is "raise Program_Error;") > For output, there are always other important considerations like memory > access width and byte ordering. I wasn't arguing that this capability is important, only that Ada has it and both the language design and the implementation have to take the possibility into account. We're surely not removing this capability! It's the same with the default representation for enumeration values. Probably 98% of Ada programs don't care at all about the representation, but even if only 0.1% do, changing it would break too many programs to consider it. (And the Unchecked_Conversion usage is not that unusual.) A new kind of enumeration type could have different rules, but that's confusing (since sometimes you can depend on the representation and sometime you can't). Randy.