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: 109fba,ef0074ec236ba6e3 X-Google-Attributes: gid109fba,public X-Google-Thread: 108717,ef0074ec236ba6e3 X-Google-Attributes: gid108717,public X-Google-Thread: 103376,b19fa62fdce575f9 X-Google-Attributes: gid103376,public X-Google-Thread: 1108a1,ef0074ec236ba6e3 X-Google-Attributes: gid1108a1,public X-Google-Thread: 1014db,ef0074ec236ba6e3 X-Google-Attributes: gid1014db,public X-Google-ArrivalTime: 1994-12-10 10:03:20 PST Newsgroups: comp.lang.ada,comp.lang.c,comp.programming,comp.lang.c++,comp.object Path: bga.com!news.sprintlink.net!howland.reston.ans.net!gatech!swrinde!pipex!uunet!newsgate.watson.ibm.com!hawnews.watson.ibm.com!jjb From: jjb@watson.ibm.com (John Barton) Subject: Re: Physical Types (was Why don't large companies use Ada?) Sender: news@hawnews.watson.ibm.com (NNTP News Poster) Message-ID: Date: Sat, 10 Dec 1994 17:38:05 GMT Disclaimer: This posting represents the poster's views, not necessarily those of IBM. References: <3aa7jo$7j@Starbase.NeoSoft.COM> <3bjf2q$i69@goanna.cs.rmit.oz.au> <3bvadv$66p@holly.csv.warwick.ac.uk> <1994Dec6.201030.366@isis.muc.de> Nntp-Posting-Host: jjb.watson.ibm.com Organization: IBM T.J. Watson Research Center Xref: bga.com comp.lang.ada:8487 comp.lang.c:34154 comp.programming:5760 comp.lang.c++:40444 comp.object:9684 Date: 1994-12-10T17:38:05+00:00 List-Id: In article <1994Dec6.201030.366@isis.muc.de>, Mike.Chapman@muc.de (Mike Chapman) writes: |> Jules (csusb@csv.warwick.ac.uk) wrote: |> : In article , |> : bobduff@dsd.camb.inmet.com (Bob Duff) writes: |> : >In article <3bjf2q$i69@goanna.cs.rmit.oz.au>, |> : >Michael Coburn wrote: |> : >>house@helios.usq.EDU.AU (ron house) writes: |> : >> |> : >>>How about "Ada - use it when you want to multiply a length by a length |> : >>>and get a length, or when you want to be prevented from dividing an area |> : >>>by a length because they have different types." |> : >> |> : >>total_area := area(length_one) * area(length_two); |> : >> |> : >>yawn.... |> : > |> : >The fact remains that Ada's type model disallows a sensible operation |> : >(Total_Area := Length_One * Length_Two), and allows nonsense |> : >(Some_Length := Length_One * Length_Two). |> |> : Only if you want to go completely over the top and define new types for lengths |> : and areas. I mean, if you did the same in C++ you would get the same results. |> : So why criticise Ada, for something which almost all commonly used languages |> : today have a problem with, if you use them in this (unusual) manner? |> |> There is a language called VHDL which was developed for |> modelling integrated circuits. It is based on Ada.... [summary of VHDL version omitted] Two references to C++ solutions to this problem are Zerksis D. Umrigar "Fully Static Dimensional Analysis with C++" ACM SIGPLAN Notices 29 (9) Sep. 1994 pg 135. John J. Barton and Lee R. Nackman, "Scientific and Engineering C++: Dimensional Analysis", C++ Report, next issue. ----- John. John J. Barton jjb@watson.ibm.com (914)784-6645 H1-C13 IBM Watson Research Center P.O. Box 704 Hawthorne NY 10598