comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Limited_Controlled and out parameters
Date: Fri, 22 Jun 2012 12:12:33 -0700 (PDT)
Date: 2012-06-22T12:12:33-07:00	[thread overview]
Message-ID: <af8dd3f8-fa22-4485-ae8e-8a21f3210bbd@googlegroups.com> (raw)
In-Reply-To: <js287m$iv6$1@dont-email.me>

On Friday, June 22, 2012 9:58:31 AM UTC-7, J-P. Rosen wrote:
> Le 22/06/2012 17:43, Adam Beneschan a écrit :
> 
> > I also wouldn't worry about "cheating".  For by-reference parameters,
> > I don't think there's that much difference between OUT and IN OUT, if
> > any. [...]
> From the point of view of the implementer, you are right. However, by
> having an OUT parameter, you are telling your user: "I don't use the
> value in your variable; even if it is uninitialized, it's OK".

Can a controlled variable (or subcomponent) ever really be uninitialized?  I guess it might, or it might be partly uninitialized.  However, if the controlled type has a Finalize routine that reads components of the type, those components had darn well better  not be uninitialized garbage.  (That is, allowing for cases where, say, a Boolean component indicates whether other components in the record are initialized or not.  But that Boolean had better not be garbage.)

                                 -- Adam



  reply	other threads:[~2012-06-22 19:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-22 13:37 Limited_Controlled and out parameters Maciej Sobczak
2012-06-22 15:43 ` Adam Beneschan
2012-06-22 16:58   ` J-P. Rosen
2012-06-22 19:12     ` Adam Beneschan [this message]
2012-06-22 21:41       ` Robert A Duff
2012-06-22 20:22   ` Randy Brukardt
2012-06-23 12:02     ` Maciej Sobczak
replies disabled

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