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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,23cf9f1e93744eed X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-08-01 15:15:11 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!in.100proofnews.com!in.100proofnews.com!cycny01.gnilink.net!cyclone1.gnilink.net!wn14feed!wn13feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!sccrnsc04.POSTED!not-for-mail Message-ID: <3F2AE64F.30309@attbi.com> From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Need advice re package organization. References: <3F228F3B.9020203@attbi.com> <3F22F9E9.3040307@attbi.com> <5jn9ivoetll1fu2avn9hmjj6aaa7q7pmjn@4ax.com> <9d2Wa.301$jp.253@newsread4.news.pas.earthlink.net> <3F299920.9070603@attbi.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 66.31.71.243 X-Complaints-To: abuse@comcast.net X-Trace: sccrnsc04 1059776109 66.31.71.243 (Fri, 01 Aug 2003 22:15:09 GMT) NNTP-Posting-Date: Fri, 01 Aug 2003 22:15:09 GMT Organization: Comcast Online Date: Fri, 01 Aug 2003 22:15:10 GMT Xref: archiver1.google.com comp.lang.ada:41136 Date: 2003-08-01T22:15:10+00:00 List-Id: Stephen Leake wrote: > The core tool is probably best written in Ada using ASIS; it would be > somewhat similar to Auto_Text_IO. Emacs ada-mode and GPS could provide > user interfaces to the tool, but it would really need to be run as > part of the build process (from a makefile). > > Hmm. That would imply that the inquiry functions where in a child > package; no problem if they don't need to be dispatching. You made me think for a while, but I came back to my original idea. The problem with automatically generated non-dispatching inquiry functions would be that, when overloading occurs, the user is going to be really upset by the lack of a class-wide operation. The easiest way to explain it is that inserting a type conversion to a specific type would get the code to compile, but sometimes that conversion would raise an exception at run-time. So, I don't see problems occuring frequently, if your design is the more typical bushy Ada style derivation tree, but I see them as nasty when they arise. So I think it is much better to have the inquiry functions in the package which declares the type, which seems to rule out ASIS as a generator, unless the ASIS package generated as set of inquiry functions for the type and all types derived from it. This might require multiple child packages to be generated. A typical inquiry function might look like: function Selling_Price (Stock_Item'Class) return Dollars; And the ASIS tool would have to generate explicit dispatching code in the body, with the appropriate with clauses. I think that is probably overkill for inquiry functions, but it might work well for things like creating a model-view-controller environment with on screen display for things like bench testing subsystems. The test environment could automatically be generated from the software and a test script. (The test script would provide the inputs and a list of the objects to be displayed.) -- "As far as I'm concerned, war always means failure." -- Jacques Chirac, President of France "As far as France is concerned, you're right." -- Rush Limbaugh