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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1dd28d5040ded1f8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-14 08:18:07 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: dennison@telepath.com (Ted Dennison) Newsgroups: comp.lang.ada Subject: Re: Announce: Grace project site operational Date: 14 May 2002 08:18:07 -0700 Organization: http://groups.google.com/ Message-ID: <4519e058.0205140718.3ddb1b2a@posting.google.com> References: <3CD88FBD.4070706@telepath.com> <3CD91E31.1060004@telepath.com> <3CDBD673.FF452A3D@otelco.net> NNTP-Posting-Host: 65.115.221.98 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1021389487 15132 127.0.0.1 (14 May 2002 15:18:07 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 14 May 2002 15:18:07 GMT Xref: archiver1.google.com comp.lang.ada:24028 Date: 2002-05-14T15:18:07+00:00 List-Id: "Marin David Condic" wrote in message news:... > My point is that you have to give some careful thought to creating types and > that doing it for every identifiable unique item is not usually smart. > Decisions should be made with some sensitivity as to what the types > represent and how much mixing together of the different types is needed. I'd That's the biggie. If you try to make separate types for velocities and accelerations, you will suddenly find that you also need separate types for times and distances, and perhaps even Hz and mass and forces and rotational orientations and velocitites and accelerations. Then you'll find how annoying it is to have to do type conversions on every factor in every formula. A more attractive option may be to write your own math operators that return the correct type given their two input types. But that causes an exponential growth in operators that you have to create every time you add a new unit. To do this kind of thing *right*, you'd really need a language that relies on structural equivalence for types, and automaticly generates the proper new type given the operator and the types of its operands. In Ada, you just can't do that. Generally, what I see Ada folk do is use *subtypes* for all this stuff. That way ranges are checked, but formulas don't become a chore (although you still have to be really careful with intermediate values blowing out of subtype constraints). -- T.E.D. Home - mailto:dennison@telepath.com (Yahoo: Ted_Dennison) Homepage - http://www.telepath.com/dennison/Ted/TED.html (down)