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-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!newsfeed.freenet.de!news.teledata-fn.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Types, packages & objects : the good old naming conventions question (without religious ware) 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: <561e0a4a-c6c0-42db-9f31-a70f4eae1ed9@a21g2000yqc.googlegroups.com> <5vzuqtkwuhwy$.21swwhszn06r.dlg@40tude.net> <4af29192$0$26348$4f793bc4@news.tdc.fi> Date: Fri, 6 Nov 2009 11:24:10 +0100 Message-ID: <2hnc608mt51m.1mkbd045vmnui.dlg@40tude.net> NNTP-Posting-Date: 06 Nov 2009 11:24:10 CET NNTP-Posting-Host: 27af6364.newsspool1.arcor-online.net X-Trace: DXC=CS_clLlkWFVU6b:FjPaGjQic==]BZ:af^4Fo<]lROoRQ<`=YMgDjhgRf3;;Ikb25B\[6LHn;2LCV^7enW;^6ZC`TIXm65S@:3>_Nmkghdo:EGU X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:9010 Date: 2009-11-06T11:24:10+01:00 List-Id: On Fri, 06 Nov 2009 04:54:46 -0500, Stephen Leake wrote: > Niklas Holsti writes: > >> Dmitry A. Kazakov wrote: >> >>> Consider it this way, if _Type is felt appropriate then that is >>> semantically equivalent to types having a separate name space. The latter >>> could be introduced in Ada at any time, being fully backward compatible. >> >> I'm not sure about the backward compatibility. For one thing, the >> Size attribute may have a different value for a type and for an object >> of the type. This means that given an object declaration "List : >> List", where the latter List is a type name, the expression List'Size >> would be ambiguous and could have a different value for the object >> List and the type List. > > The definition of "backward compatible" is "all existing legal > programs will still be legal". > > This ambiguity does not exist in existing legal programs. And it will not be imposed there by introducing a separation, because presently such names collide. > It is a good reason not to have separate name spaces; how would we > resolve the ambiguity? As always by using full names. Note that the argument that some of such names are still ambiguous does not really work, because this is already so in Ada. For example, overloaded subprograms and literals may have indistinguishable full names. So this problem must be addressed anyway. The traditional Ada way would be a qualified expression: (type'(T))'Size This returns us back to a more important argument against separate name spaces. Do we really want to have types second-class citizens forever? Are we sure that a type never ever appear in a context of an object? A qualified expression at least suggests that a type is an object. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de