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,2078dddcdcd8d83 X-Google-Attributes: gid103376,public From: "W. Wesley Groleau (Wes)" Subject: Tangent to Religious naming convention discussion ...... Date: 1997/05/15 Message-ID: <337B1D8B.4474@this.message>#1/1 X-Deja-AN: 241745592 Sender: usenet@most.fw.hac.com (News Administration) X-Nntp-Posting-Host: sparc01 References: <33779E0D.61F8@sprintmail.com> <3378BBD2.7BBA@this.message> <3379606E.413E@sprintmail.com> <5lcefp$riu$1@ash.ridgecrest.ca.us> <3379EC80.6C9B@sprintmail.com> Organization: Hughes Defense Communications Newsgroups: comp.lang.ada Date: 1997-05-15T00:00:00+00:00 List-Id: John G. Volan wrote: > with Unitless; > package Angles is > > type Angle_Type is private; This is an excellent approach (though in itself it doesn't support the "_Type" concept--to lessen :-) the "tangent"). Just make sure you provide the clients with something like function Degrees ( From : Angle[_Type] ) return Float; -- or at least function Degrees_Image ( From : Angle[_Type] ) return String; > -- Going with a private type is a tough decision here. There is a disadvantage (easily overcome) to losing the use of attributes, .... > -- I'm not necessarily recommending it. An alternative > -- could be to make this a visible float type and just ^^^^^^^^^^^^^^^^^^ > -- override as abstract any built-in functions (e.g. "*") > -- that violate unit dimensionality. .... but this way some fool is sure to peek into your package body and, taking advantage of the "fact" that you implemented in Radians, write something like: Put_Line ( "Heading:" & Integer'Image ( Integer ( Heading * 180.0 / Pi ) ) ); Before we go off on _another_ tangent about engineering discipline, remember that many software "engineers" develop a strange form of insanity when managers start grumbling about schedules..... ---------------------------------------------------------------------- Wes Groleau, Hughes Defense Communications, Fort Wayne, IN USA Senior Software Engineer - AFATDS Tool-smith Wanna-be w w g r o l at p s e u l t 0 1 dot f w dot h a c dot c o m SPAM should be sent to I.want.one@mailbombs.for.idiots.org If you don't want to pay $500 (see 47 USC 227), don't send it here. ----------------------------------------------------------------------