comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
To: <comp.lang.ada@ada-france.org>
Subject: RE: 2 Ada 95/05 language design questions
Date: Thu, 15 Feb 2007 19:51:31 -0600
Date: 2007-02-16T02:55:01+01:00	[thread overview]
Message-ID: <mailman.99.1171590694.18371.comp.lang.ada@ada-france.org> (raw)
In-Reply-To: <1171580374.075519.138610@h3g2000cwc.googlegroups.com>

pnkflyd831@gmail.com writes:
> On Feb 15, 3:35 pm, Robert A Duff <bobd...@shell01.TheWorld.com>
> wrote:
...
> > One solution would be to have some syntax that means "this type might
> > have some private abstract operations, and therefore all derivations
> > from it must be in places where the full type is visible".  But I don't
> > think you want to treat ALL types that way.
> >
>
> Your absolutely correct.  My intent was not that all derived type
> linages must match the package lineage.  Additional syntax or the fact
> that the private abstract subprogram is still visible from the spec to
> the compiler and it could complain at compile time when you attempt to
> create a child that doesn't have the full type visible.

Additional syntax is OK. Making the legality of uses (in this case, derived
types) depend on the contents of the private part is not OK. Doing so breaks
encapsulation, in that a supposedly innocent change could cause all kinds of
unrelated code to fail.

I'm mildly surprised that you didn't mention the "no hidden interfaces" rule
of Ada 2007, because that seems to me to be much more problematic than
declaring a hidden abstract operation. OTOH, if you think of interfaces as
properties of a type (either a type has one or it does not; a type cannot
have one more than once), it makes more sense. But I've often thought that
I'm the only one with that particular model...

              Randy.




  reply	other threads:[~2007-02-16  1:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-15 16:21 2 Ada 95/05 language design questions pnkflyd831
2007-02-15 18:33 ` Adam Beneschan
2007-02-15 18:36 ` Dmitry A. Kazakov
2007-02-15 20:35 ` Robert A Duff
2007-02-15 22:59   ` pnkflyd831
2007-02-16  1:51     ` Randy Brukardt [this message]
2007-02-16 18:52     ` Adam Beneschan
2007-02-15 21:51 ` Simon Wright
2007-02-15 23:00 ` pnkflyd831
replies disabled

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