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: 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/05 Message-ID: #1/1 X-Deja-AN: 378101168 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 Date: 1998-08-05T00:00:00+00:00 List-Id: Matt Heaney wrote: :In an Ada declaration, the object and the type can't have the same name. :If the object is called File, then the type has to be called something :else. (Note that Eiffel doesn't have this "problem," because the object :and its type are in different namespaces.) 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. 2) Variable instantiations: !TYPE!variable The identifier framed by exclamation marks is recognised as a type and the one following as a variable. 3) Selective export: feature {TYPE} Any identifier enclosed in curly brackets is a type. 4) Constrained generic parameters: class GENERIC_TYPE [G -> TYPE] All constrained generic parameters are types. etc. Don. Don Harrison donh at syd.csa.com.au