comp.lang.ada
 help / color / mirror / Atom feed
From: "J-P. Rosen" <rosen@adalog.fr>
Subject: Re: Gnat bug or mistaken program?
Date: Wed, 28 Jul 2021 07:21:38 +0200	[thread overview]
Message-ID: <sdqph0$sjg$1@dont-email.me> (raw)
In-Reply-To: <imaos8Fii64U1@mid.individual.net>

Le 27/07/2021 à 18:00, Niklas Holsti a écrit :
>> * Rename the operation:
>>    function "**" (Left : Float; Right : Float) return Float renames
>>       Ada.Numerics.Elementary_Functions."**";
>>    This makes the specific operation visible
> 
> 
> Before Ada got "use type", such renaming declarations were the only 
> alternative to "use package", but they are verbose and proved (in my 
> experience, and that of others too) to be very error-prone, mainly when 
> renaming many operators -- copy-paste errors were rampant and hard to 
> find by reading. Interesting effects occur when "-" is renamed as "+" or 
> vice versa. I consider this solution to be the last (worst) choice.

With AdaControl, you can check that operators that are renamed as a 
different operator:
    check renaming_declarations
       (not identical operator as_operator function);

(This syntax is from the soon-to-be-released new version of AdaControl - 
wavefront available from GitHub: github.adalog.fr)

-- 
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52
https://www.adalog.fr

  reply	other threads:[~2021-07-28  5:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-20 12:02 Gnat bug or mistaken program? Richard Iswara
2021-07-20 14:09 ` Niklas Holsti
2021-07-21  2:23   ` Richard Iswara
2021-07-21  8:29     ` Jeffrey R. Carter
2021-07-21 16:56       ` Shark8
2021-07-22  2:14         ` Richard Iswara
2021-07-27 16:00       ` Niklas Holsti
2021-07-28  5:21         ` J-P. Rosen [this message]
2021-07-29  0:46         ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox