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,1b41412c7bc28c47 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!eweka.nl!lightspeed.eweka.nl!83.128.0.11.MISMATCH!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!xindi.nntp.kabelfoon.nl!npeer.de.kpn-eurorings.net!npeer-ng1.kpn.DE!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Suffix _T for types found good 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: <2e9ebb23-a68b-43cf-8871-febcb173f951@56g2000hsm.googlegroups.com> <4899d2af$0$19731$4d3efbfe@news.sover.net> <9LmdncTBAPGV5jbVnZ2dnUVZ_sTinZ2d@comcast.com> <37793f2b-2cc6-4aba-856e-cbfe503872a5@v16g2000prc.googlegroups.com> <1xqborx4epefc.11z7g8cmj4nlp.dlg@40tude.net> <2259e1a3-e04c-4662-affb-dae07baa4a43@x16g2000prn.googlegroups.com> Date: Thu, 21 Aug 2008 11:44:21 +0200 Message-ID: <15wlgjkqt5q6a.10di4wskins28.dlg@40tude.net> NNTP-Posting-Date: 21 Aug 2008 11:44:23 CEST NNTP-Posting-Host: c958851b.newsspool1.arcor-online.net X-Trace: DXC=KZ]J6n83>Qf[F<50eo:0knic==]BZ:afn4Fo<]lROoRa4nDHegD_]ReUc>niaN[d[bDNcfSJ;bb[eIRnRBaCd On Wed, 20 Aug 2008 13:37:03 -0700 (PDT), Adam Beneschan wrote: > On Aug 20, 8:38 am, "Dmitry A. Kazakov" > wrote: >> On Wed, 20 Aug 2008 07:25:12 -0700 (PDT), Adam Beneschan wrote: >>> Yeah, earlier on in this thread I was thinking about whether it would >>> have been possible for Ada to have separate namespaces for types and >>> other non-type entities without ambiguities. Attributes make this >>> impossible. >> >> Nope. In all cases the type and variable names can be overloaded. Any >> difference between them is not lexical. > > Apparently I didn't make myself clear, since we seem to be talking > about two totally different things. Either that, or I just don't > understand what you're saying. > > Let me try to make myself clearer: If there were a rule change in Ada > so that types (or subtypes) could have the same identifiers as other > entities in the same scope, in many or most cases the compiler could > unambiguously determine from context whether the identifier refers to > the type: > > XYZ : Some_Type; > type XYZ is array (1..10) of Some_Other_Type; > An_Object : XYZ; > > In this last line, it's clear that only the type declaration could be > meant by XYZ. But in attribute cases, it can be ambiguous: XYZ'First, > XYZ'Last, XYZ'Size, probably some others. So that aspect of the > language would need a new design. I'm not sure whether there are > other cases, besides attributes, where the identifier would be > ambiguous. My point is that this does not differ from the case when XYZ are two variables visible from two different packages: package A is XYZ : Some_Type; end A; package B is XYZ : Some_Type; end B; use A, B and XYZ'First will be ambiguous. It is not a lexical problem. S'First is just an expression it might be ambiguous. So what? The real problem is that the ambiguity might be impossible to resolve. But this isn't new. There already exist cases when names get hidden forever. So long types are not first-class citizens in Ada, we could have a different namespace for them. Not that I would advocate for that! -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de