From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,WEIRD_PORT autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.224.129.196 with SMTP id p4mr12732230qas.6.1371813573332; Fri, 21 Jun 2013 04:19:33 -0700 (PDT) X-Received: by 10.49.1.112 with SMTP id 16mr247924qel.20.1371813573308; Fri, 21 Jun 2013 04:19:33 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!mx05.eternal-september.org!feeder.eternal-september.org!news.bbs-scene.org!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!bw2no2534684qab.0!news-out.google.com!y6ni3811qax.0!nntp.google.com!j2no1082843qak.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 21 Jun 2013 04:19:33 -0700 (PDT) In-Reply-To: <51c42774$0$6633$9b4e6d93@newsspool2.arcor-online.net> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=20.133.0.8; posting-account=g4n69woAAACHKbpceNrvOhHWViIbdQ9G NNTP-Posting-Host: 20.133.0.8 References: <69246de0-4b33-4d47-b5be-a45e8c911fb0@googlegroups.com> <28f43920-c490-4da0-80b3-6405dec09879@googlegroups.com> <51c42774$0$6633$9b4e6d93@newsspool2.arcor-online.net> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <30876feb-1c1f-4909-be0b-bb9e7aaf0691@googlegroups.com> Subject: Re: Ada202X: Easy to use "UML private"-like components From: Martin Injection-Date: Fri, 21 Jun 2013 11:19:33 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:15873 Date: 2013-06-21T04:19:33-07:00 List-Id: On Friday, June 21, 2013 11:14:12 AM UTC+1, G.B. wrote: > On 21.06.13 11:33, Martin wrote: > On Friday, June 21, 2013 10:23:51 AM U= TC+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 th= e package and private for non-children. -- Regards, Dmitry A. Kazakov http:= //www.dmitry-kazakov.de > > But no easy means of keeping member data privat= e 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 ag= o, memory is vague. Not sure if UML has a concept for capturing this, but c= onfident that Grady Booch knows Ada's visibility rules well. (Or should one= find a sentence that has "possibilities" instead of "rules"?) package Opaq= ue is type Exposed is tagged private; private package Invisible is type T i= s tagged private; private type Scalr is range 1 .. 2; type T is tagged reco= rd Comp_1 : Scalr; end record; end Invisible; type Exposed is new Invisible= .T with null record; end Opaque; private package Opaque.Child is A : Invisi= ble.T; Y : Invisible.Scalr :=3D A.Comp_1; end Opaque.Child; Compiling: opaq= ue-child.ads (source file time stamp: 2013-06-21 10:06:44) 4. Y : Invisible= .Scalr :=3D 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 l= ines: 2 errors Thus, even a private child cannot see anything behind double= d fences. I imagine that explaining this needs some spin doctoring. Yeah, ok...hadn't thought of that way... But really, it's still a bit embaressing and it's almost as bad as the acce= ss type solution...almost... -- Martin