From: "G.B." <rm-dash-bau-haus@dash.futureapps.de>
Subject: Re: Ada202X: Easy to use "UML private"-like components
Date: Fri, 21 Jun 2013 12:14:12 +0200
Date: 2013-06-21T12:14:12+02:00 [thread overview]
Message-ID: <51c42774$0$6633$9b4e6d93@newsspool2.arcor-online.net> (raw)
In-Reply-To: <28f43920-c490-4da0-80b3-6405dec09879@googlegroups.com>
On 21.06.13 11:33, Martin wrote:
> On Friday, June 21, 2013 10:23:51 AM UTC+1, Dmitry A. Kazakov wrote:
>> On Fri, 21 Jun 2013 01:43:05 -0700 (PDT), Martin wrote: > Secondly, I have to explain that using Ada "private" gives you "UML protected": Ada's private gives both protected for children of the package and private for non-children. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de
>
> But no easy means of keeping member data private from children.
But no pointers needed; I hope the following example
is a reasonably accurate paraphrase of a hint given
by Tucker Taft some years ago, memory is vague. Not
sure if UML has a concept for capturing this, but confident
that Grady Booch knows Ada's visibility rules well.
(Or should one find a sentence that has "possibilities"
instead of "rules"?)
package Opaque is
type Exposed is tagged private;
private
package Invisible is
type T is tagged private;
private
type Scalr is range 1 .. 2;
type T is tagged record
Comp_1 : Scalr;
end record;
end Invisible;
type Exposed is new Invisible.T with null record;
end Opaque;
private package Opaque.Child
is
A : Invisible.T;
Y : Invisible.Scalr := A.Comp_1;
end Opaque.Child;
Compiling: opaque-child.ads (source file time stamp: 2013-06-21 10:06:44)
4. Y : Invisible.Scalr := A.Comp_1;
1 2
>>> "Scalr" is not a visible entity of "Invisible"
>>> no selector "Comp_1" for private type "T" defined at
opaque.ads:8
5 lines: 2 errors
Thus, even a private child cannot see anything behind
doubled fences. I imagine that explaining this needs
some spin doctoring.
next prev parent reply other threads:[~2013-06-21 10:14 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-21 8:43 Ada202X: Easy to use "UML private"-like components Martin
2013-06-21 9:23 ` Dmitry A. Kazakov
2013-06-21 9:33 ` Martin
2013-06-21 10:14 ` G.B. [this message]
2013-06-21 11:19 ` Martin
2013-06-21 14:51 ` Dmitry A. Kazakov
2013-06-22 11:16 ` Martin
2013-06-22 12:10 ` Dmitry A. Kazakov
2013-06-21 18:36 ` Robert A Duff
2013-06-22 16:41 ` Niklas Holsti
2013-06-22 19:05 ` Dennis Lee Bieber
2013-06-22 22:57 ` Niklas Holsti
2013-06-23 3:26 ` Dennis Lee Bieber
2013-06-23 7:32 ` Niklas Holsti
2013-06-23 13:12 ` Robert A Duff
2013-06-23 14:06 ` Dmitry A. Kazakov
2013-06-23 15:15 ` Robert A Duff
2013-06-23 18:52 ` Dmitry A. Kazakov
2013-06-23 23:38 ` Robert A Duff
2013-06-24 7:16 ` Dmitry A. Kazakov
2013-06-24 20:11 ` Randy Brukardt
2013-06-25 7:21 ` Dmitry A. Kazakov
2013-06-25 19:06 ` Randy Brukardt
2013-06-24 20:07 ` Randy Brukardt
2013-06-23 14:40 ` Shark8
2013-06-23 15:28 ` Robert A Duff
2013-06-23 18:14 ` Bill Findlay
2013-06-23 23:43 ` Robert A Duff
2013-06-23 23:48 ` Bill Findlay
2013-06-24 20:16 ` Randy Brukardt
2013-06-24 20:05 ` Randy Brukardt
2013-06-25 1:09 ` Robert A Duff
2013-06-25 19:37 ` Randy Brukardt
2013-06-23 12:28 ` Robert A Duff
2013-06-24 20:20 ` Randy Brukardt
2013-06-24 21:40 ` Niklas Holsti
2013-06-25 0:43 ` Robert A Duff
2013-06-25 19:23 ` Randy Brukardt
2013-06-25 19:19 ` Randy Brukardt
2013-07-09 11:24 ` Martin
2013-07-09 14:39 ` Simon Wright
2013-07-10 7:03 ` Martin
2013-07-09 21:43 ` Robert A Duff
2013-07-10 6:34 ` Martin
2013-07-10 8:24 ` Dmitry A. Kazakov
2013-07-10 13:06 ` Martin
2013-07-10 16:12 ` Simon Wright
2013-07-10 18:22 ` Martin
2013-07-10 19:41 ` Simon Wright
2013-07-11 18:28 ` Martin
2013-07-11 19:37 ` Simon Wright
2013-07-11 20:43 ` Martin
2013-07-12 6:57 ` Simon Wright
2013-07-12 8:05 ` Martin
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox