comp.lang.ada
 help / color / mirror / Atom feed
From: stt@houdini.camb.inmet.com (Tucker Taft)
Subject: Re: Some questions on a library design
Date: 1997/06/20
Date: 1997-06-20T00:00:00+00:00	[thread overview]
Message-ID: <EC3BMM.E1J.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: Pine.SGI.3.95.970616161142.25177A-100000@shellx.best.com


Brian Rogoff (bpr@shellx.best.com) wrote:

: ...
: Also, I thought it would be cool if I could do a partial instantiation of 
: a generic package to create a new generic package with fewer parameters,
: like 

: generic package Sets is new Red_Black_Trees ( Insert_Always => False );
: generic package Multisets is new Red_Black_Trees ( Insert_Always => True );

: Am I missing something, i.e., is there a good approximation to this
: functionality in Ada?

This is most easily done by defining a new generic that internally
instantiates the generic which has more parameters.  You could make
the inner instantiation visible if you want to be able to pass it
for a formal package parameter.  Alternatively, you could create
wrappers for all of its subprograms, and mark all of these wrappers
with a pragma "inline."

: -- Brian

-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Burlington, MA  USA




      parent reply	other threads:[~1997-06-20  0:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-16  0:00 Some questions on a library design Brian Rogoff
1997-06-17  0:00 ` Robert A Duff
1997-06-17  0:00   ` Brian Rogoff
1997-06-18  0:00     ` Robert A Duff
1997-06-18  0:00       ` Brian Rogoff
1997-06-20  0:00         ` Stephen Leake
1997-06-20  0:00           ` Brian Rogoff
1997-06-21  0:00   ` Nick Roberts
1997-06-22  0:00     ` Robert Dewar
1997-06-23  0:00     ` Tucker Taft
1997-06-20  0:00 ` Tucker Taft [this message]
replies disabled

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