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: g2news1.google.com!news2.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Types, packages & objects : the good old naming conventions question (without religious ware) References: <4ae9dade$0$6551$9b4e6d93@newsspool4.arcor-online.net> <4aef3911$0$7617$9b4e6d93@newsspool1.arcor-online.net> <4af2ba89$0$6566$9b4e6d93@newsspool4.arcor-online.net> <4af42f5b$0$7624$9b4e6d93@newsspool1.arcor-online.net> <4af5841f$0$6583$9b4e6d93@newsspool3.arcor-online.net> From: Stephen Leake Date: Tue, 10 Nov 2009 02:58:50 -0500 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (windows-nt) Cancel-Lock: sha1:x4nD8MlQlc0n2UEvAiOk/FwDSqM= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 57b974af91d0ce197caa714488 Xref: g2news1.google.com comp.lang.ada:8067 Date: 2009-11-10T02:58:50-05:00 List-Id: "Vincent Marciante" writes: >>> Supposedly, then, they did not deem String : String a natural thing, >>> even though they were good programmers. >> >> That's a stretch! Avoiding actual ambiguities is a better reason. But >> I don't presume to read their minds. It would be interesting to read >> some rationale on this; I don't think there is any in the Ada Language >> Manual. > > What I gathered was that the original chief language > designer constructed the language rules with a goal > of trying to drive/impose the necessity of "good" > program architecture and trying to prevent/discourage > "bad" program architecture and I think that the following > was one of the things that was to be promoted: > > - separating (having in different packages) the declaration > of types (abstract data types) and object of the type. Maybe, but we are also talking about subprogram parameters, which are in the same package. And there are certainly valid use cases for local types, especially subtypes. > I think that having two namespaces would have made > having both in the same declarative region easier Not much, it just would have avoided _Type. > but that would only really come up for the type > and only one object (or as a yucky "workaround") > an array of them) declared together. Clearly, whenever > there are two objects of the type, the simple name > of one of them _must_ be different than the name of > the type unless they are in different declarative > regions. Again, not true for subprogram parameters; there are many (one per subprogram) with the same name. I guess the subprogram parameter list can be thought of as a separate declarative region; I'm not sure it is formally. > Also, I showed that the "parameter of subprogram > declaration" case (which was the old example that > I brought up in an earlier message) is easily and > elegantly dealt with by the sjkdf.type_name construct Yes. > So, that there is really no need for two namespaces but there also > is really is no need for any overall naming convention either! No, there is still a need for a convention; people need to know how to react to the compiler error message. You are proposing that the convention be "add enough of the full name of the type to disambiguate". Which is also the convention for resolving other name ambiguities (rather than changing one). -- -- Stephe