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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b19fa62fdce575f9 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-12-04 14:28:58 PST Path: bga.com!news.sprintlink.net!pipex!uunet!gwu.edu!gwu.edu!not-for-mail From: mfeldman@seas.gwu.edu (Michael Feldman) Newsgroups: comp.lang.ada Subject: Re: Why don't large companies use Ada? Date: 4 Dec 1994 17:16:55 -0500 Organization: George Washington University Message-ID: <3btf4n$jma@felix.seas.gwu.edu> References: <3bj07h$qus@felix.seas.gwu.edu> <3blc1s$8gr@network.ucsd.edu> NNTP-Posting-Host: 128.164.9.3 Date: 1994-12-04T17:16:55-05:00 List-Id: In article <3blc1s$8gr@network.ucsd.edu>, Matt Kennel wrote: >Does these include lepton number? Charge? :-) No, but could. My little package is only length/mass/time, but could be extended to the fourth charge dimension. > >Atomic concentrations? Temperature? (Do you keep that separate >or consider it as energy units through boltzmann's constant? Usually >that's wrong, but sometimes right?) Units of electric field? > >What system of lengths/time/masses? Could be adapted to MKS, CGS, or both, with conversion constants. It's really intended to show the technique, not to be exhaustive. > >I think it's a nice student project, but in real physical computations, the >right way is often to go into a system of units that is natural for your >problem, and work with these nondimensional variables. Well, this is a matter of taste, I think. That my CS2 classes can handle it shows that it's conceptually simple. Lots of engineers have seen it and said they could use it in their work, with some "localization". BTW - the variant-record solution is not at all original with me; it's been sketched out several times in the literature. I take credit only for boiling it down and making a pretty complete package out of it, so that it shows how to handle dimensions and also how Ada does safe variant records. Your "nondimensional" variables are fine, and in Ada would be done, presumably, by just creating a bunch of nicknames for Float (say): SUBTYPE Length IS Float; SUBTYPE Mass IS Float; etc. I have no problem with this approach. Recall that the thread started with a guy who said Ada's type system gets in the way of declaring _new_ or _derived_ types to handle units, e.g. TYPE Length IS DIGITS 6; TYPE Mass iS DIGITS 6; He correctly pointed to the need to define "zillions" of operators to cover meaningful expressions using this style. I simply responded that there are alternative "bulletproof" ways of handling dimensions. >You usually gain more insight into the important terms in your computations >and you don't end up with insanely small or insanely large exponents (no >overflow) unless things are physically negligable or dominant. I quite agree. What leads us to discuss dimensioned variables is the number of "urban myths" telling horror tales of botched rocket launches and the like, caused by mangled dimension analysis. Obviously with great care one can avoid mangling the dimension analysis. :-) Mike Feldman