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,f7a9613bbc2bd8c9 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-13 07:04:24 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Generic default parameters Date: 13 May 2002 10:00:26 -0400 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1021298825 26532 128.183.220.71 (13 May 2002 14:07:05 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 13 May 2002 14:07:05 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:23950 Date: 2002-05-13T14:07:05+00:00 List-Id: Dmitry A. Kazakov writes: > 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. I like this. I don't see how it could be a problem. > 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 (); > > 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. This I'm less happy with. I think you can get the same effect with library instantiations and/or child packages. -- -- Stephe