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,227757d168eaa8a5 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!cyclone1.gnilink.net!gnilink.net!news-east.rr.com!news.rr.com!news-server.columbus.rr.com!cyclone2.kc.rr.com!news2.kc.rr.com!twister.socal.rr.com.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada Subject: Re: A question re meaning/use of the "for ... use ..." References: <41b3291e$0$44072$5fc3050@dreader2.news.tiscali.nl> From: Keith Thompson Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:ShkNUMxtCzNbBJytZmCDUtMV7yo= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 08 Dec 2004 03:18:50 GMT NNTP-Posting-Host: 66.91.240.168 X-Complaints-To: abuse@rr.com X-Trace: twister.socal.rr.com 1102475930 66.91.240.168 (Tue, 07 Dec 2004 19:18:50 PST) NNTP-Posting-Date: Tue, 07 Dec 2004 19:18:50 PST Organization: RoadRunner - West Xref: g2news1.google.com comp.lang.ada:6828 Date: 2004-12-08T03:18:50+00:00 List-Id: "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.