From: "Robert I. Eachus" <rieachus@attbi.com>
Subject: Re: problem with abstract types
Date: Thu, 31 Oct 2002 20:58:31 GMT
Date: 2002-10-31T20:58:31+00:00 [thread overview]
Message-ID: <3DC19973.1090001@attbi.com> (raw)
In-Reply-To: 3DC17454.6020407@acm.org
Jeffrey Carter wrote:
> I'm going to risk making a donkey of Fred Bloggs and his brother and
> guess that he really meant to type
>
> Reg : Registry'Class := Open_Registry (...);
Oops! Yep.
> I have used Open_Registry because that's the Ada Way :)
I was trying to not do too much of the Ada way and got burned! I would
normally do this:
package Registries is
type Registry is limited private;
type Access_Mode is (User_Mode, Supervisor_Mode);
function Open_Registry(Name: String; Mode: Access_Mode := User_Mode)
return Registry;
private
type Real_Registry(L: Natural) is tagged record
Name: String(1..L);
-- ...
end record;
type Registry is access Real_Registry'Class;
end Registries;
Actually, I'd probably go a bit further, and make Registry explicitly
Controlled, to ensure that Registry objects were explicitly finalized.
But that was definitely way out of bounds of this discussion.
next prev parent reply other threads:[~2002-10-31 20:58 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-31 12:06 problem with abstract types Ulrich Eckhardt
2002-10-31 13:15 ` John English
2002-10-31 14:43 ` Ulrich Eckhardt
2002-10-31 17:18 ` Robert I. Eachus
2002-10-31 18:20 ` Jeffrey Carter
2002-10-31 20:58 ` Robert I. Eachus [this message]
2002-11-01 10:57 ` Ulrich Eckhardt
2002-11-01 12:05 ` Simon Wright
2002-11-01 17:03 ` Robert A Duff
2002-11-04 15:18 ` Robert I. Eachus
2002-11-04 16:14 ` Robert A Duff
2002-10-31 13:32 ` David C. Hoos
2002-10-31 13:47 ` problem with posters Peter Hermann
2002-10-31 14:15 ` Preben Randhol
2002-10-31 14:35 ` problem with abstract types Ulrich Eckhardt
2002-11-01 8:31 ` Dmitry A.Kazakov
2002-11-01 11:32 ` Ulrich Eckhardt
2002-10-31 15:31 ` Simon Wright
2002-10-31 17:22 ` Stephen Leake
2002-11-01 10:25 ` Ulrich Eckhardt
2002-11-04 14:30 ` Ted Dennison
2002-11-04 15:08 ` Ulrich Eckhardt
2002-11-04 15:32 ` Stephen Leake
2002-11-04 17:12 ` Ulrich Eckhardt
2002-11-04 17:43 ` David C. Hoos
2002-11-04 19:34 ` Ulrich Eckhardt
2002-11-04 19:54 ` Stephen Leake
2002-11-04 20:08 ` Robert A Duff
2002-11-01 11:15 ` Preben Randhol
2002-11-01 17:21 ` Stephen Leake
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox