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: Laurent.Guerby@enst-bretagne.fr (Laurent Guerby) Subject: Re: some questions re. Ada/GNAT from a C++/GCC user Date: 1996/04/01 Message-ID: <4xn34w5i73.fsf@leibniz.enst-bretagne.fr>#1/1 X-Deja-AN: 145216101 distribution: world sender: guerby@leibniz.enst-bretagne.fr references: content-type: text/plain; charset=US-ASCII organization: Telecom Bretagne mime-version: 1.0 newsgroups: comp.lang.ada Date: 1996-04-01T00:00:00+00:00 List-Id: [comp.lang.c++ removed since this has nothing to do with C++] Robert A Duff writes [deleted] : Sorry to keep disagreeing with you, John, but this seems like the tail : wagging the dog. If the reason I'm required to add 3 extra junk lines : of code, just to declare a simple variable, is because of tasks, then : that's just poor language design. [deleted] If you follow the GNU Coding Standard, here is how you have to declare (indent) an inner block (loop, if ...) : { int local; foo (local); bar (global); } (I don't think the blank line is required, but I've nearly never seen a C program that do not put a blank line between locals and code, even in "bad" written code.) The Ada version looks like : declare Local : Integer; begin Foo (Local); Bar (Global); end; Hey, the number of line is the same ! Cool isn't it ;-). Ok, you type more charaters. BTW, in any real code, the source documentation will add some lines to explain the use of local (if not clear according to the name choosen) and the algorithm, making all this discussion a bit useless. And an Ada declaritive region is not a C one, just play with aggregates and try to translate it in C, it will add a few "junk" lines of code ;-). Semantic differences between a declarative region and a handled sequence of statement put aside. : - Bob -- -- Laurent Guerby, student at Telecom Bretagne (France), Team Ada -- "Use the Source, Luke. The Source will be with you, always (GPL)" -- http://www-eleves.enst-bretagne.fr/~guerby/ (GATO Project) -- Try GNAT, the GNU Ada 95 compiler (ftp://cs.nyu.edu/pub/gnat)