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=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bc000d321972308e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-10-16 05:14:41 PST Path: bga.com!news.sprintlink.net!sundog.tiac.net!wizard.pn.com!Germany.EU.net!EU.net!uunet!newsgate.watson.ibm.com!watnews.watson.ibm.com!ncohen From: ncohen@watson.ibm.com (Norman H. Cohen) Newsgroups: comp.lang.ada Subject: Re: Fixed point operator visibility question Date: 14 Oct 1994 14:42:46 GMT Organization: IBM T.J. Watson Research Center Distribution: world Message-ID: <37m5d6$cp3@watnews1.watson.ibm.com> References: <00985E28.98D9FB40.9907@iberia.cca.rockwell.com> Reply-To: ncohen@watson.ibm.com NNTP-Posting-Host: rios8.watson.ibm.com Date: 1994-10-14T14:42:46+00:00 List-Id: In article <00985E28.98D9FB40.9907@iberia.cca.rockwell.com>, mlc@iberia.cca.rockwell.com (Michael Cook) writes: |> My viewpoint is that fixed point division is defined by package |> STANDARD, see Ada RM, section 4.5.5, para 9-11. And so the division |> should be visible without the 'use' clause. You are quite right. See also the last two declarations in Annex C, paragraph 11. |> Vendor A's claim is that the example deals with visibility of |> operations of derived types. The argument is that Fixed_Type is |> a derived type of an anonymous predefined fixed point type (RM |> 3.5.9 para 9). |> |> The derived type introduces a derived "/" operator, that hides the |> predefined "/" operator in the scope of the declaration of Fixed_Type |> (RM 3.4 para 5). Vendor A is wrong. The "/" operator in question is not an operation of the parent fixed-point type. Rather, it is a "magic" operation that takes operands of ANY fixed-point type and produces a result of type universal_fixed. Thus it is not inherited. |> package Fixed_Type_Example is |> |> Fixed_Type_Delta : constant := 1.0 / (2.0 ** 27); |> |> type Fixed_Type is delta Fixed_Type_Delta range -16.0 .. 16.0; |> |> end Fixed_Type_Example; |> |> ------------------------- |> |> with Fixed_Type_Example; ... |> type Value_Type is range -2**15 .. 2**15 - 1; ... |> H : Fixed_Type_Example.Fixed_Type; |> PH : Fixed_Type_Example.Fixed_Type; |> |> PCV : Value_Type; ... |> PCV := Value_Type (H / PH); -- Norman H. Cohen ncohen@watson.ibm.com