comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Private extension of a synchronized interface
Date: Sun, 17 Feb 2019 10:50:21 +0100
Date: 2019-02-17T10:50:21+01:00	[thread overview]
Message-ID: <q4baou$1pbj$1@gioia.aioe.org> (raw)
In-Reply-To: fd975d66-8e70-4e86-8a75-efc6061ef25c@googlegroups.com

On 2019-02-16 01:52, Jere wrote:
> I'll get to my ultimate goal later, but while following various
> rabbit trails, I came across a situation I couldn't solve.  GNAT
> allows you to make private extensions to synchronized interfaces
> and it allows you to complete those private extensions with
> protected types.  I can't, however, figure out how it overrides
> the abstract procedures and functions of the synchronized interface.
> 
> If I don't specify an override and try to call the procedure, it complains
> that the procedure is abstract.  If I try to override the abstract
> function, it complains that the signature doesn't match the one in
> the protected body.  I don't know if this is a GNAT issue or
> something that Ada doesn't allow.  Here is some test code.  It
> compiles as is, but there are two parts that if you uncomment
> either one of those it fails to compile.

Reading RM 9.5.2 (13.2/2) does not really help:

"if the overriding_indicator is overriding, then the entry shall 
implement an inherited subprogram;"

An inherited subprogram is already implemented per, well, inheritance. 
May be it means:

1. shall implement a primitive operation (it overrides here);

2. shall implement an overridden primitive operation (it implements 
overriding declared earlier).

Neither #1 nor #2 work.

But synchronized interfaces are totally bogus from the software design 
POV. It is a pure implementation aspect exposed. Why do you care? 
Aggregate a protected object and delegate primitive operations to it.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  reply	other threads:[~2019-02-17  9:50 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-16  0:52 Private extension of a synchronized interface Jere
2019-02-17  9:50 ` Dmitry A. Kazakov [this message]
2019-02-17 13:46   ` Jere
2019-02-17 14:52     ` Dmitry A. Kazakov
2019-02-17 15:36       ` Jere
2019-02-17 16:28         ` Dmitry A. Kazakov
2019-02-17 20:56           ` Jere
2019-02-17 22:36 ` Simon Wright
2019-02-18  0:36   ` Jere
2019-02-18  8:11     ` Dmitry A. Kazakov
2019-02-18  8:29       ` Simon Wright
2019-02-18  8:42         ` Dmitry A. Kazakov
2019-02-18  8:26     ` Simon Wright
2019-02-18  8:33     ` Simon Wright
2019-02-18 15:40       ` Jere
2019-02-18 17:24         ` Simon Wright
2019-02-19 11:04           ` Simon Wright
2019-02-20  2:36             ` Jere
2019-02-20 10:46               ` Simon Wright
2019-02-20 15:04                 ` Jere
2019-02-18 15:49       ` Jere
2019-02-18 22:06 ` Randy Brukardt
2019-02-18 22:35 ` Randy Brukardt
2019-02-19 10:01   ` Egil H H
2019-02-19 11:29     ` Simon Wright
2019-02-19 11:53       ` Egil H H
2019-02-20  2:32   ` Jere
2019-02-20 13:46   ` Simon Wright
2019-02-20 23:43     ` Randy Brukardt
replies disabled

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