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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b8b8a54001adc4d2 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Possible Ada deficiency? Date: Tue, 11 Jan 2005 11:05:34 +0100 Organization: cbb software GmbH Message-ID: <2fox50wz0bjt.11s42l7qwiefu.dlg@40tude.net> References: <1104516913.718856.94090@z14g2000cwz.googlegroups.com> <16jm4u4b7j5bh.5r4falzh3k6a$.dlg@40tude.net> <9ls4dpw9xkri$.1t4b3d8zglukq.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: individual.net ImDKM6N+wumlsRxzmci+JQLetiOz7jLos4wNvY2OElTbabFA0= User-Agent: 40tude_Dialog/2.0.12.1 Xref: g2news1.google.com comp.lang.ada:7637 Date: 2005-01-11T11:05:34+01:00 List-Id: On 10 Jan 2005 20:44:42 +0100, Pascal Obry wrote: > "Dmitry A. Kazakov" writes: > >> You mean that there is a non-Ada body. But for Import I would provide an >> Ada body and place the pragma there (if that should be a pragma). Later one >> could replace the body with an Ada implementation and vise versa *without* >> touching specifications. > > Ok, but it seems wrong to me to hide Export/Import. This is definitly part of > the interface. To me it is just an implementation. > Reviewers/Users must know if this is imported or not. What for? What about specifying the library version number of the imported thing? Reviewer must rely on the contract. Linkage issues are not a contract to me. > Idem for > Inline, this is really part of the spec and tells you that the code will be > inline in yours. If you have size considerations for your code it seems quite > important to note this just by reading the spec. If so, then it must be a syntax like in C++ not a pragma. And the issue here is not the code size. Because it is quite difficult to predict. The only issue I see here is evaluation of constants at compile time. For example: procedure Trace (Text : String); pragma Inline Trace; procedure Trace (Text : String) is begin if Trace_On then Put (Text); end if; end Trace; When Trace_On is statically False we hope the compiler will remove calls to Trace upon inlining. In my view this issue should be controlled not by pragmas by the contract. If that were possible in some reasonably general way then we could do much more useful things than Trace above. We could allow user-defined array dopes, remove statically known discriminants, have specific object without tags. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de