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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,911abff935bc47c,start X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,63a41ccea0fc803a X-Google-Attributes: gid103376,public From: nospam@thanks.com.au (Don Harrison) Subject: Re: Naming of Tagged Types and Associated Packages Date: 1998/08/07 Message-ID: #1/1 X-Deja-AN: 378736139 Sender: news@syd.csa.com.au X-Nntp-Posting-Host: dev7 References: Organization: CSC Australia, Sydney Reply-To: nospam@thanks.com.au Newsgroups: comp.lang.ada,comp.lang.eiffel Date: 1998-08-07T00:00:00+00:00 List-Id: Matt Heaney wrote (in comp.lang.ada): :In an Ada declaration, the object and the type can't have the same name. : .. (Note that Eiffel doesn't have this "problem," because the object :and its type are in different namespaces.) to which I replied: :> I think it's not so much namespaces but the fact that the syntax allows :> you (and the compiler) to easily differentiate variables (entities in :> Eiffel parlance) from types. :> :> Some examples.. :> :> 1) Variable declarations: :> :> variable : TYPE :> :> The identifier to the left of the colon is recognised as a variable :> and the one on the right as a type. : :But this is true in Ada too. The point is that Ada doesn't use that information to disambiguate, whereas Eiffel does. Eiffel syntax is puposefully designed to leave no ambiguity as to what is a type and what is an entity - presumably so redundant information such as "_TYPE" can be omitted. It is the syntax, not different namespaces, that's responsible for the removal of ambiguity. The entity and its type happen to be defined in different modules, but that isn't why there is no ambiguity. If Eiffel syntax permitted it, they could be defined in the *same* namespace and there would still be no problem. The question is: In Ada, is all syntax involving entities and types similarly unambiguous? If so, the requirement, in Ada, that an entity and it's type have different names is an unnecessary one. Don. Don Harrison donh at syd.csa.com.au