From: tmoran@acm.org
Subject: Re: "access constant" discriminant
Date: Mon, 10 Feb 2003 18:57:03 GMT
Date: 2003-02-10T18:57:03+00:00 [thread overview]
Message-ID: <3CS1a.55972$2H6.1357@sccrnsc04> (raw)
In-Reply-To: _TO1a.14664$9y2.6601@nwrddc01.gnilink.net
>What is it that you want to do?
In the case at hand, I'm using the idiom of a limited controlled type
whose initialization/finalization grabs/releases a resource lock, and the
access discriminant tells which resource.
type Lock_Type(Resource : access Resource_Type) is new
Ada.Finalization.Limited_Controlled with ...
and later
Locker : Lock_Type(Resource'unchecked_access);
...
But this won't work when Resource is an "in" parameter, eg a function
parameter. I suppose Ada is telling me that grabbing a lock is
effectively modifying the resource, and thus something that shouldn't be
done when the resource is an "in" parameter, but the question remains, why
can't one say
type Lock_Type(Resource : access constant Resource_Type) ...
Did the designers foresee and forestall my use with a function?
next prev parent reply other threads:[~2003-02-10 18:57 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-10 8:26 "access constant" discriminant tmoran
2003-02-10 14:43 ` Frank J. Lhota
2003-02-10 18:57 ` tmoran [this message]
2003-02-15 19:17 ` Richard Riehle
2003-02-15 19:59 ` Larry Kilgallen
2003-02-15 23:53 ` Richard Riehle
2003-02-16 1:50 ` Eric G. Miller
2003-02-20 2:23 ` Matthew Heaney
2003-02-20 17:34 ` Stephen Leake
2003-02-21 0:42 ` Matthew Heaney
2003-02-21 10:41 ` Lutz Donnerhacke
2003-02-21 20:21 ` Randy Brukardt
2003-02-23 12:22 ` Simon Wright
2003-02-24 7:06 ` Dale Stanbrough
2003-02-24 18:58 ` Matthew Heaney
2003-02-24 21:05 ` Randy Brukardt
2003-02-25 14:15 ` Frank J. Lhota
2003-02-26 1:05 ` Randy Brukardt
2003-02-24 16:03 ` Matthew Heaney
2003-02-21 15:03 ` Hyman Rosen
2003-02-21 20:09 ` Randy Brukardt
2003-02-21 21:33 ` Matthew Heaney
2003-02-21 20:07 ` Randy Brukardt
2003-02-24 19:11 ` Matthew Heaney
2003-02-24 21:17 ` Randy Brukardt
2003-02-25 17:49 ` Richard Riehle
2003-02-20 2:23 ` Matthew Heaney
2003-02-20 2:20 ` Matthew Heaney
2003-02-10 19:26 ` Robert A Duff
2003-02-10 22:27 ` Rod Chapman
2003-02-11 2:00 ` Jeffrey Carter
2003-02-20 2:28 ` Matthew Heaney
2003-02-20 9:45 ` Lutz Donnerhacke
2003-02-20 2:17 ` Matthew Heaney
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox