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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,2a687662f09731bb X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!molokai.public-internet.co.uk!newspeer.public-internet.co.uk!caladan!bbc!news-peer-lilac.gradwell.net!not-for-mail From: "Martin Dowie" Newsgroups: comp.lang.ada References: Subject: Re: Ada Quality and Style book discussion ("_Type" suffix) Date: Thu, 17 Nov 2005 10:51:43 -0000 Organization: BAE SYSTEMS X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1506 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 Message-ID: <437c5ec8$1_1@glkas0286.greenlnk.net> X-Original-NNTP-Posting-Host: glkas0286.greenlnk.net NNTP-Posting-Date: 17 Nov 2005 10:53:01 GMT NNTP-Posting-Host: 20.133.0.1 X-Trace: 1132224781 news.gradwell.net 38039 dnews/20.133.0.1 X-Complaints-To: news-abuse@gradwell.net Xref: g2news1.google.com comp.lang.ada:6441 Date: 2005-11-17T10:53:01+00:00 List-Id: Anonymous Coward wrote: > package Name_Collisions is > > type Day is (Monday, Tuesday, Wednesday, Thursday, > Friday, Saturday, Sunday); > > type Meters is new Float; > > type Feet is new Float; > > --Oops, can't use these enums, since they were hijacked for > --numerical specs. > -- > type Length is (Feet, Meters, Miles); > > --Oops, can't use these names either, since "day" was hijacked. > -- > type Timestamp_Component is (Month, Day, Year, Hour, Minute); > > type Speed is new Float; > > --No can do. "speed" hijacked by type definition. > -- > Speed : Speed; > > end Name_Collisions; But why not use scoping to solve this? I always separate type declarations from object declarations anyway, so I never see these sorts of problems. Also, I don't think that "Speed" /is/ a good type name e.g. package SI is type Meters_Per_Second is ...; end SI; package App is Speed : SI.Meters_Per_Second; ... end App;