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-Thread: 103376,6129ccd596d4814d,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!cyclone1.gnilink.net!gnilink.net!bigfeed2.bellsouth.net!news.bellsouth.net!elnk-atl-nf1!newsfeed.earthlink.net!stamper.news.atl.earthlink.net!newsread2.news.atl.earthlink.net.POSTED!d9c68f36!not-for-mail From: Marin David Condic User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Abstract Operations On A Tagged Record Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Sat, 30 Oct 2004 13:04:37 GMT NNTP-Posting-Host: 209.165.4.249 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.news.atl.earthlink.net 1099141477 209.165.4.249 (Sat, 30 Oct 2004 06:04:37 PDT) NNTP-Posting-Date: Sat, 30 Oct 2004 06:04:37 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: g2news1.google.com comp.lang.ada:5911 Date: 2004-10-30T13:04:37+00:00 List-Id: Can someone clarify my understanding (perhaps again) on abstract operations and the implications as a class heierarchy is being constructed? Specifically, what I want is something like this: A base class has an abstract operation, but I may not yet know the data types of the parameters - or possibly even the number of parameters. Let's say what I want is like this: procedure Some_Op () is abstract ; When I get to the child class, what I really need is: procedure Some_Op (Some_Param1 : in Integer; Some_Param2 : in Float) ; For a different child class I may want: procedure Some_Op (Some_Param1 : in Integer; Some_Param2 : in Character; Some_Param3 : in Boolean) ; The base class wants to express the basic necessity of "Some_Op" but it really doesn't know if it will have 1, 2 or N parameters or of what type. My understanding is that if I express that as an abstract operation, when I get to the child class, I'll have to supply a real operation of the same name and same parameter profile. (Or can I use a different parameter profile & satisfy the need for a concrete implementation of the abstract op? My recollection is the compiler whines about it or creates an overloading. Is this correct?) I realize I can make another procedure "Some_Op" with a different parameter list and that overloading will take care of me, but then I didn't really need the abstract procedure in the first place, did I? It becomes unnecessary baggage that you have to fill in just because its there, but you have no intention of using it. Do I understand this correctly? Is there away around it? Keep in mind that what I want to express is the notion in a base class that Operation X needs to be present, but the precise parameters to X will be determined by the child class. I'm interested *specifically* in how this works with an abstract tagged record and the inheritance heierarchy that goes with it, so please don't suggest that I'm going about it all wrong and I really need to do something with a generic, etc... If my understanding is correct and it can't be done then we just trash that notion and go to other techniques, but I want to know how this capability works. Thanks. MDC -- ====================================================================== Marin David Condic I work for: http://www.belcan.com/ My project is: http://www.jsf.mil/NSFrames.htm Send Replies To: m o d c @ a m o g c n i c . r "Power corrupts. Absolute power is kind of neat" -- John Lehman, Secretary of the Navy 1981-1987 ======================================================================