comp.lang.ada
 help / color / mirror / Atom feed
From: Dmitry A. Kazakov <mailbox@dmitry-kazakov.de>
Subject: Re: Generic default parameters
Date: Mon, 13 May 2002 10:49:12 +0200
Date: 2002-05-13T10:49:12+02:00	[thread overview]
Message-ID: <e1uudust53uc95gecju9hujrjfrn3svemr@4ax.com> (raw)
In-Reply-To: MPG.1745f522613b2fb598968d@news.ip-plus.net

On Fri, 10 May 2002 16:22:50 +0200, Thomas Wolf <t_wolf@angelfire.com>
wrote:

>It seems I'm not alone with these ideas... so let's summarize
>and see if we can get a halfway decent proposal for the ARG
>out of the discussions:
>
>Ada 95 lacks features for:
>
>1 .. 5

6. A more liberal matching of actual subprograms against formal ones.
If some parameters of the actual subrogram have defaults, then they
can be absent in the formal one.

generic
   with procedure Put (Item  : in Object) is <>;
package Foo ...

Then an instantiation with Integer_IO.Put:

procedure Put
(  Item  : in Num;
   Width : in Field := Default_Width;
   Base  : in Number_Base := Default_Base
);

should be legal.

7. Incomplete instantiations:

   package X is new Y (<>);
   --
   -- No actual parameters given.
   -- All declarations of the visible part of X
   -- are incomplete here in usual sense.
   -- I.e. if X declares a a type XX then
   --    type XX_Ptr is access X.XX;
   -- would be OK.
. . .
private
   package X is new Y (<parameter-list>);

The formal parameters which actuals are not visible in the public
part, shall be only used in the private part or the body of the
generic. The idea is to instantiate a generic with some private things
and yet to have the instance visible.

---
Regards,
Dmitry Kazakov
www.dmitry-kazakov.de



  parent reply	other threads:[~2002-05-13  8:49 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-10 14:22 Generic default parameters Thomas Wolf
2002-05-10 16:38 ` Preben Randhol
2002-05-10 16:50   ` Marin David Condic
2002-05-11  9:29     ` Simon Wright
2002-05-13 15:03       ` Hyman Rosen
2002-05-11 12:28     ` Preben Randhol
2002-05-13 14:03       ` Marin David Condic
2002-05-13 14:49       ` Hyman Rosen
2002-05-10 19:04   ` Hyman Rosen
2002-05-11 12:23     ` Preben Randhol
2002-05-11 13:49       ` Larry Kilgallen
2002-05-13 14:06       ` Marin David Condic
2002-05-10 19:27   ` Randy Brukardt
2002-05-11 12:32     ` Preben Randhol
2002-05-10 22:14 ` Stephen Leake
2002-05-13  7:49   ` Thomas Wolf
2002-05-13  8:49 ` Dmitry A. Kazakov [this message]
2002-05-13 14:00   ` Stephen Leake
2002-05-13 15:21     ` Dmitry A. Kazakov
2002-05-13 16:42       ` Stephen Leake
2002-05-14 10:24         ` Dmitry A. Kazakov
2002-05-14 14:02           ` Stephen Leake
2002-05-15 10:08             ` Dmitry A. Kazakov
  -- strict thread matches above, loose matches on Subject: below --
2002-05-14  4:57 Grein, Christoph
2002-05-14 10:23 ` Dmitry A. Kazakov
2002-05-14 11:03 Grein, Christoph
2002-05-14 12:01 ` Dmitry A. Kazakov
2002-05-14 14:05   ` Stephen Leake
2002-05-15  8:44     ` Dmitry A. Kazakov
replies disabled

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