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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: ANN: Introducing AdaBase - Thick database bindings for Ada Date: Sat, 21 May 2016 11:20:20 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <6784b2fe-96cf-46cb-b3a6-00a0e2f2bf16@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 21 May 2016 18:16:49 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="48b46be33beed75863f69afa437f956b"; logging-data="10249"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+N5PmCJALiX0lFh5tLUVLWXGWzTW7t890=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 In-Reply-To: <6784b2fe-96cf-46cb-b3a6-00a0e2f2bf16@googlegroups.com> Cancel-Lock: sha1:MGNw9CPOEVhEqEeT6gHH0YWm7+o= Xref: news.eternal-september.org comp.lang.ada:30452 Date: 2016-05-21T11:20:20-07:00 List-Id: On 05/21/2016 09:54 AM, jrmarino wrote: > > I left the prefixes on the field_types enumeration because the "there's > no reason for it" assertion was obviously false (regardless if the solution > is universally liked, there was definitely a reason for it). Now that I've looked at this in a little greater detail, I see that the enumeration type in question is in a different package from the other types that you want to have the same names as the enumeration literals, and so they have different complete names. For example package P1 is type Field_Size_ID is (One_Byte, Two_Bytes); end P1; package P1.P2 is type One_Byte is mod 2 ** 8; type Two_Bytes is mod 2 ** 16; end P1.P2; package P1.P2.P3 is type R (Kind : Field_Size_ID := P1.One_Byte) is record case Kind is when P1.One_Byte => Small : One_Byte := 0; when P1.Two_Bytes => Big : Two_Bytes := 0; end case; end record; end P1.P2.P3; compiles fine. It seems the only reason for the prefixes on the enumeration literals was a desire to avoid the extra typing required to prefix the literals with the pkg name. -- Jeff Carter "Son of a window-dresser." Monty Python & the Holy Grail 12