comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Run-time accessibility checks (was: Construction initialization problem)
Date: Thu, 11 Dec 2008 16:31:29 -0600
Date: 2008-12-11T16:31:29-06:00	[thread overview]
Message-ID: <ghs4d0$8ol$1@munin.nbi.dk> (raw)
In-Reply-To: ghs3i2$80u$1@munin.nbi.dk

I said:

> ...
>> Because Ref_Type is not abstract, you will have to override all primitive 
>> operations of Target_Type, and assignment must be a primitive operation, 
>> and components getter/setters of, in case Target_Type were a record type, 
>> must be as well.
>
> That sounds like a maintenance headache (any change must be replicated 
> everywhere. That became such a pain for the Claw Builder program that it 
> almost ground development on it to a halt.)

By the way, if you don't care about the maintenance headache, you can do 
this with Ada today, using interfaces. Since an interface requires all of 
the operations to be redefined, you get exactly this behavior as long you 
define both types to inherit from the interface (not each other). That is:

type Something_Interface is interface;
<operations>

type Target_Type is new Something_Interface;
<implement operations>

type Ref_Type is new Something_Interface;
<reimplement operations>

I'm not sure what you need that can't be done this way. (I'm certain that no 
new feature is going to get added to the language if it is equivalent to 
what you can already do and doesn't even save much typing).

                                Randy.





  reply	other threads:[~2008-12-11 22:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-06 10:15 Run-time accessibility checks (was: Construction initialization problem) Dmitry A. Kazakov
2008-12-06 17:10 ` Ludovic Brenta
2008-12-07  8:44   ` Run-time accessibility checks Dmitry A. Kazakov
2008-12-07 14:56     ` Ludovic Brenta
2008-12-07 19:22       ` Dmitry A. Kazakov
2008-12-11  1:03     ` Randy Brukardt
2008-12-11  9:08       ` Dmitry A. Kazakov
2008-12-11  0:55 ` Run-time accessibility checks (was: Construction initialization problem) Randy Brukardt
2008-12-11  9:48   ` Run-time accessibility checks Dmitry A. Kazakov
2008-12-11 11:21     ` Georg Bauhaus
2008-12-11 11:40       ` Dmitry A. Kazakov
2008-12-11 22:15   ` Run-time accessibility checks (was: Construction initialization problem) Randy Brukardt
2008-12-11 22:31     ` Randy Brukardt [this message]
2008-12-13  0:49       ` Randy Brukardt
2008-12-13  9:06         ` Run-time accessibility checks Dmitry A. Kazakov
2008-12-16  1:53           ` Randy Brukardt
2008-12-16  9:28             ` Dmitry A. Kazakov
2008-12-16 22:21               ` Randy Brukardt
2008-12-17  8:54                 ` Dmitry A. Kazakov
2008-12-12  9:21     ` Dmitry A. Kazakov
replies disabled

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