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,bc1361a952ec75ca X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-15 22:19:50 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.stealth.net!204.127.161.2.MISMATCH!wn2feed!worldnet.att.net!135.173.83.71!wnfilter1!worldnet-localpost!bgtnsc04-news.ops.worldnet.att.net.POSTED!not-for-mail From: "David Thompson" Newsgroups: comp.lang.ada References: <3B6555ED.9B0B0420@sneakemail.com> <9k3l9r$10i2$1@pa.aaanet.ru> Subject: Re: How to make Ada a dominant language X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Message-ID: Date: Thu, 16 Aug 2001 05:19:49 GMT NNTP-Posting-Host: 12.89.147.208 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 997939189 12.89.147.208 (Thu, 16 Aug 2001 05:19:49 GMT) NNTP-Posting-Date: Thu, 16 Aug 2001 05:19:49 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:11971 Date: 2001-08-16T05:19:49+00:00 List-Id: Gary Lisyansky wrote : [ Ada vs C&friends declaration syntax ] > Dubious. In reality, only C/C++/Java use this "type first" order in > declarations. Pascal uses Ada- like syntax, VB uses even more verbose > construct (Dim Count As Integer) and so on. I've never heard anyone complain > about "var name first" declaration convention. > C declarations are actually "type outside" (identifier "in the middle", aka "declaration follows use"); the canonical example is the Unix/POSIX "signal" API, a function which takes an int and a pointer to function of int returning void and returns a pointer to function of int returning void: void (*signal(int, void (*)(int)))(int) This reduces to "type first" only for types defined entirely by specifiers and pointer (or C++ reference) declarators (although mixing the latter is bugprone). C++ is technically the same, but encourages greater use of named and instantiated (template) types, which fall into the "specifiers only" case along with (in both languages) primitive types. In C the contents of a struct (or union or enum) follow the tag (if used) but precede the object and/or typedef name(s); C++ is again technically the same, with classes slightly modifying structs, but encourages use of the tag only. algol is the only language I know of which consistently puts a complete type description before the identifier, though it also allows alternative sugar for routines, as do all(?) other languages that even have routine/ function/subprogram/etc. types to begin with. Java allows either the C/C++ syntax or a swapped (but not algolish) one for array, a syntax almost like C++ for classes, no other data type derivation, and method (routine) syntax like C/C++ prototypes. Original FORTRAN split its limited type information much like C; modern Fortran (F90,F95) moves more of the type information to the left, except for structures and subprogram "interface" declarations. COBOL and PL/1 put all type information to the right _except_ structure nesting "levels". Ada and the Pascal family (as stated) put full type information to the right, and LISP does so if declarations are used at all (they are (almost?) always optional). Personally I prefer the Ada syntax, although I think Fortran syntax can be fine for the sort of applications that language is best suited to; and I agree that it certainly shouldn't be a big deal either way. -- - David.Thompson 1 now at worldnet.att.net