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,9cccf6ef6149fdaa X-Google-Attributes: gid103376,public From: Charles Hixson Subject: Operators -> unit analysis Date: 2000/01/05 Message-ID: <387383D0.4EA02E95@earthlink.net>#1/1 X-Deja-AN: 568720081 Content-Transfer-Encoding: 7bit References: <38620350.48F8FC08@gecm.com> <83u8l0$5i5$1@nnrp1.deja.com> <84rd2f$snm$1@nntp3.atl.mindspring.net> <84thof$9r3$1@nntp4.atl.mindspring.net> X-Posted-Path-Was: not-for-mail X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-ELN-Date: Wed Jan 5 09:47:58 2000 X-Complaints-To: abuse@earthlink.net X-ELN-Insert-Date: Wed Jan 5 09:47:58 2000 X-Trace: newsread1.prod.itd.earthlink.net 947094478 198.94.156.19 (Wed, 05 Jan 2000 09:47:58 PST) Organization: EarthLink Network, Inc. MIME-Version: 1.0 NNTP-Posting-Date: Wed, 05 Jan 2000 09:47:58 PST Newsgroups: comp.lang.ada Date: 2000-01-05T00:00:00+00:00 List-Id: Terry Sikes wrote: > ... > One thing I'd like to see in both languages is the ability to use a > set of non-reserved Unicode symbols for operator overloading, to > disambiguate with the normal operator symbols. > > Terry > -- > tsikes@netcom.com I don't insist on unicode, but I would also like more operators that could be overloaded. How about swiping a leaf from Fortran60 (.le., .eq., ...) and allowing symbols beginning with a (e.g.) period, then a string of chars between succ (" ") and char (126) and then another period, with white space separations required on each side, to be an overloadable operator? And some good way to handle units. So that we could safely say things like: speed := 37.miles / 1.5.hours; I'm not too pleased with the syntax, but the idea is there. Computer languages should make unit analysis easy! This is one of the "promises" of abstract data types, but I don't feel that it's been truly fulfilled, largely because it's too difficult to use. Syntax is part of the problem, and standard libraries are another part (or perhaps that one's been solved, and I just don't know). But standard types should be defined for all the standard metric units, and most of the more common English units, with conversion functions between them. I guess that the standard example package, Rational, is a good example of how it could be done, but there is lots of detail work, and it needs to be standardized. If there is a work group on this, I would like to know about it. The recent Mars probe again brought this to my attention. They may not have been using Ada (I didn't bother to check), but avoiding this kind of problem is something that Ada should be for. I dislike the syntax: speed := (37 * mile) / (1.5 * hour); though I prefer it to: speed := miles (37) / hours (1.5); but that's the best that I know how to do it in Ada. Is there a better choice? (I.e. one that would look more like what a math student would write in a word problem?) Of course one could say: dist : constant Miles := 37; time : constant Hours := 1.5; speed : MpH; speed := dist / time; but that seems quite unnecessarily verbose!