comp.lang.ada
 help / color / mirror / Atom feed
From: Serge Robyns <serge.robyns@gmail.com>
Subject: Re: I'm facing an issue with: call to abstract procedure must be dispatching
Date: Tue, 8 Dec 2015 14:43:59 -0800 (PST)
Date: 2015-12-08T14:43:59-08:00	[thread overview]
Message-ID: <feb10a24-79ba-4d04-be64-2e9faff19711@googlegroups.com> (raw)
In-Reply-To: <112596d0-d4ee-46e9-a02d-8de837aff352@googlegroups.com>

On Tuesday, 8 December 2015 22:55:33 UTC+1, Serge Robyns  wrote:
> On Tuesday, 8 December 2015 22:09:13 UTC+1, Dmitry A. Kazakov  wrote:
> > On Tue, 8 Dec 2015 12:21:31 -0800 (PST), Serge Robyns wrote:
> > 
> > If you really need mix-in then better do it like this:
> > 
> >    type T_Abstract_Data_Store
> >       (  Clients : not null access T_Abstract_Client'Class;
> >          Store2 : not null access T_Abstract_Store2'Class
> >       )  is abstract tagged limited record
> > 
> > This would add a bit more safety, much needed when using access types.
> 

Done, everything is completed and runs.  The tag error was a "hidden" bug where I didn't return the right child class.  Once I got around the issue the changes went quickly through and I would have had only one bug if I had used the above construct immediately as the compiler wouldn't allowed me to "forget".  This is what amazes me with Ada.

Now I've a generic question with regards to access type vs. in-out for parameters.  What is the proper Ada way to pass the "Store" around?
Is it:
Procedure Do_Something (A_Store : in out T_Abstract_Store'Class);
or:
Procedure Do_Something (A_Store : not null access T_Abstract_Store'Class);
?

As a former C programmer my habit goes for the not null access variant.

Regards,
Serge


  reply	other threads:[~2015-12-08 22:43 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-08 16:45 I'm facing an issue with: call to abstract procedure must be dispatching Serge Robyns
2015-12-08 16:59 ` G.B.
2015-12-08 17:04 ` Dmitry A. Kazakov
2015-12-08 17:24   ` Serge Robyns
2015-12-08 17:42     ` Dmitry A. Kazakov
2015-12-08 18:00       ` Serge Robyns
2015-12-08 18:22         ` Dmitry A. Kazakov
2015-12-08 20:21           ` Serge Robyns
2015-12-08 21:08             ` Dmitry A. Kazakov
2015-12-08 21:55               ` Serge Robyns
2015-12-08 22:43                 ` Serge Robyns [this message]
2015-12-08 22:55                   ` Jeffrey R. Carter
2015-12-09 23:03                     ` Randy Brukardt
2015-12-10  8:38                       ` Serge Robyns
2015-12-10 23:43                         ` Randy Brukardt
2015-12-09  8:48                 ` Dmitry A. Kazakov
2015-12-09 10:53               ` G.B.
2015-12-09 12:03                 ` Dmitry A. Kazakov
2015-12-09 13:42                   ` G.B.
2015-12-09 14:23                     ` Dmitry A. Kazakov
2015-12-08 22:55             ` Jeffrey R. Carter
2015-12-08 23:04               ` Serge Robyns
2015-12-08 23:42                 ` Jeffrey R. Carter
2015-12-09 13:40                 ` Jere
2015-12-09 13:48                   ` G.B.
2015-12-09 15:33                     ` Jere
2015-12-13 21:37                 ` Shark8
2015-12-14  2:20                   ` Jeffrey R. Carter
2015-12-15  7:26                     ` Shark8
2015-12-08 17:30 ` Jeffrey R. Carter
2015-12-08 17:48   ` Serge Robyns
2015-12-08 18:46     ` Jeffrey R. Carter
2015-12-08 20:28       ` Serge Robyns
2015-12-08 22:20     ` Simon Wright
replies disabled

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