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.3 required=5.0 tests=BAYES_00,INVALID_MSGID 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: Matthew Heaney Subject: Re: Naming of Tagged Types and Associated Packages Date: 1998/09/06 Message-ID: #1/1 X-Deja-AN: 388432725 Sender: matt@mheaney.ni.net References: <35F27E6D.81DDD0B2@sprintmail.com> NNTP-Posting-Date: Sun, 06 Sep 1998 09:28:34 PDT Newsgroups: comp.lang.ada Date: 1998-09-06T00:00:00+00:00 List-Id: "John G. Volan" writes: > > For example, > > an object of type "Speed_In_Knots" is presumably the speed for > > some particular other entity. Presuming that that other entity has > > a meaningful name, then its speed might be named "_Speed". > > Are you suggesting this sort of redundancy: > > type Car is ... > record > ... > Car_Color : Color; > Car_Speed : Speed_In_Knots; > ... > end record; > > ... -- Usage: > Some_Car : Car; > ... Some_Car.Car_Color ... > ... Some_Car.Car_Speed ... Your example illustrates why it's probably better to name scalar types with both qualifier and units: type Car_Color is ...; type Car_Speed_In_MPH is ...; type Car_Type is record Speed : Car_Speed_In_MPH; Color : Car_Color; ... end record; Car : Car_Type; ... Car.Speed ... ... Car.Color ...