comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm.tsoh.plus-bug.bauhaus@maps.futureapps.de>
Subject: Re: default formal parameters in generic declarations
Date: Fri, 07 Mar 2008 11:51:49 +0100
Date: 2008-03-07T11:51:50+01:00	[thread overview]
Message-ID: <47d11e46$0$25511$9b4e6d93@newsspool1.arcor-online.net> (raw)
In-Reply-To: <87lk4vv5kg.fsf@ludovic-brenta.org>

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.



  reply	other threads:[~2008-03-07 10:51 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-02 17:21 default formal parameters in generic declarations Eric Hughes
2008-03-02 17:42 ` Robert A Duff
2008-03-02 19:40   ` Eric Hughes
2008-03-03  9:17     ` Dmitry A. Kazakov
2008-03-03 11:15       ` Georg Bauhaus
2008-03-03 13:56         ` Dmitry A. Kazakov
2008-03-04 16:15       ` Eric Hughes
2008-03-04  3:43     ` Randy Brukardt
2008-03-04 16:51       ` Eric Hughes
2008-03-04 18:43         ` Randy Brukardt
2008-03-05 21:08           ` Eric Hughes
2008-03-06  9:32             ` Georg Bauhaus
2008-03-06 18:05               ` Eric Hughes
2008-03-06 22:41                 ` Ludovic Brenta
2008-03-07 10:51                   ` Georg Bauhaus [this message]
2008-03-07 20:09                     ` Eric Hughes
2008-03-03 12:42 ` Stephen Leake
2008-03-04 13:50   ` Dr. Adrian Wrigley
2008-03-04 16:56     ` Eric Hughes
2008-03-04 16:44   ` Eric Hughes
2008-03-05 13:11     ` Stephen Leake
2008-03-05 21:41       ` Eric Hughes
replies disabled

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