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-Thread: 103376,227757d168eaa8a5 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!freenix!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: "David C. Hoos" Newsgroups: comp.lang.ada Subject: Re: A question re meaning/use of the "for ... use ..." Date: Wed, 8 Dec 2004 07:48:06 -0600 Organization: Cuivre, Argent, Or Message-ID: References: <41b3291e$0$44072$5fc3050@dreader2.news.tiscali.nl> NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: melchior.cuivre.fr.eu.org 1102513843 32557 212.85.156.195 (8 Dec 2004 13:50:43 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Wed, 8 Dec 2004 13:50:43 +0000 (UTC) Cc: "comp.lang.ada@ada.eu.org" To: "Keith Thompson" Return-Path: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: g2news1.google.com comp.lang.ada:6843 Date: 2004-12-08T07:48:06-06:00 The Unchecked_Conversion is not between the 'Pos attribute and the representation, but rather between the enumeration type and its representation. All that is necessary for portability is to constrain the 'Size of both the enumeration type, and the integer type of its representation to have identical sizes. ----- Original Message ----- From: "Keith Thompson" Newsgroups: comp.lang.ada To: Sent: Tuesday, December 07, 2004 9:18 PM Subject: Re: A question re meaning/use of the "for ... use ..." > "Randy Brukardt" writes: > > "Jeffrey Carter" wrote in message > > news:H1Hsd.1987$yr1.256@newsread3.news.pas.earthlink.net... > >> Stephen Leake wrote: > >> > >> > There is no standard attribute that returns the internal > >> > representation specified by the enumeration representation clause. > >> > However, GNAT provides the non-standard 'Enum_Rep for this purpose. > >> > >> I have no problem with 'Pos returning the abstract position number, but > >> do think something like GNAT's 'Enum_Rep should be standard, along with > >> a conversion the other way, equivalent to 'Val ('Enum_Val?). > > > > The ARG discussed this long ago, and concluded that such a facility isn't > > needed. That's because Unchecked_Conversion provides the needed support. > > Indeed, this is one of the few cases where the result of > > Unchecked_Conversion is defined by the language (using it in this way will > > work on all Ada compilers). There was some discussion about syntax guides > > that prohibit the use of Unchecked_Conversion, but there is a lot of > > discomfort about changing the language just because some people's style > > guides are broken... > > How do you portably choose the target type for the Unchecked_Conversion? > > The 'Pos attribute returns a result of type universal_integer; there's > no way to make an Unchecked_Conversion return a universal_integer. > > -- > Keith Thompson (The_Other_Keith) kst-u@mib.org > San Diego Supercomputer Center <*> > We must do something. This is something. Therefore, we must do this. > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada-france.org > http://www.ada-france.org/mailman/listinfo/comp.lang.ada >