comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: generic imports?  void* -> generics?
Date: 23 Sep 2003 21:28:13 +0100
Date: 2003-09-23T21:28:13+01:00	[thread overview]
Message-ID: <x7vvfrjuu5e.fsf@smaug.pushface.org> (raw)
In-Reply-To: vn16almd26pm07@corp.supernews.com

"Randy Brukardt" <randy@rrsoftware.com> writes:

> I would consider providing both.

Yes ..

>                                  This will be hard to use, because you have
> to declare an aliased, unconstrained buffer to be able to match the
> discriminant.
> 
>          Buf : aliased Stream_Element_Array (1..10);
> 
> won't work.

Yes ..

   Buf : aliased Stream_Element_Array := (1 .. 10 => 0);

means you end up writing to the darn thing anyway. GNAT users can take
their lives in their hands & used 'Unrestricted_Access on a
non-aliased object, of course.

> > I ask because (in another package) I had a Controlled type with a
> > visible Initialize and someone mistakenly called it .. I know they
> > could have done anyway, but its being there in the public part of
> > the package tempted them.
> 
> It's best if the abstraction can withstand extra calls to Initialize
> and Adjust; it has to withstand extra calls to Finalize (as they can
> happen in abort situations).

I can see the Initialize -- not so sure how you could tell about extra
Adjusts?



  reply	other threads:[~2003-09-23 20:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-19 19:20 generic imports? void* -> generics? chris
2003-09-19 20:46 ` chris
2003-09-19 21:18 ` Nick Roberts
2003-09-19 23:12   ` chris
2003-09-20 16:52   ` Simon Wright
2003-09-22 21:30     ` Randy Brukardt
2003-09-23  5:45       ` Simon Wright
2003-09-23 19:07         ` Randy Brukardt
2003-09-23 20:28           ` Simon Wright [this message]
2003-09-24 18:16             ` Randy Brukardt
2003-09-19 22:40 ` Matthew Heaney
2003-09-19 23:01   ` chris
2003-09-20  1:59   ` Jeffrey Carter
2003-09-20 13:52     ` Matthew Heaney
2003-09-23 22:39 ` chris
replies disabled

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