comp.lang.ada
 help / color / mirror / Atom feed
From: "Martin Dowie" <martin.dowie@baesystems.com>
Subject: Re: Ada & Postgresql
Date: Mon, 6 Sep 2004 13:54:04 +0100
Date: 2004-09-06T13:54:04+01:00	[thread overview]
Message-ID: <413c5be5$1_1@baen1673807.greenlnk.net> (raw)
In-Reply-To: mailman.45.1094474634.31213.comp.lang.ada@ada-france.org

Marius Amado Alves wrote:
>> ...I can't pinpoint now what annoying Ada 95 feature
>> I was escaping back in 2001 when I wrote this package and its
>> applications. Never mind. Just write Pgsql_Controlled.
>
> OK, I just took the time to write this. While I'm at it, I'll control
> also Db_Type, to call Close on finalization. Oops, no, Ada 95 does not
> let me do that, it makes
>
>     function Execute (Db: Db_Type; Command: String) return
> Result_Type;
>
> illegal, because an "operation can be dispatching in only one type."
>
> This is one of many examples of what I call "Ada getting in the way."

But isn't the solution to this to just wrap one of them in a 'plain' record,
e.g.

package Foo is
   type Command_Type is private;
   type Result_Type is private;
   -- whatever
   function Bar (CT : Command_Type) return Result_Type;
private
   type Command_Type is new Ada.Controlled...
   procedure Finalize (C : in out Command_Type);

   type Inner_Result_Type is new Ada.Controlled...
   procedure Finalize (IR : in out Inner_Result_Type);

   type Result_Type is record
      IR : Inner_Result_Type;
   end record;
end Foo;

Cheers

-- Martin






  reply	other threads:[~2004-09-06 12:54 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-03 17:09 Ada & Postgresql Alex R. Mosteo
2004-09-03 20:51 ` Adrian Knoth
2004-09-04 11:41   ` Marius Amado Alves
2004-09-04 13:50 ` Pascal Obry
2004-09-06  8:42   ` Alex R. Mosteo
2004-09-06  9:13     ` Alex R. Mosteo
2004-09-06  9:44       ` Marius Amado Alves
2004-09-06 10:10         ` Alex R. Mosteo
2004-09-06 10:57           ` Marius Amado Alves
2004-09-06 11:37             ` Alex R. Mosteo
2004-09-06 11:54               ` Marius Amado Alves
     [not found]               ` <413C4FFE.1010105@netcabo.pt>
2004-09-06 12:03                 ` Marius Amado Alves
2004-09-06 12:43                 ` Marius Amado Alves
2004-09-06 12:54                   ` Martin Dowie [this message]
2004-09-06 13:17                     ` Marius Amado Alves
2004-09-06 13:19                   ` Dmitry A. Kazakov
2004-09-06 14:33                     ` Marius Amado Alves
2004-09-06 18:00                       ` Dmitry A. Kazakov
2004-09-06 15:18                   ` Jean-Marc Bourguet
2004-09-06 11:36           ` Marius Amado Alves
2004-09-06 12:56             ` Alex R. Mosteo
2004-09-06 13:12               ` Marius Amado Alves
2004-09-06 15:20                 ` Björn Persson
     [not found]       ` <413C318E.9050709@netcabo.pt>
2004-09-06 10:00         ` Marius Amado Alves
2004-09-06 10:27           ` Alex R. Mosteo
2004-09-06 11:34     ` Dmitry A. Kazakov
2004-09-07  7:02     ` Jerry van Dijk
2004-09-07  8:31       ` Alex R. Mosteo
2004-09-06 15:36 ` Wojtek Narczynski
2004-09-17  1:42   ` Warren W. Gay VE3WWG
2004-09-25 15:26     ` Michael Erdmann
2004-09-25 19:03       ` Pascal Obry
2004-09-29 20:56         ` Warren W. Gay VE3WWG
2004-09-29 21:11           ` Ludovic Brenta
2004-09-30  9:56           ` Benjamin Ketcham
2004-10-04 16:09             ` Warren W. Gay VE3WWG
replies disabled

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