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 X-Google-Thread: 103376,dad94612ff745427 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!news3.google.com!news2.volia.net!border1.nntp.ams.giganews.com!nntp.giganews.com!feeder.xsnews.nl!feeder1.cambrium.nl!feed.tweaknews.nl!news.netcologne.de!nhp.netcologne.de!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Instantiating private types with discriminants? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1147252198.138173.203910@j73g2000cwa.googlegroups.com> <44623869$0$4504$9b4e6d93@newsread2.arcor-online.net> <87d5elk8e9.fsf@ludovic-brenta.org> <13byov3p0dqhk.yglz3nh5rpb8$.dlg@40tude.net> <2l9uhyhkrquy.1rbhnqk1k2u52$.dlg@40tude.net> <1147425891.9012.10.camel@localhost.localdomain> Date: Fri, 12 May 2006 14:40:37 +0200 Message-ID: <1dwuemv53sbgw$.1pgg57qa5hsdr.dlg@40tude.net> NNTP-Posting-Date: 12 May 2006 14:40:37 MEST NNTP-Posting-Host: d9f40e34.newsread4.arcor-online.net X-Trace: DXC=l3b>nT30aPNo47S\@TX3oE:ejgIfPPldDjW\KbG]kaMH]kI_X=5KeaFTnKKEPQA]8D[6LHn;2LCVN7enW;^6ZC`DIXm65S@:3>O X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:4217 Date: 2006-05-12T14:40:37+02:00 List-Id: On Fri, 12 May 2006 11:24:52 +0200, Georg Bauhaus wrote: > On Fri, 2006-05-12 at 09:37 +0200, Dmitry A. Kazakov wrote: > >> I beg to disagree. Semantic difference you are talking about is not always >> the problem space's one. It is often just a language artefact. In my view, >> exactly the opposite should be done, i.e. removing all traces of "all". >> (:-)) A user-defined pointer (referential) type should (IMO) be considered >> a subtype, that inherits all operations of the target type. If assignment >> gets overridden (to have shallow copy semantics), that does not >> automatically imply anything for other operations. > > Will the programmer have a chance to express whether or not > he or she is effectively creating an alias? The result is typed, that should express it. Ada is very strict about types. > Eiffel addresses this in a reversed way, I think. You can write > "expanded" before a class definition, or before the type name > in a feature declaration. So no ".all" either, but at least > a trace of objects versus references. Ada has "access qualifier" producing anonymous access type. I don't like anonymous types much. They require structural types equivalence. BTW, if pointer were a subtype, then you wouldn't need hard-wired dispatching on "access T", because the pointer will simply inherit primitive operations and thus dispatch. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de