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,f92fbb4a0420dd57 X-Google-Attributes: gid103376,public From: bcf@ssd.ray.com (Felaco) Subject: Re: some questions re. Ada/GNAT from a C++/GCC user Date: 1996/04/02 Message-ID: #1/1 X-Deja-AN: 145506793 sender: news@ssd.ray.com (Administrator) x-nntp-posting-host: shamu.ssd.ray.com references: organization: Raytheon Electronic Systems, Portsmouth RI Facility newsgroups: comp.lang.ada Date: 1996-04-02T00:00:00+00:00 List-Id: Tucker Taft (stt@henning.camb.inmet.com) wrote: : I find the easiest way to deal with extra, seemingly unnecessary, : levels of constructs is to "half" indent. [snip] : Another alternative is to "merge" constructs, e.g.: : if A > 0 then declare : B : Integer := A; : begin : -- This is my normal indent of 4 : A := B * A; : end; else : A := 2; : end if; I prefer this approach, but tell that to Rational, whose Apex product insists on changing it on me... Anyway, it would have been *nice* if we could dispense with the 'declare' and the 'end' when a new scope is introduced anyway, like in an if block or a loop. I don't see how backwards compatibility with Ada83 would be compromised, or any other rules would have to change. ie: if whatever then X : Integer; Y : Some_Task_Type; begin do_something; else loop Y : Boolean; begin do_something_else; exit when Y; end loop; end if; I find the above just as human-readable, and still machine-readable. The presence of the declaration signals that a new scope is introduced, the begin serves as a separator and the else serves as the end. Why not? : In any case, if our biggest problem with Ada 95 is that it requires : an explicit "declare" to introduce very local variables, I'm content... I doubt it's the biggest problem with Ada 95, but it is one of the first things that narrow-minded people who resent being told to learn new languages pick up on and complain about. Sometimes you need to make some concessions to these people whether you like it or not. ------------------------------------------------------------------------------- Chris Felaco Phone: x4631 (Raynet 444, Local 842) Raytheon Company Email: bcf@ssd.ray.com -------------------------------------------------------------------------------