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,43f6bd9b498b66d0 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.glorb.com!news.cs.univ-paris8.fr!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Fri, 07 Mar 2008 11:51:49 +0100 From: Georg Bauhaus Reply-To: rm.tsoh+bauhaus@maps.futureapps.de User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: default formal parameters in generic declarations References: <9b3bac4d-5ae1-4a1b-a81e-9aa9ae1843e0@e31g2000hse.googlegroups.com> <0078161e-64c7-4fa8-9794-b840d855a88b@q78g2000hsh.googlegroups.com> <47cfba2a$0$14412$9b4e6d93@newsspool3.arcor-online.net> <8c4ddd97-42ab-454f-9ca4-89bf23e15fa0@b1g2000hsg.googlegroups.com> <87lk4vv5kg.fsf@ludovic-brenta.org> In-Reply-To: <87lk4vv5kg.fsf@ludovic-brenta.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <47d11e46$0$25511$9b4e6d93@newsspool1.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 07 Mar 2008 11:51:50 CET NNTP-Posting-Host: f301534a.newsspool1.arcor-online.net X-Trace: DXC=M26SE60T30PHigV@eW57PQic==]BZ:af^4Fo<]lROoRQFl8W>\BH3YRMG1fobIVTXRA:ho7QcPOVS]:1nO3^>A:Ze4VTUn0QXoT X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:20218 Date: 2008-03-07T11:51:50+01:00 List-Id: Ludovic Brenta wrote: > Eric Hughes writes: >> On Mar 6, 2:32 am, Georg Bauhaus wrote: >>> By way of speculation, can nesting, to the extent it is absent from C++, >>> lead to at least a partial solution of this problem? >> [example deleted] >> I note here that your example uses a formal >> default subprogram. > The actual subprogram may very well be nested in a package that > declares all the necessary types and variables to keep the state. Yes, and in C, too, a local static struct might keep state. But actually, the function in the example, generic Additional_Operations_Object: Functionality_Interface'Class := Add_Ops_Factory.New_Object; package Foo is type T is ... is used only to provide a default object of a suitable abstract type (which could be Any'Class) on instantiation. This object can be overridden, passed downwards to other instantiations, "intercepted" by different Functionality_Interface'Class objects... But, as Eric has explained, going along this path does not yet lead to complete solution.