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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7d83a6223f4f2443 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!newsfeed.straub-nv.de!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Run-time accessibility checks (was: Construction initialization problem) Date: Wed, 10 Dec 2008 18:55:41 -0600 Organization: Jacob Sparre Andersen Message-ID: References: NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1228956953 18625 69.95.181.76 (11 Dec 2008 00:55:53 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 11 Dec 2008 00:55:53 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Xref: g2news1.google.com comp.lang.ada:2952 Date: 2008-12-10T18:55:41-06:00 List-Id: "Dmitry A. Kazakov" wrote in message news:txbc0ucekvix.ntpy85qsan7h$.dlg@40tude.net... > On Fri, 5 Dec 2008 19:42:40 -0600, Randy Brukardt wrote: ... >> I think that I might be able to fix the problem in the context of the >> containers only, and for dereference of the objects only, but it is not >> clear that the fix is worth the effort. > > It certainly does not. IMO Ada needs "setters" with the syntax sugar of an > assignment, it does not need outward access types. The whole idea is just > not Ada. Well, I've thought about that, but I don't see a decent way to describe read/write semantics other than with an access type. Specifically, I was trying to figure out a user-defined dereference operation. One would presume that we would use an operator function for that, but what would it look like? The obvious answer of: function "all" (Obj : in Some_Type) return access Some_Other_Type; has the accessibility issues. And something like: function "all" (Obj : in Some_Type) return Some_Other_Type; means that you have (usually) copy semantics and in any case no assignment into. That doesn't really fix anything. You certainly can't have a procedure ":=" to do assignment in because of discrimant-dependent components. That's never going to change for Ada, so please forget that. I suppose you could have a component setter, but that requires a procedure with two names: procedure .":=" (Target : in out Some_Tagged_Type; Source : in Some_Other_Type); which would then be used as: Target. := Source; But that looks like a giant change to the Ada models, almost certainly out of scope for this current round. And it certainly means no useful iterators. And it also isn't very flexible -- where does the Cursor of a container go?? And so on. Randy.