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=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,25d835bb9a4a003f X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!news.tele.dk!news.tele.dk!small.news.tele.dk!tiscali!newsfeed1.ip.tiscali.net!fi.sn.net!newsfeed2.fi.sn.net!news.song.fi!not-for-mail Date: Fri, 06 Nov 2009 12:23:11 +0200 From: Niklas Holsti Organization: Tidorum Ltd User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Types, packages & objects : the good old naming conventions question (without religious ware) References: <561e0a4a-c6c0-42db-9f31-a70f4eae1ed9@a21g2000yqc.googlegroups.com> <5vzuqtkwuhwy$.21swwhszn06r.dlg@40tude.net> <4af29192$0$26348$4f793bc4@news.tdc.fi> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4af3f92e$0$6263$4f793bc4@news.tdc.fi> NNTP-Posting-Host: 81.17.205.61 X-Trace: 1257503022 news.tdc.fi 6263 81.17.205.61:47568 X-Complaints-To: abuse@tdcnet.fi Xref: g2news2.google.com comp.lang.ada:9009 Date: 2009-11-06T12:23:11+02:00 List-Id: 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". Yes, you and Dmitry are right, it would be backward compatible in this sense (which is the common sense). I was thinking that using the same names for types and objects would create problems, for example this ambiguity, and so it would not be "compatible" to take an existing legal program and change type names by, for example, removing "_Type" suffixes. > This ambiguity does not exist in existing legal programs. Agreed. > It is a good reason not to have separate name spaces; how would we > resolve the ambiguity? Right, that was the problem I had in mind. One way would be to have two different attributes, 'Size for objects and 'Type_Size for types. But that causes backward-compatibility problems unless 'Size is also accepted for types if the name before the 'Size is unambiguously a type name. It may also be difficult for compilers to resolve ambiguous names based on the kind of attribute applied to the name. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .