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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED.yTvCNOh9TRCAIcX40YItlQ.user.gioia.aioe.org!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Private extension of a synchronized interface Date: Sun, 17 Feb 2019 15:52:38 +0100 Organization: Aioe.org NNTP Server Message-ID: References: <51243c9b-baba-43ad-b227-fe39c045d403@googlegroups.com> NNTP-Posting-Host: yTvCNOh9TRCAIcX40YItlQ.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 Content-Language: en-US X-Notice: Filtered by postfilter v. 0.9.2 Xref: reader01.eternal-september.org comp.lang.ada:55544 Date: 2019-02-17T15:52:38+01:00 List-Id: 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. What could make sense is an entry interface, a primitive operation which could be queued/requeued to, used in timed entry call etc. > 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. [...] > 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... -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de