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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,54889de51045a215 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-19 14:09:09 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: dmytrylavrov@fsmail.net (Dmytry Lavrov) Newsgroups: comp.lang.ada Subject: Re: += in ada Date: 19 Oct 2003 14:09:09 -0700 Organization: http://groups.google.com Message-ID: <49cbf610.0310191309.592287c3@posting.google.com> References: <3F7316F7.219F@mail.ru> <17cd177c.0310010606.52da88f3@posting.google.com> <3F8BC74F.2CFBFF37@0.0> <1066312000.671303@master.nyc.kbcfp.com> <1066322883.139702@master.nyc.kbcfp.com> <3F8F372D.9040801@comcast.net> <3F8F4559.50306@noplace.com> NNTP-Posting-Host: 213.248.15.30 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1066597749 24498 127.0.0.1 (19 Oct 2003 21:09:09 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 19 Oct 2003 21:09:09 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:1152 Date: 2003-10-19T14:09:09-07:00 List-Id: Russ, How many times you're mistyped :+ as := ? (because + is on same key as =) And,if i'm writing c:=a+b; (a,b,c is not a booleans) and making mistake c:=a=b; i will see compiler error. But in a:+b; and a:=b; it's compilable typo. I think(because had very bad typos) that compilable typo is a really worstest bug you can have. It's spending days thinking what's wrong!(especially if almost always a=0,and after some improvement,a<>0). >Oh, I see. So efficiency is no longer an issue. Well, excuse me, but I >think we'd be better off leaving that judgment to each application >developer. Controlling a building temperature is one thing, but >delivering a cruise missile to Saddam Hussein's front door is quite >another. About speed of a:=b+c; Some CPU's simply can't "add to ram" (don't have such instruction), for many other CPU's,it's NOT faster to do mov eax,b add a,eax than mov eax,a add eax,b mov a,eax because in both examples,processor have to read a and b into registers,add 'em,and then put result into ram.It's basics about how cpu works.Ram simply can't "add value from cpu".If course,first example is smaller,and have lesser number of instructions to execute,but it does not make so big difference,and some x86 CPUs does last example FASTER than first (really,you should know it if you're worry so much about speed). And about more complex datatypes: it's better to write procedure than to overload an operator,especially in safety critical system. If you're REALLY care about speed,you should manually simplify expressions with,for example,vectors,for each component of vector(huh,do yo ever think about doing it for matrices(big enought,say,>4x4)? It's like nightmare). And especially about matrices ,vectors,and ":*" 1:math operation need temp itself. 2: a*b<>b*a, so we should have different operators for a:=a*b; and a:=b*a; Dmytry Lavrov. http://dmytrylavrov.narod.ru/voxfoge.htm