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!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: On naming space and the good use of qualified expression Date: Fri, 19 Jan 2018 19:55:53 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <310b1dea-459b-4a8b-b249-5bb63ea43512@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 19 Jan 2018 18:55:54 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="33bb6965cc188c595acfcab7cae6aecc"; logging-data="24984"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/OqRk+rVs/as1FaPtvihZE3qgkwMKsdKo=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 In-Reply-To: <310b1dea-459b-4a8b-b249-5bb63ea43512@googlegroups.com> Content-Language: en-US Cancel-Lock: sha1:i2fqFwYHEXR4lE5r+LcASiOlosA= Xref: reader02.eternal-september.org comp.lang.ada:50010 Date: 2018-01-19T19:55:53+01:00 List-Id: On 01/19/2018 06:51 PM, Mehdi Saada wrote: > At that point of the program, I have three "/" operators visibles: > function "/" (A: T_Rational, B: T_Rational) return T_Rational; > function "/" (A: T_Integer, B: T_Integer) return T_Integer; > function "/" (A: T_Integer, B: T_Integer) return T_Rational; -- my constructor method > which makes this expression ambiguous: > Result.Coef(Ind) := Poly_A.Coef(Ind+1) * (Ind+1)/1; Note that this should be evaluated as (Poly_A.Coef (Ind + 1) * (Ind + 1) ) / 1 and understanding it requires knowing what "*" operators are visible. > Result.Coef(Ind) := Poly_A.Coef(Ind+1) * T_Rational'((Ind+1)/1); This looks like it should work, but without a complete reproducer I can't tell why it doesn't. -- Jeff Carter "Every sperm is sacred." Monty Python's the Meaning of Life 55