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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Received: by 2002:a5d:990a:: with SMTP id x10mr16342960iol.24.1550450183678; Sun, 17 Feb 2019 16:36:23 -0800 (PST) X-Received: by 2002:a9d:518e:: with SMTP id y14mr167931otg.2.1550450183406; Sun, 17 Feb 2019 16:36:23 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!2.eu.feeder.erje.net!4.us.feeder.erje.net!feeder.erje.net!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!y42no340470ita.0!news-out.google.com!d79ni411itc.0!nntp.google.com!y42no340468ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 17 Feb 2019 16:36:23 -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: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Private extension of a synchronized interface From: Jere Injection-Date: Mon, 18 Feb 2019 00:36:23 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:55555 Date: 2019-02-17T16:36:23-08:00 List-Id: On Sunday, February 17, 2019 at 5:36:41 PM UTC-5, Simon Wright wrote: > Jere writes: > > > -- The following line gives the error: > > -- call to abstract procedure must be dispatching > > > > --v.p1; > > If you replace this with the dispatching call > > Example.An_Interface'Class (v).p1; > > it compiles & works just fine. Good Point! Thanks! > > I'm far from being an expert on this, because I've never found the need > to use 'interface' at all, but when you say > > type An_Interface is synchronized interface; > procedure p1(Self : in out An_Interface) is abstract; > > type Instance is synchronized new An_Interface with private; > > you know that Instance provides a procedure p1, but you don't know > whether it's a task or protected entry or a protected procedure (or > even, to my surprise, a plain procedure with that profile, see Ada 2005 > Rationale). > > Of course the compiler knows, so you'd have thought that your v.p1 call > would be OK (and it _is_ OK if the full declaration of Example.Instance > is public). > > But the actual problem comes from ARM 3.9.3(7)[1], > > A call on an abstract subprogram shall be a dispatching call; > nondispatching calls to an abstract subprogram are not allowed. > > ... which has been the case since Ada 95! > > [1] http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-3-9-3.html#p7 In the other part that I commented out I was trying to add a publically available override to the interface operation, but haven't been successful. Do you know of any syntax changes I might need to do to: -- The following lines give the errors: -- "p1" conflicts with declaration at line xxx -- and -- missing body for "p1" --overriding --procedure p1(Self : in out Instance); So I don't need to always dispatch?