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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a24:a945:: with SMTP id x5mr11791564iti.26.1550417778579; Sun, 17 Feb 2019 07:36:18 -0800 (PST) X-Received: by 2002:a9d:19a4:: with SMTP id k33mr180922otk.5.1550417778459; Sun, 17 Feb 2019 07:36:18 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!news.redatomik.org!fdn.fr!proxad.net!feeder1-2.proxad.net!209.85.166.215.MISMATCH!y22no332209ita.0!news-out.google.com!d79ni378itc.0!nntp.google.com!y22no332206ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 17 Feb 2019 07:36:18 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=70.109.61.2; posting-account=QF6XPQoAAABce2NyPxxDAaKdAkN6RgAf NNTP-Posting-Host: 70.109.61.2 References: <51243c9b-baba-43ad-b227-fe39c045d403@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <70d5022b-963d-4ee5-b45d-e9c6a28037eb@googlegroups.com> Subject: Re: Private extension of a synchronized interface From: Jere Injection-Date: Sun, 17 Feb 2019 15:36:18 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:55546 Date: 2019-02-17T07:36:18-08:00 List-Id: On Sunday, February 17, 2019 at 9:52:42 AM UTC-5, Dmitry A. Kazakov wrote: > On 2019-02-17 14:46, Jere wrote: > > On Sunday, February 17, 2019 at 4:50:24 AM UTC-5, Dmitry A. Kazakov wrote: > >> > >> But synchronized interfaces are totally bogus from the software design > >> POV. It is a pure implementation aspect exposed. Why do you care? > >> Aggregate a protected object and delegate primitive operations to it. > >> > > > > That's what I am doing as my own solution. I was intrigued with the code > > above as an alternate solution because it could potentially give a > > compile time indication that a procedure was a protected operation (as > > opposed to me relying on simply providing that via comments). > > Given to who? The compiler knows already, the user should not care. It > is an implementation aspect which simply does not belong here. > The compiler cannot always tell depending on how and where you call buried protected operations. I always prefer compile time catching over run time catching. > > A delegate non protected procedure has to rely on the comment. > > There is no contract that could require it protected. It is a property > of the object/task and no property of an operation. You could not do > anything with a task or protected object that would not resolve into a > protected action anyway. Protected procedures/functions/entries are particularly heavy operations. I don't know if you generally work in low level embedded environments, but being able know and plan for that can be very critical. It can change how you approach your design. When you work in systems where your system clock is 1-4MHz, timing of operations does start to matter. > > However, I honestly > > wanted to know why Ada allowed one to setup the private extension but not > > allow you to actually provide the functions (or if this was a GNAT issue or > > if I was just not using the right syntax). So the reason I care was a > > thirst for knowledge of how things work. > > Ada 2005 stuff, most of it makes little sense to me. It was some > halfhearted attempt to unite tagged types with tasks and protected > objects with no desire to actually do that... > I'm just curious if or why the process was stopped half way instead of abandoned or completed (again that is assuming I didn't use the wrong syntax, in which case it's simply that I'm structuring the syntax wrong). I don't really need to marry them with tagged types. I do appreciate the ability to dispatch over a group of related but different tasks much more easily and the interfaces give that. The way that Ada chose to implement interfaces is one of many ways (not all of which would have required tagged types).