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, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!crdgw1!control!kassover From: kassover@control.crd.ge.com (David Kassover) Newsgroups: comp.lang.ada Subject: Re: if UNIX then USE_C ?? (was: Reasons for drop) Message-ID: <5638@crdgw1.crd.ge.com> Date: 1 Mar 90 00:29:17 GMT References: <27187@cup.portal.com> <18175@megaron.cs.arizona.edu> <5563@crdgw1.crd.ge.com> <184@trwacs.UUCP> Sender: news@crdgw1.crd.ge.com Organization: Aule-Tek, Inc. List-Id: In article <184@trwacs.UUCP> epstein@trwacs.UUCP (Jeremy Epstein) writes: >[I promised myself I wouldn't join this grudge match, but...] > >In article <5563@crdgw1.crd.ge.com>, kassover@jupiter.crd.ge.com (David Kassover) writes: >> In article <204@puma.ge.com> jnixon@andrew.ATL.GE.COM (John F Nixon) writes: >> Or even worse, I think, is the use of {} for many different kinds >> of block statements. In Ada I end a loop with end loop; I end >> an if with end if; > >While that's certainly true, look at how Ada overloads symbols. For >example, parentheses are used for parameters as well as subscripts Sigh. I promised myself I would stop. Oh, well. C is the first language (no, wait a minute, I've repressed Basic. I think. I can't remember...) I encountered that used [ ] for subscripts. Not to mention a doubly dimensioned array using the notation [][] (which *really* screwed me up once, because the comma is an operator and the syntax x [a,b] is perfectly legal, even when x is declared [i] [j]) In ada, pointers are pointers and arrays are arrays, and never the twain will share syntax. In Fortran, there is really very little to distinguish a function call from an array reference. In fact, I submit that from the standpoint of examining a program that contains a statement such as A = F (i,j,k) it really doesn't matter whether a simple memory transfer or a complex subprogram execution is called for. What can screw you up here is a "SIDE EFFECT", which Ada flatly refuses to allow. (Has anyone out there *never* done something like: A = F(1) where F was a function that caused a side effect that changed *all* literal 1's to 3.14159265's (or whatever integer those bits happened to represent? What, not never?) And while we're on the subject of side effects, the C treatment of assignment as a function that returns a value, with the side effect of making the assignment has balled me up more than once. Especially when I tried to get too cute with fancy one-line wonder macros that expanded in grand and glorious unanticipated ways... Jeremy also mentions that in Ada the word end is used as a closure for begin, and also as a closure for loop, and also as a closure for if... End all by itself ends begin. End loop ends a loop, and if you try to make it end an if, the compiler will complain. If you want to end an if, you must use end if; If you want to end a named loop, you must use an end loop AND reference the name of the named loop. End all by itself, without a matching begin, will cause a complaint from the compiler. This is a lot different from } ending the last unmatched {.