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,4961da398a273222 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-02-25 14:20:00 PST Path: nntp.gmd.de!news.rwth-aachen.de!news.rhrz.uni-bonn.de!RRZ.Uni-Koeln.DE!uni-duisburg.de!zib-berlin.de!news.mathworks.com!news.alpha.net!uwm.edu!lll-winken.llnl.gov!noc.near.net!eisner!kilgallen From: kilgallen@eisner.decus.org (Larry Kilgallen, LJK Software) Newsgroups: comp.lang.ada Subject: Re: Ada self-referential operators Message-ID: <1995Feb25.082813.9224@eisner> Date: 25 Feb 95 08:28:13 -0500 References: <3gnkjb$gso@miranda.gmrc.gecm.com> <3grqrf$jkd@gnat.cs.nyu.edu> <3id9qi$a7m@usenet.srv.cis.pitt.edu> Organization: DECUServe Date: 1995-02-25T08:28:13-05:00 List-Id: In article <3id9qi$a7m@usenet.srv.cis.pitt.edu>, sparre+@pitt.edu (Jacob S. Andersen) writes: > A really useful feature (for math) in a programming language would be the > ability to explain algebraic relations (is this the right words?). Something > like: > > operator Complex "*" Complex precedes Complex "+" Complex ; > operator Complex "-" Complex equivalent with Complex "+" Complex ; > operator "-" Complex precedes Complex "*" Complex ; > > relation Complex.Left "*" Complex.Right equivalent with > Complex.Right "*" Complex.Left ; > relation Complex.Left "+" Complex.Right equivalent with > Complex.Right "+" Complex.Left ; > relation Complex.Left "-" Complex.Right equivalent with > Complex.Left "+" ( "-" Complex.Right ) ; I don't know math, but I do know software maintenance, and I think this would be a perfectly horrible addition to Ada. (I don't mind if you make the change to C.) I suppose flexible precedence declarations would be ok so long as they could only be used on symbols which are _not_ in the standard precedence scheme for the language. > I think it might help optimizing the code, but I'm not sure. For write-only source code, I supposed it might make the source shorter, but readability is paramount in a program which is to be dealt with on two or more days. For "optimizing" machine instructions, there are lots of things which can be done with the innards of compilers, independent of the exact syntax of source language. Some of them, of course, fare better with a high level language like Ada, and nothing you propose would affect high quality optimizers one way or the other. I don't mean to be hostile to research mathematicians, but I presume the reason you brought it up for discussion is to get the perspective of others. Larry Kilgallen Using Ada since 1988 without a government mandate