comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Rogoff <bpr@shellx.best.com>
Subject: Re: Generics question
Date: 1997/07/24
Date: 1997-07-24T00:00:00+00:00	[thread overview]
Message-ID: <Pine.SGI.3.95.970724193723.20390B-100000@shellx.best.com> (raw)
In-Reply-To: 5r7cvb$bfb@top.mitre.org


On 24 Jul 1997, Michael F Brenner wrote:
>     > To do a general numerical algorithm like you describe the Ada 95 idiom is:
>     >   generic
>     >   type Numeric_Type is private;
>     >   with function "+" (X,Y : Numeric_Type) return Numeric_Type is <>;
>     >   with function "-" (X,Y : Numeric_Type) return Numeric_Type is <>;
>     >   with function "*" (X,Y : Numeric_Type) return Numeric_Type is <>;
>     >   ... etc ...
>     >   package Numerics is
> 
> The etc is not too bad in an unnested generic package, but there is no limit
> to how big it can get in nested packages, which is why Ada-200X should
> consider passing packages to packages.

I don't understand. Ada 95 allows you to pass an instantiation of the
package Numerics to another generic package. The "etc" has to be done
because Ada generics must be explicitly instantiated. Could you describe 
your proposal, in "pseudo-Ada", and show how it helps with this problem?

I think that generic package parameters are pretty powerful, especially 
in combination with those signature packages. 

-- Brian







  reply	other threads:[~1997-07-24  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-07-22  0:00 Generics question Skip Carter
1997-07-22  0:00 ` W. Wesley Groleau x4923
1997-07-23  0:00 ` Brian Rogoff
1997-07-24  0:00   ` Michael F Brenner
1997-07-24  0:00     ` Brian Rogoff [this message]
1997-07-24  0:00     ` Jon S Anthony
1997-07-23  0:00 ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1989-09-19 23:03 Generics Question Jay Labhart
replies disabled

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