comp.lang.ada
 help / color / mirror / Atom feed
From: stt@henning.camb.inmet.com (Tucker Taft)
Subject: Re: access to subprogram disciminants
Date: 1996/04/24
Date: 1996-04-24T00:00:00+00:00	[thread overview]
Message-ID: <DqDnq1.7t.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: 4livr5$rq3@news1.delphi.com

tmoran@bix.com wrote:
: I want to declare an object with parameters, in particular, a
: procedure parameter.  In Ada 83 I would have put the object in a
: generic package and used the procedure as a parameter of the package.
: In Ada 95 it appears I can make the object a record with a discriminant
: of 'access to subprogram' type.  But when I try this, it always seems
: to run into accessibility problems.

You example, after filling in the "..." with something reasonable,
compiles fine for me.  What is the "accessibility" problem you
are having?  Are you trying to use a nested procecedure?

: package definer is
:   type a_s is access procedure(x:in out integer);
:   type objects(s:a_s) is record ...
: end definer;
: with definer;
: package user is
:   procedure p(x:in out integer);
:   object:objects(p'access);
          ^^ "definer."
: ..

: 1) How is this supposed to be done?

I'm not sure what you are trying to accomplish, but the
above is legal (modulo a few typos, etc.)

: 2) Other than generics or discriminants of records (or tasks),
: what other ways are there of creating parameterized objects in Ada?

Again, I am not exactly sure what you mean by "parameterized" 
objects.  It might be helpful to understand the ultimate problem
you are trying to solve.  The specific solution you have sketched
out doesn't explain what is the underlying task to be solved.

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




  reply	other threads:[~1996-04-24  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-04-23  0:00 access to subprogram disciminants tmoran
1996-04-24  0:00 ` Tucker Taft [this message]
  -- strict thread matches above, loose matches on Subject: below --
1996-04-24  0:00 tmoran
1996-04-25  0:00 ` Tucker Taft
1996-04-26  0:00 tmoran
1996-04-26  0:00 ` Robert I. Eachus
1996-04-26  0:00 ` Tucker Taft
1996-04-27  0:00 tmoran
replies disabled

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