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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: buffer1.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!goblin3!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: If not Ada, what else... Date: Tue, 21 Jul 2015 23:51:41 +0200 Organization: cbb software GmbH Message-ID: <5z82vu617j2h$.ls4rgwlc79r4.dlg@40tude.net> References: <877fq9uj6g.fsf@theworld.com> <65061686-5c8f-433b-9b11-9e228298158e@googlegroups.com> <87k2u96jms.fsf@jester.gateway.sonic.net> <06f8a6f9-d219-4d40-b9ac-8518e93839bd@googlegroups.com> <87y4io63jy.fsf@jester.gateway.sonic.net> <7a29d3e9-d1bd-4f4a-b1a6-14d3e1a83a4d@googlegroups.com> <87mvz36fen.fsf@jester.gateway.sonic.net> <2215b44f-8a89-47c6-a4c4-52b74d2dac45@googlegroups.com> <9e492c82-868d-43d3-a18a-38274400e337@googlegroups.com> <40184feb-4053-4ac3-8eaa-c3bd9cd8a77c@googlegroups.com> <10272577-945f-4682-85bc-8ad47f3653ae@googlegroups.com> <87si8i81k2.fsf@atmarama.net> <1gsux33dqvjbp$.h0prf7p7g2vn.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: 5ZS5s7Q3rAN7MBP/UXLPIQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: number.nntp.giganews.com comp.lang.ada:194252 Date: 2015-07-21T23:51:41+02:00 List-Id: On Tue, 21 Jul 2015 22:06:54 +0100, Simon Wright wrote: > "Dmitry A. Kazakov" writes: > >> On Tue, 21 Jul 2015 19:51:29 +0100, Simon Wright wrote: > >>> abstract class type A is >>> procedure P1 (This : in out T) is abstract; >>> end A; >>> >>> class type T is new A with >>> overriding procedure P1 (This : in out A); >>> not overriding function F1 (This : A) return Integer; >>> private >>> V : Integer; >>> end T; >>> >>> etc etc; not a million miles from Ada as we know it. >> >> Conceptually it is. Operations do not belong to types. > > Huh? function "*" (X : Matrix; Y : Vector) return Vector; To which type does "*" belong? >> Then everybody agreed that the syntax of protected objects was a >> mistake. > > I don't remember agreeing The object's private part should not appear in the package's public part. It is a privacy breach. >> Why repeating this flawed syntax for classes? It is again about >> fundamentals, privacy is not a type property. It is of a module. > > Well, as far as I can see protected types, tasks and (in this > not-to-be-taken-seriously proposal) classes are modules, in a way. Then they should be compilation units, which would make them unusable. Though they are already unusable when more than one type should be declared. The most typical declaration order is types first: type X1 is ... type X2 is ... procedure Op1 (A : X1); procedure Op2 (B : X2; C : X1'Class); procedure Op3 (D : X1; E : X2'Class); ... private type X1 is ... type X2 is ... It cannot be reordered without a complicated system of forward incomplete declarations which in the end would dilute the very idea of having type and operations declared in one place, with brackets put around the place. (Because the idea is based on a wrong concept) And of course, there would be no way to derive privately from a more specific type: type Q is new T with private; private type Q is new S with ...; -- S <: T -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de