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,2afac1a4161c7f35 X-Google-Attributes: gid103376,public From: Mats Weber Subject: Re: Distinguishing type names from other identifiers Date: 1998/01/30 Message-ID: <34D1CFC8.4FD5CB8A@elca-matrix.ch>#1/1 X-Deja-AN: 320550897 Content-Transfer-Encoding: 7bit References: <01bd2078$a449b460$41fd82c1@xhv46.dial.pipex.com> <6v0LMGAjwIw0Ews0@dowie-cs.demon.co.uk> Mime-Version: 1.0 Reply-To: Mats.Weber@elca-matrix.ch Content-Type: text/plain; charset=us-ascii Organization: ELCA Matrix SA Newsgroups: comp.lang.ada Date: 1998-01-30T00:00:00+00:00 List-Id: Modula-3 has adopted the convention (it's really a convention, not part of the language) of using T as the name of the type (usually the single type) that is defined in an interface (package spec). I think that convention works pretty well. Here is a small example: INTERFACE Stack; TYPE T <: REFANY; PROCEDURE Create(): T; PROCEDURE Push(VAR s: T; x: REAL); PROCEDURE Pop(VAR s: T): REAL; END Stack. MODULE Stack; REVEAL T = BRANDED OBJECT item: REAL; link: T END; PROCEDURE Create(): T = BEGIN RETURN NIL END Create; PROCEDURE Push(VAR s: T; x: REAL) = BEGIN s := NEW(T, item := x, link := s) END Push; PROCEDURE Pop(VAR s: T): REAL = VAR res: REAL; BEGIN res := s.item; s := s.link; RETURN res END Pop; BEGIN END Stack.